import { Disposable, DisposableCollection, Emitter, Event, URI } from '@theia/core'; import { interfaces } from '@theia/core/shared/inversify'; import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model'; import { type MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor'; import { CellKind, NotebookCellCollapseState, NotebookCellInternalMetadata, NotebookCellMetadata, CellOutput, CellData, CellOutputItem } from '../../common'; import { NotebookCellOutputsSplice } from '../notebook-types'; import { NotebookMonacoTextModelService } from '../service/notebook-monaco-text-model-service'; import { NotebookCellOutputModel } from './notebook-cell-output-model'; import { PreferenceService } from '@theia/core/lib/common'; import { LanguageService } from '@theia/core/lib/browser/language-service'; import { NotebookEditorFindMatch, NotebookEditorFindMatchOptions } from '../view/notebook-find-widget'; import { Range } from '@theia/core/shared/vscode-languageserver-protocol'; export declare const NotebookCellModelFactory: unique symbol; export type NotebookCellModelFactory = (props: NotebookCellModelProps) => NotebookCellModel; export declare function createNotebookCellModelContainer(parent: interfaces.Container, props: NotebookCellModelProps): interfaces.Container; export interface CellInternalMetadataChangedEvent { readonly lastRunSuccessChanged?: boolean; } export interface NotebookCell { readonly uri: URI; handle: number; language: string; cellKind: CellKind; outputs: CellOutput[]; metadata: NotebookCellMetadata; internalMetadata: NotebookCellInternalMetadata; text: string; /** * The selection of the cell. Zero-based line/character coordinates. */ selection: Range | undefined; onDidChangeOutputs?: Event; onDidChangeOutputItems?: Event; onDidChangeLanguage: Event; onDidChangeMetadata: Event; onDidChangeInternalMetadata: Event; } export interface NotebookCellModelProps { readonly uri: URI; readonly handle: number; source: string; language: string; readonly cellKind: CellKind; outputs: CellOutput[]; metadata?: NotebookCellMetadata | undefined; internalMetadata?: NotebookCellInternalMetadata | undefined; readonly collapseState?: NotebookCellCollapseState | undefined; } export declare class NotebookCellModel implements NotebookCell, Disposable { protected readonly onDidChangeOutputsEmitter: Emitter; readonly onDidChangeOutputs: Event; protected readonly onDidChangeOutputItemsEmitter: Emitter; readonly onDidChangeOutputItems: Event; protected readonly onDidChangeContentEmitter: Emitter<"content" | "language" | "mime">; readonly onDidChangeContent: Event<"content" | "language" | "mime">; protected readonly onDidChangeMetadataEmitter: Emitter; readonly onDidChangeMetadata: Event; protected readonly onDidChangeInternalMetadataEmitter: Emitter; readonly onDidChangeInternalMetadata: Event; protected readonly onDidChangeLanguageEmitter: Emitter; readonly onDidChangeLanguage: Event; protected readonly onDidChangeEditorOptionsEmitter: Emitter; readonly onDidChangeEditorOptions: Event; protected readonly outputVisibilityChangeEmitter: Emitter; readonly onDidChangeOutputVisibility: Event; protected readonly onDidFindMatchesEmitter: Emitter; readonly onDidFindMatches: Event; protected readonly onDidSelectFindMatchEmitter: Emitter; readonly onDidSelectFindMatch: Event; protected onDidRequestCenterEditorEmitter: Emitter; readonly onDidRequestCenterEditor: Event; protected onDidCellHeightChangeEmitter: Emitter; readonly onDidCellHeightChange: Event; protected readonly props: NotebookCellModelProps; protected readonly textModelService: NotebookMonacoTextModelService; protected readonly languageService: LanguageService; protected readonly preferenceService: PreferenceService; get outputs(): NotebookCellOutputModel[]; protected _outputs: NotebookCellOutputModel[]; get metadata(): NotebookCellMetadata; set metadata(newMetadata: NotebookCellMetadata); protected _metadata: NotebookCellMetadata; toDispose: DisposableCollection; protected _internalMetadata: NotebookCellInternalMetadata; get internalMetadata(): NotebookCellInternalMetadata; set internalMetadata(newInternalMetadata: NotebookCellInternalMetadata); protected textModel?: MonacoEditorModel; get text(): string; get isTextModelWritable(): boolean; get source(): string; set source(source: string); get language(): string; set language(newLanguage: string); get languageName(): string; get uri(): URI; get handle(): number; get cellKind(): CellKind; protected _editorOptions: MonacoEditor.IOptions; get editorOptions(): Readonly; set editorOptions(options: MonacoEditor.IOptions); protected _outputVisible: boolean; get outputVisible(): boolean; set outputVisible(visible: boolean); protected _selection: Range | undefined; get selection(): Range | undefined; set selection(selection: Range | undefined); protected _cellheight: number; get cellHeight(): number; set cellHeight(height: number); protected init(): void; dispose(): void; requestCenterEditor(): void; spliceNotebookCellOutputs(splice: NotebookCellOutputsSplice): void; replaceOutputData(outputId: string, newOutputData: CellOutput): boolean; changeOutputItems(outputId: string, append: boolean, items: CellOutputItem[]): boolean; getData(): CellData; resolveTextModel(): Promise; restartOutputRenderer(outputId: string): void; onMarkdownFind: ((options: NotebookEditorFindMatchOptions) => NotebookEditorFindMatch[]) | undefined; showMatch(selected: NotebookCodeEditorFindMatch): void; findMatches(options: NotebookEditorFindMatchOptions): NotebookEditorFindMatch[]; replaceAll(matches: NotebookCodeEditorFindMatch[], value: string): void; } export interface NotebookCellFindMatches { matches: NotebookEditorFindMatch[]; selected: NotebookEditorFindMatch; } export declare class NotebookCodeEditorFindMatch implements NotebookEditorFindMatch { readonly cell: NotebookCellModel; readonly range: Range; readonly textModel: MonacoEditorModel; selected: boolean; constructor(cell: NotebookCellModel, range: Range, textModel: MonacoEditorModel); show(): void; replace(value: string): void; } //# sourceMappingURL=notebook-cell-model.d.ts.map