import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent"; import { IDisposable, IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { RawContextKey } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey"; import { IRevertOptions, ISaveOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor"; import { RegisteredEditorPriority } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorResolverService"; export declare const CONTEXT_ACTIVE_CUSTOM_EDITOR_ID: RawContextKey; export declare const CONTEXT_FOCUSED_CUSTOM_EDITOR_IS_EDITABLE: RawContextKey; export interface CustomEditorCapabilities { readonly supportsMultipleEditorsPerDocument?: boolean; readonly isTextEditor?: boolean; readonly supportsInlineDiff?: boolean; readonly supportsSideBySideDiff?: boolean; } export interface ICustomEditorModelManager { getAllModels(resource: URI): Promise; get(resource: URI, viewType: string): Promise; tryRetain(resource: URI, viewType: string): Promise> | undefined; add(resource: URI, viewType: string, model: Promise): Promise>; disposeAllModelsForView(viewType: string): void; } export interface ICustomEditorModel extends IDisposable { readonly viewType: string; readonly resource: URI; readonly backupId: string | undefined; readonly canHotExit: boolean; isReadonly(): boolean | IMarkdownString; readonly onDidChangeReadonly: Event; isOrphaned(): boolean; readonly onDidChangeOrphaned: Event; isDirty(): boolean; readonly onDidChangeDirty: Event; revert(options?: IRevertOptions): Promise; saveCustomEditor(options?: ISaveOptions): Promise; saveCustomEditorAs(resource: URI, targetResource: URI, currentOptions?: ISaveOptions): Promise; } export declare enum CustomEditorPriority { default = "default", builtin = "builtin", option = "option" } export declare enum CustomEditorDiffEditorLayout { Inline = "inline", SideBySide = "sideBySide" } export interface CustomEditorSelector { readonly filenamePattern?: string; } export interface CustomEditorDescriptor { readonly id: string; readonly displayName: string; readonly providerDisplayName: string; readonly priority: RegisteredEditorPriority; readonly diffEditorPriority?: RegisteredEditorPriority; readonly mergeEditorPriority?: RegisteredEditorPriority; readonly selector: readonly CustomEditorSelector[]; } export declare class CustomEditorInfo implements CustomEditorDescriptor { readonly id: string; readonly displayName: string; readonly providerDisplayName: string; readonly priority: RegisteredEditorPriority; readonly diffEditorPriority?: RegisteredEditorPriority; readonly mergeEditorPriority?: RegisteredEditorPriority; readonly selector: readonly CustomEditorSelector[]; constructor(descriptor: CustomEditorDescriptor); matches(resource: URI): boolean; } export declare class CustomEditorInfoCollection { readonly allEditors: readonly CustomEditorInfo[]; constructor(editors: readonly CustomEditorInfo[]); get length(): number; /** * Find the single default editor to use (if any) by looking at the editor's priority and the * other contributed editors. */ get defaultEditor(): CustomEditorInfo | undefined; /** * Find the best available editor to use. * * Unlike the `defaultEditor`, a bestAvailableEditor can exist even if there are other editors with * the same priority. */ get bestAvailableEditor(): CustomEditorInfo | undefined; }