import { interfaces } from '@theia/core/shared/inversify'; import { CustomEditorsMain, CustomEditorsExt, CustomTextEditorCapabilities } from '../../../common/plugin-api-rpc'; import { RPCProtocol } from '../../../common/rpc-protocol'; import { HostedPluginSupport } from '../../../hosted/browser/hosted-plugin'; import { PluginCustomEditorRegistry } from './plugin-custom-editor-registry'; import { UriComponents } from '../../../common/uri-components'; import { URI } from '@theia/core/shared/vscode-uri'; import TheiaURI from '@theia/core/lib/common/uri'; import { Disposable } from '@theia/core/lib/common/disposable'; import { Reference } from '@theia/core/lib/common/reference'; import { CancellationToken } from '@theia/core/lib/common/cancellation'; import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model'; import { EditorModelService } from '../text-editor-model-service'; import { CustomEditorService } from './custom-editor-service'; import { FileService } from '@theia/filesystem/lib/browser/file-service'; import { UndoRedoService } from '@theia/editor/lib/browser/undo-redo-service'; import { WebviewsMainImpl } from '../webviews-main'; import { WidgetManager } from '@theia/core/lib/browser/widget-manager'; import { ApplicationShell, LabelProvider, Saveable, SaveAsOptions, SaveOptions } from '@theia/core/lib/browser'; import { WebviewPanelOptions } from '@theia/plugin'; import { EditorPreferences } from '@theia/editor/lib/common/editor-preferences'; import { BinaryBuffer } from '@theia/core/lib/common/buffer'; declare const enum CustomEditorModelType { Custom = 0, Text = 1 } export declare class CustomEditorsMainImpl implements CustomEditorsMain, Disposable { readonly webviewsMain: WebviewsMainImpl; protected readonly pluginService: HostedPluginSupport; protected readonly shell: ApplicationShell; protected readonly textModelService: EditorModelService; protected readonly fileService: FileService; protected readonly customEditorService: CustomEditorService; protected readonly undoRedoService: UndoRedoService; protected readonly customEditorRegistry: PluginCustomEditorRegistry; protected readonly labelProvider: LabelProvider; protected readonly widgetManager: WidgetManager; protected readonly editorPreferences: EditorPreferences; private readonly proxy; private readonly editorProviders; constructor(rpc: RPCProtocol, container: interfaces.Container, webviewsMain: WebviewsMainImpl); dispose(): void; $registerTextEditorProvider(viewType: string, options: WebviewPanelOptions, capabilities: CustomTextEditorCapabilities): void; $registerCustomEditorProvider(viewType: string, options: WebviewPanelOptions, supportsMultipleEditorsPerDocument: boolean): void; protected registerEditorProvider(modelType: CustomEditorModelType, viewType: string, options: WebviewPanelOptions, capabilities: CustomTextEditorCapabilities, supportsMultipleEditorsPerDocument: boolean): Promise; $unregisterEditorProvider(viewType: string): void; protected getOrCreateCustomEditorModel(modelType: CustomEditorModelType, resource: TheiaURI, viewType: string, cancellationToken: CancellationToken): Promise>; protected getCustomEditorModel(resourceComponents: UriComponents, viewType: string): Promise; $onDidEdit(resourceComponents: UriComponents, viewType: string, editId: number, label: string | undefined): Promise; $onContentChange(resourceComponents: UriComponents, viewType: string): Promise; } export interface CustomEditorModel extends Saveable, Disposable { readonly viewType: string; readonly resource: URI; readonly readonly: boolean; readonly dirty: boolean; revert(options?: Saveable.RevertOptions): Promise; saveCustomEditor(options?: SaveOptions): Promise; saveCustomEditorAs?(resource: TheiaURI, targetResource: TheiaURI, options?: SaveOptions): Promise; undo(): void; redo(): void; } export declare class MainCustomEditorModel implements CustomEditorModel { private proxy; readonly viewType: string; private readonly editorResource; private readonly editable; private readonly undoRedoService; private readonly fileService; private currentEditIndex; private savePoint; private isDirtyFromContentChange; private ongoingSave?; private readonly edits; private readonly toDispose; private readonly onDirtyChangedEmitter; readonly onDirtyChanged: import("@theia/core").Event; private readonly onContentChangedEmitter; readonly onContentChanged: import("@theia/core").Event; static create(proxy: CustomEditorsExt, viewType: string, resource: TheiaURI, undoRedoService: UndoRedoService, fileService: FileService, cancellation: CancellationToken): Promise; constructor(proxy: CustomEditorsExt, viewType: string, editorResource: TheiaURI, editable: boolean, undoRedoService: UndoRedoService, fileService: FileService); get resource(): URI; get dirty(): boolean; get readonly(): boolean; setProxy(proxy: CustomEditorsExt): void; dispose(): void; changeContent(): void; pushEdit(editId: number, label: string | undefined): void; revert(options?: Saveable.RevertOptions): Promise; save(options?: SaveOptions): Promise; saveCustomEditor(options?: SaveOptions): Promise; saveAs(options: SaveAsOptions): Promise; saveCustomEditorAs(resource: TheiaURI, targetResource: TheiaURI, options?: SaveOptions): Promise; undo(): Promise; redo(): Promise; private spliceEdits; private change; } export declare class CustomTextEditorModel implements CustomEditorModel { readonly viewType: string; readonly editorResource: TheiaURI; private readonly model; private readonly toDispose; private readonly onDirtyChangedEmitter; readonly onDirtyChanged: import("@theia/core").Event; private readonly onContentChangedEmitter; readonly onContentChanged: import("@theia/core").Event; static create(viewType: string, resource: TheiaURI, editorModelService: EditorModelService): Promise; constructor(viewType: string, editorResource: TheiaURI, model: Reference); dispose(): void; get resource(): URI; get dirty(): boolean; get readonly(): boolean; get editorTextModel(): MonacoEditorModel; revert(options?: Saveable.RevertOptions): Promise; save(options?: SaveOptions): Promise; serialize(): Promise; saveCustomEditor(options?: SaveOptions): Promise; undo(): void; redo(): void; } export {}; //# sourceMappingURL=custom-editors-main.d.ts.map