import { Disposable, DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable"; import { IInstantiationService, GetLeadingNonServiceArgs } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation"; /** * The DomWidget class provides a standard to define reusable UI components. * It is disposable and defines a single root element of type HTMLElement. * It also provides static helper methods to create and append widgets to the DOM, * with support for hot module replacement during development. */ export declare abstract class DomWidget extends Disposable { /** * Appends the widget to the provided DOM element. */ static createAppend(this: DomWidgetCtor, dom: HTMLElement, store: DisposableStore, ...params: TArgs): void; /** * Creates the widget in a new div element with "display: contents". */ static createInContents(this: DomWidgetCtor, store: DisposableStore, ...params: TArgs): HTMLDivElement; /** * Creates an observable instance of the widget. * The observable will change when hot module replacement occurs. */ static createObservable(this: DomWidgetCtor, store: DisposableStore, ...params: TArgs): IObservable; /** * Appends the widget to the provided DOM element. */ static instantiateAppend(this: DomWidgetCtor, instantiationService: IInstantiationService, dom: HTMLElement, store: DisposableStore, ...params: GetLeadingNonServiceArgs): void; /** * Creates the widget in a new div element with "display: contents". * If possible, prefer `instantiateAppend`, as it avoids an extra div in the DOM. */ static instantiateInContents(this: DomWidgetCtor, instantiationService: IInstantiationService, store: DisposableStore, ...params: GetLeadingNonServiceArgs): HTMLDivElement; /** * Creates an observable instance of the widget. * The observable will change when hot module replacement occurs. */ static instantiateObservable(this: DomWidgetCtor, instantiationService: IInstantiationService, store: DisposableStore, ...params: GetLeadingNonServiceArgs): IObservable; /** * @deprecated Do not call manually! Only for use by the hot reload system (a vite plugin will inject calls to this method in dev mode). */ static registerWidgetHotReplacement(this: new (...args: any[]) => DomWidget, id: string): void; /** Always returns the same element. */ abstract get element(): HTMLElement; } type DomWidgetCtor = { new (...args: TArgs): T; createObservable(store: DisposableStore, ...params: TArgs): IObservable; instantiateObservable(instantiationService: IInstantiationService, store: DisposableStore, ...params: GetLeadingNonServiceArgs): IObservable; createAppend(dom: HTMLElement, store: DisposableStore, ...params: TArgs): void; instantiateAppend(instantiationService: IInstantiationService, dom: HTMLElement, store: DisposableStore, ...params: GetLeadingNonServiceArgs): void; }; export {};