notebookBrowser.ts 2.1 KB
Newer Older
R
rebornix 已提交
1 2 3 4 5 6 7 8 9
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import * as DOM from 'vs/base/browser/dom';
import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';
import { BareFontInfo } from 'vs/editor/common/config/fontInfo';
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';
R
rebornix 已提交
10
import { CellViewModel } from 'vs/workbench/contrib/notebook/browser/renderers/cellViewModel';
R
rebornix 已提交
11
import { OutputRenderer } from 'vs/workbench/contrib/notebook/browser/output/outputRenderer';
R
rebornix 已提交
12
import { IOutput, CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
R
rebornix 已提交
13 14 15
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';

export const KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED = new RawContextKey<boolean>('notebookFindWidgetFocused', false);
R
rebornix 已提交
16

17
export interface INotebookEditor {
R
rebornix 已提交
18
	viewType: string | undefined;
R
rebornix 已提交
19
	insertEmptyNotebookCell(cell: CellViewModel, type: CellKind, direction: 'above' | 'below'): Promise<void>;
R
rebornix 已提交
20 21 22
	deleteNotebookCell(cell: CellViewModel): void;
	editNotebookCell(cell: CellViewModel): void;
	saveNotebookCell(cell: CellViewModel): void;
R
rebornix 已提交
23 24
	focusNotebookCell(cell: CellViewModel, focusEditor: boolean): void;
	getActiveCell(): CellViewModel | undefined;
25
	layoutNotebookCell(cell: CellViewModel, height: number): void;
26
	createInset(cell: CellViewModel, output: IOutput, shadowContent: string, offset: number): void;
R
rebornix 已提交
27
	removeInset(output: IOutput): void;
28
	triggerScroll(event: IMouseWheelEvent): void;
R
rebornix 已提交
29 30
	getFontInfo(): BareFontInfo | undefined;
	getListDimension(): DOM.Dimension | null;
R
rebornix 已提交
31
	getOutputRenderer(): OutputRenderer;
R
rebornix 已提交
32 33 34 35 36 37 38 39 40 41
}

export interface CellRenderTemplate {
	container: HTMLElement;
	cellContainer: HTMLElement;
	menuContainer?: HTMLElement;
	editingContainer?: HTMLElement;
	outputContainer?: HTMLElement;
	editor?: CodeEditorWidget;
}