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

R
rebornix 已提交
6

R
rebornix 已提交
7 8 9 10
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 已提交
11
import { CellViewModel } from 'vs/workbench/contrib/notebook/browser/renderers/cellViewModel';
R
rebornix 已提交
12
import { OutputRenderer } from 'vs/workbench/contrib/notebook/browser/output/outputRenderer';
R
rebornix 已提交
13 14 15

export interface NotebookHandler {
	viewType: string | undefined;
R
rebornix 已提交
16 17 18 19 20 21 22 23 24
	insertEmptyNotebookCell(listIndex: number | undefined, cell: CellViewModel, type: 'markdown' | 'code', direction: 'above' | 'below'): Promise<void>;
	deleteNotebookCell(listIndex: number | undefined, cell: CellViewModel): void;
	editNotebookCell(listIndex: number | undefined, cell: CellViewModel): void;
	saveNotebookCell(listIndex: number | undefined, cell: CellViewModel): void;
	focusNotebookCell(cell: CellViewModel, focusEditor: boolean): void;
	getActiveCell(): CellViewModel | undefined;
	layoutElement(cell: CellViewModel, height: number): void;
	createContentWidget(cell: CellViewModel, index: number, shadowContent: string, offset: number): void;
	disposeViewCell(cell: CellViewModel): void;
R
rebornix 已提交
25 26 27
	triggerWheel(event: IMouseWheelEvent): void;
	getFontInfo(): BareFontInfo | undefined;
	getListDimension(): DOM.Dimension | null;
R
rebornix 已提交
28
	getOutputRenderer(): OutputRenderer;
R
rebornix 已提交
29 30 31 32 33 34 35 36 37 38
}

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