import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation"; import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IViewBadge } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views"; import { IOverlayWebview } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview"; import { IWebviewViewService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webviewView/browser/webviewViewService.service"; /** * A webview shown in a view pane. */ export interface WebviewView { /** * The text displayed in the view's title. */ title?: string; /** * Additional text shown for this view. */ description?: string; /** * The badge shown for this view. */ badge?: IViewBadge; /** * The webview associated with this webview view. */ readonly webview: IOverlayWebview; /** * Fired when the visibility of the webview view changes. * * This can happen when the view itself is hidden, when the view is collapsed, or when the user switches away from * the view. */ readonly onDidChangeVisibility: Event; /** * Fired when the webview view has been disposed of. */ readonly onDispose: Event; /** * Dispose of the webview view and clean up any associated resources. */ dispose(): void; /** * Force the webview view to show. */ show(preserveFocus: boolean): void; } /** * Fill in the contents of a newly created webview view. */ export interface IWebviewViewResolver { /** * Fill in the contents of a webview view. */ resolve(webviewView: WebviewView, cancellation: CancellationToken): Promise; } export declare class WebviewViewService extends Disposable implements IWebviewViewService { readonly _serviceBrand: undefined; private readonly _resolvers; private readonly _awaitingRevival; private readonly _onNewResolverRegistered; readonly onNewResolverRegistered: Event<{ readonly viewType: string; }>; register(viewType: string, resolver: IWebviewViewResolver): IDisposable; resolve(viewType: string, webview: WebviewView, cancellation: CancellationToken): Promise; }