import { Injector } from '@opensumi/di'; import { IContextKeyService, IRange, PreferenceService } from '@opensumi/ide-core-browser'; import { MonacoService } from '@opensumi/ide-core-browser/lib/monaco'; import { Disposable, Event, ILineChange, URI, WithEventBus } from '@opensumi/ide-core-common'; import * as monaco from '@opensumi/ide-monaco'; import { IConfigurationService } from '@opensumi/monaco-editor-core/esm/vs/platform/configuration/common/configuration'; import { CursorStatus, EditorCollectionService, EditorType, ICodeEditor, IDecorationApplyOptions, IDiffEditor, IEditor, IResourceOpenOptions, IUndoStopOptions } from '../common'; import { IEditorDocumentModel, IEditorDocumentModelRef } from '../common/editor'; import { MonacoEditorDecorationApplier } from './decoration-applier'; import { EditorDocumentModelContentChangedEvent, IEditorDocumentModelService } from './doc-model/types'; import { EditorFeatureRegistryImpl } from './feature'; import { BrowserMultiDiffEditor } from './multi-diff/multi-diff-editor'; import { IEditorFeatureRegistry } from './types'; import type { ICodeEditor as IMonacoCodeEditor, IDiffEditor as IMonacoDiffEditor } from '@opensumi/ide-monaco/lib/browser/monaco-api/types'; export declare class EditorCollectionServiceImpl extends WithEventBus implements EditorCollectionService { protected readonly monacoService: MonacoService; protected readonly injector: Injector; protected readonly configurationService: IConfigurationService; protected readonly editorFeatureRegistry: EditorFeatureRegistryImpl; private _editors; private _diffEditors; private _onCodeEditorCreate; private _onDiffEditorCreate; onCodeEditorCreate: Event; onDiffEditorCreate: Event; documentModelService: IEditorDocumentModelService; private _currentEditor; get currentEditor(): IEditor | undefined; constructor(); createCodeEditor(dom: HTMLElement, options?: any, overrides?: { [key: string]: any; }): ICodeEditor; listEditors(): ISumiEditor[]; getEditorByUri(uri: URI): IEditor | undefined; addEditors(editors: ISumiEditor[]): void; removeEditors(editors: ISumiEditor[]): void; createDiffEditor(dom: HTMLElement, options?: any, overrides?: { [key: string]: any; }): IDiffEditor; createMultiDiffEditor(dom: HTMLElement, options?: any, overrides?: { [key: string]: any; }): BrowserMultiDiffEditor; createMergeEditor(dom: HTMLElement, options?: any, overrides?: { [key: string]: any; }): import("@opensumi/ide-core-browser/lib/monaco/merge-editor-widget").IMergeEditorEditor; listDiffEditors(): IDiffEditor[]; addDiffEditors(diffEditors: IDiffEditor[]): void; removeDiffEditors(diffEditors: IDiffEditor[]): void; onDocModelContentChangedEvent(e: EditorDocumentModelContentChangedEvent): void; } export type ISumiEditor = IEditor; export declare function insertSnippetWithMonacoEditor(editor: IMonacoCodeEditor, template: string, ranges: IRange[], opts: IUndoStopOptions): void; export declare abstract class BaseMonacoEditorWrapper extends WithEventBus implements IEditor { readonly monacoEditor: IMonacoCodeEditor; private type; abstract readonly currentDocumentModel: IEditorDocumentModel | null; get currentUri(): URI | null; getId(): string; getSelections(): monaco.Selection[]; onFocus: monaco.Event; onBlur: monaco.Event; protected _specialEditorOptions: any; protected _specialModelOptions: monaco.editor.ITextModelUpdateOptions; protected _editorOptionsFromContribution: any; protected readonly editorFeatureRegistry: IEditorFeatureRegistry; protected readonly configurationService: IConfigurationService; protected readonly decorationApplier: MonacoEditorDecorationApplier; private _disableSelectionEmitter; protected disableSelectionEmitter(): void; protected enableSelectionEmitter(): void; private injector; constructor(monacoEditor: IMonacoCodeEditor, type: EditorType); private onDidChangeModel; getType(): EditorType; updateOptions(editorOptions?: monaco.editor.IEditorOptions, modelOptions?: monaco.editor.ITextModelUpdateOptions): void; private _doUpdateOptions; /** * 合并所有的选项 * 优先关系: (从高到底) * 1. 当前编辑器的特殊选项(通过调用 updateOptions或者启动时传入) * 2. 来自 featureRegistry 的根据 当前uri 提供的选项 * 3. 来自偏好设置的选项 */ private _calculateFinalOptions; insertSnippet(template: string, ranges: IRange[], opts: IUndoStopOptions): void; applyDecoration(key: string, options: IDecorationApplyOptions[]): void; onSelectionsChanged(listener: any): import("@opensumi/monaco-editor-core/esm/vs/base/common/lifecycle").IDisposable; onVisibleRangesChanged(listener: any): Disposable; setSelections(selections: any): void; setSelection(selection: any): void; save(): Promise; onConfigurationChanged(listener: any): import("@opensumi/monaco-editor-core/esm/vs/base/common/lifecycle").IDisposable; } export declare class BrowserCodeEditor extends BaseMonacoEditorWrapper implements ICodeEditor { readonly monacoEditor: IMonacoCodeEditor; private collectionService; protected readonly editorFeatureRegistry: IEditorFeatureRegistry; private editorState; protected _currentDocumentModelRef: IEditorDocumentModelRef; private _onCursorPositionChanged; onCursorPositionChanged: Event; private _onRefOpen; onRefOpen: Event; get currentDocumentModel(): IEditorDocumentModel | null; getType(): EditorType; constructor(monacoEditor: IMonacoCodeEditor, options?: any); layout(dimension?: monaco.IDimension, postponeRendering?: boolean): void; focus(): void; dispose(): void; protected saveCurrentState(): void; protected restoreState(): void; open(documentModelRef: IEditorDocumentModelRef): void; } export declare class BrowserDiffEditor extends WithEventBus implements IDiffEditor { readonly monacoDiffEditor: IMonacoDiffEditor; private specialOptions; private collectionService; private appConfig; private originalDocModelRef; private modifiedDocModelRef; get originalDocModel(): IEditorDocumentModel | null; get modifiedDocModel(): IEditorDocumentModel | null; originalEditor: ISumiEditor; modifiedEditor: ISumiEditor; _disposed: boolean; protected readonly injector: Injector; protected readonly configurationService: IConfigurationService; protected readonly preferenceService: PreferenceService; protected readonly contextKeyService: IContextKeyService; private editorState; private currentUri; private diffResourceKeys; private _onRefOpen; onRefOpen: Event; protected saveCurrentState(): void; protected restoreState(options: IResourceOpenOptions): void; constructor(monacoDiffEditor: IMonacoDiffEditor, specialOptions?: any); compare(originalDocModelRef: IEditorDocumentModelRef, modifiedDocModelRef: IEditorDocumentModelRef, options?: IResourceOpenOptions, rawUri?: URI): Promise; private showFirstDiff; private updateOptionsOnModelChange; isReadonly(): boolean; private doUpdateDiffOptions; updateDiffOptions(): void; getLineChanges(): ILineChange[] | null; private wrapEditors; layout(): void; focus(): void; dispose(): void; } export declare class DiffEditorPart extends BaseMonacoEditorWrapper implements IEditor { private getDocumentModel; get currentDocumentModel(): IEditorDocumentModel | null; constructor(monacoEditor: IMonacoCodeEditor, getDocumentModel: () => IEditorDocumentModel | null, type: EditorType); } //# sourceMappingURL=editor-collection.service.d.ts.map