import { Dimension } from "../../../../base/browser/dom.js"; import { Event } from "../../../../base/common/event.js"; import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { URI } from "../../../../base/common/uri.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { IContextKeyService } from "../../../../platform/contextkey/common/contextkey.service.js"; import { Range } from "../../../common/core/range.js"; import { DiffEditorViewMode } from "../../../common/config/editorOptions.js"; import { IDiffEditor } from "../../../common/editorCommon.js"; import { IMultiDiffResourceId } from "../../../common/multiDiffEditor.js"; import { ICodeEditor } from "../../editorBrowser.js"; import { DiffEditorWidget } from "../diffEditor/diffEditorWidget.js"; import { IDocumentDiffItem, IMultiDiffEditorModel } from "./model.js"; import { IMultiDiffEditorWidgetOptions, MultiDiffEditorVariant } from "./multiDiffEditorOptions.js"; import { DocumentDiffItemViewModel, MultiDiffEditorViewModel } from "./multiDiffEditorViewModel.js"; import { IMultiDiffEditorLayoutDebugState, IMultiDiffEditorViewState } from "./multiDiffEditorWidgetImpl.js"; import { IWorkbenchUIElementFactory } from "./workbenchUIElementFactory.js"; export declare class MultiDiffEditorWidget extends Disposable { private readonly _element; private readonly _workbenchUIElementFactory; private readonly _options; private readonly _instantiationService; private readonly _dimension; private readonly _viewModel; private readonly _diffLayoutOptions; private readonly _paddingBottomPx; private _variant; private readonly _widgetImplValue; private readonly _widgetImpl; private readonly _widgetImplDisposable; constructor(_element: HTMLElement, _workbenchUIElementFactory: IWorkbenchUIElementFactory, _options: IMultiDiffEditorWidgetOptions, _instantiationService: IInstantiationService); private _createWidgetImpl; private _replaceWidgetImpl; setVariant(variant: MultiDiffEditorVariant): void; reveal(resource: IMultiDiffResourceId, options?: RevealOptions): void; createViewModel(model: IMultiDiffEditorModel): MultiDiffEditorViewModel; setViewModel(viewModel: MultiDiffEditorViewModel | undefined, options?: { readonly preserveFocus?: boolean; readonly viewState?: IMultiDiffEditorViewState; }): void; layout(dimension: Dimension): void; /** * Overrides whether the embedded diffs render side by side (`true`) or inline * (`false`) as editor-local state, independent of the * `diffEditor.renderSideBySide` setting. Responsive inline fallback is disabled * unless explicitly enabled. */ setRenderSideBySide(renderSideBySide: boolean, options?: { readonly useInlineViewWhenSpaceIsLimited?: boolean; }): void; setViewMode(mode: DiffEditorViewMode): void; setDiffLayoutOptions(mode: DiffEditorViewMode, diffWordWrap?: "off" | "on" | "inherit"): void; toggleRenderSideBySide(): void; setDiffWordWrap(diffWordWrap: "off" | "on" | "inherit"): void; private _updateDiffLayoutOptions; /** Reserves empty space below the last diff entry. */ setPaddingBottom(px: number): void; private readonly _activeControl; /** The view model currently displayed by the widget. */ readonly viewModel: IObservable; /** * Diff items whose content intersects the viewport, in document order. The * first item is the one at the top of the viewport. */ readonly visibleDiffItems: IObservable; getActiveControl(): DiffEditorWidget | undefined; readonly onDidChangeActiveControl: Event; focus(): boolean; getViewState(): IMultiDiffEditorViewState; getLayoutDebugState(): IObservable; setViewState(viewState: IMultiDiffEditorViewState): void; tryGetCodeEditor(resource: URI): { diffEditor: IDiffEditor; editor: ICodeEditor; } | undefined; getRootElement(): HTMLElement; getContextKeyService(): IContextKeyService; getScopedInstantiationService(): IInstantiationService; resetWidthBasedLayout(): void; findDocumentDiffItem(resource: URI): IDocumentDiffItem | undefined; goToNextChange(): void; goToPreviousChange(): void; } export interface RevealOptions { range?: Range; highlight: boolean; }