Skip to content

Commit

Permalink
Fixes to proposed API format (#15169)
Browse files Browse the repository at this point in the history
* Fixes to format of proposed API

* oops
  • Loading branch information
DonJayamanne authored Feb 9, 2024
1 parent 5fea034 commit ad592e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
1 change: 0 additions & 1 deletion api/proposed.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const tab = ' '; // 4 spaces used as tab size in source formatting.
const newModuleDeclaration = `declare module '@vscode/jupyter-extension' {`;
fs.readdirSync(path.join(__dirname, '../src')).forEach((file) => {
if (file.startsWith('api.proposed.') && file.endsWith('.d.ts')) {
console.error(file);
let source = fs.readFileSync(path.join(__dirname, '../src', file), 'utf8').toString();
let foundFirstExport = false;
const newSource = source
Expand Down
35 changes: 18 additions & 17 deletions src/api.proposed.chatMessages.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
// Licensed under the MIT License.

import { CancellationToken } from 'vscode';
import { Output } from './api';

/**
* Represents a Jupyter Kernel.
*/
export interface Kernel {
declare module './api' {
/**
* Executes code specific to chat in the Python kernel without affecting the execution count & execution history.
* Supports the ability to handle messages from the kernel.
*
* @param code Code to be executed.
* @param handlers Callbacks for handling messages from the kernel.
* @param token Triggers the cancellation of the execution.
* @returns Async iterable of outputs, that completes when the execution is complete.
* Represents a Jupyter Kernel.
*/
executeChatCode(
code: string,
handlers: Record<string, (...data: unknown[]) => Promise<unknown>>,
token: CancellationToken
): AsyncIterable<Output>;
export interface Kernel {
/**
* Executes code specific to chat in the Python kernel without affecting the execution count & execution history.
* Supports the ability to handle messages from the kernel.
*
* @param code Code to be executed.
* @param handlers Callbacks for handling messages from the kernel.
* @param token Triggers the cancellation of the execution.
* @returns Async iterable of outputs, that completes when the execution is complete.
*/
executeChatCode(
code: string,
handlers: Record<string, (...data: unknown[]) => Promise<unknown>>,
token: CancellationToken
): AsyncIterable<Output>;
}
}

0 comments on commit ad592e2

Please sign in to comment.