Skip to content

[Ignore] Update Notebook dts #2930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 47 additions & 12 deletions vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,27 @@ declare module 'vscode' {
delete(index: number): void;
}

export interface NotebookCellRange {
readonly start: number;
readonly end: number;
}

export enum NotebookEditorRevealType {
/**
* The range will be revealed with as little scrolling as possible.
*/
Default = 0,
/**
* The range will always be revealed in the center of the viewport.
*/
InCenter = 1,
/**
* If the range is outside the viewport, it will be revealed in the center of the viewport.
* Otherwise, it will be revealed with as little scrolling as possible.
*/
InCenterIfOutsideViewport = 2,
}

export interface NotebookEditor {
/**
* The document associated with this notebook editor.
Expand All @@ -274,6 +295,12 @@ declare module 'vscode' {
*/
readonly selection?: NotebookCell;


/**
* The current visible ranges in the editor (vertically).
*/
readonly visibleRanges: NotebookCellRange[];

/**
* The column in which this editor shows.
*/
Expand Down Expand Up @@ -318,6 +345,8 @@ declare module 'vscode' {
asWebviewUri(localResource: Uri): Uri;

edit(callback: (editBuilder: NotebookEditorCellEdit) => void): Thenable<boolean>;

revealRange(range: NotebookCellRange, revealType?: NotebookEditorRevealType): void;
}

export interface NotebookOutputSelector {
Expand Down Expand Up @@ -380,6 +409,16 @@ declare module 'vscode' {
readonly cell: NotebookCell;
}

export interface NotebookEditorSelectionChangeEvent {
readonly notebookEditor: NotebookEditor;
readonly selection?: NotebookCell;
}

export interface NotebookEditorVisibleRangesChangeEvent {
readonly notebookEditor: NotebookEditor;
readonly visibleRanges: ReadonlyArray<NotebookCellRange>;
}

export interface NotebookCellData {
readonly cellKind: CellKind;
readonly source: string;
Expand Down Expand Up @@ -509,6 +548,7 @@ declare module 'vscode' {
readonly id?: string;
label: string;
description?: string;
detail?: string;
isPreferred?: boolean;
preloads?: Uri[];
executeCell(document: NotebookDocument, cell: NotebookCell): void;
Expand All @@ -518,13 +558,12 @@ declare module 'vscode' {
}

export interface NotebookDocumentFilter {
viewType?: string;
filenamePattern?: GlobPattern;
excludeFileNamePattern?: GlobPattern;
viewType?: string | string[];
filenamePattern?: GlobPattern | { include: GlobPattern; exclude: GlobPattern };
}

export interface NotebookKernelProvider<T extends NotebookKernel = NotebookKernel> {
onDidChangeKernels?: Event<void>;
onDidChangeKernels?: Event<NotebookDocument | undefined>;
provideKernels(document: NotebookDocument, token: CancellationToken): ProviderResult<T[]>;
resolveKernel?(kernel: T, document: NotebookDocument, webview: NotebookCommunication, token: CancellationToken): ProviderResult<void>;
}
Expand Down Expand Up @@ -581,12 +620,6 @@ declare module 'vscode' {
provider: NotebookKernelProvider
): Disposable;

export function registerNotebookKernel(
id: string,
selectors: GlobPattern[],
kernel: NotebookKernel
): Disposable;

export const onDidOpenNotebookDocument: Event<NotebookDocument>;
export const onDidCloseNotebookDocument: Event<NotebookDocument>;
export const onDidSaveNotebookDocument: Event<NotebookDocument>;
Expand All @@ -596,11 +629,13 @@ declare module 'vscode' {
*/
export const notebookDocuments: ReadonlyArray<NotebookDocument>;

export let visibleNotebookEditors: NotebookEditor[];
export const visibleNotebookEditors: NotebookEditor[];
export const onDidChangeVisibleNotebookEditors: Event<NotebookEditor[]>;

export let activeNotebookEditor: NotebookEditor | undefined;
export const activeNotebookEditor: NotebookEditor | undefined;
export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;
export const onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>;
export const onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>;
export const onDidChangeNotebookCells: Event<NotebookCellsChangeEvent>;
export const onDidChangeCellOutputs: Event<NotebookCellOutputsChangeEvent>;
export const onDidChangeCellLanguage: Event<NotebookCellLanguageChangeEvent>;
Expand Down