import { IRPCProtocol } from '@opensumi/ide-connection';
import { CancellationToken, Emitter, Event, IExtensionInfo } from '@opensumi/ide-core-common';
import { IExtHostWebview, IExtHostWebviewView, IExtensionDescription, IMainThreadWebview, IWebviewOptions, IWebviewPanelOptions, IWebviewPanelViewState, ViewColumn, Webview, WebviewPanel, WebviewPanelOnDidChangeViewStateEvent, WebviewPanelSerializer, WebviewViewProvider } from '../../../common/vscode';
import { Disposable, Uri } from '../../../common/vscode/ext-types';
type IconPath = Uri | {
    light: Uri;
    dark: Uri;
};
export declare class ExtHostWebview implements Webview {
    private cspResourceRoots;
    private extensionLocation?;
    private readonly _handle;
    private readonly _proxy;
    private _html;
    private _options;
    private _isDisposed;
    readonly _onMessageEmitter: Emitter<any>;
    readonly onDidReceiveMessage: Event<any>;
    constructor(handle: string, proxy: IMainThreadWebview, options: IWebviewOptions, cspResourceRoots: string[], extensionLocation?: Uri | undefined);
    dispose(): void;
    get html(): string;
    set html(value: string);
    get options(): IWebviewOptions;
    set options(newOptions: IWebviewOptions);
    postMessage(message: any): Thenable<boolean>;
    private assertNotDisposed;
    get resourceRoot(): string;
    get cspSource(): string;
    toWebviewResource(resource: Uri): Uri;
    asWebviewUri(localResource: Uri): Uri;
}
export declare class ExtHostWebviewPanel implements WebviewPanel {
    private readonly _handle;
    private readonly _proxy;
    private readonly _viewType;
    private _title;
    private _iconPath;
    private readonly _options;
    private readonly _webview;
    private _isDisposed;
    private _viewColumn;
    private _visible;
    private _active;
    readonly _onDisposeEmitter: Emitter<void>;
    readonly onDidDispose: Event<void>;
    readonly _onDidChangeViewStateEmitter: Emitter<WebviewPanelOnDidChangeViewStateEvent>;
    readonly onDidChangeViewState: Event<WebviewPanelOnDidChangeViewStateEvent>;
    constructor(handle: string, proxy: IMainThreadWebview, viewType: string, title: string, viewColumn: ViewColumn, editorOptions: IWebviewPanelOptions, webview: ExtHostWebview);
    dispose(): void;
    get webview(): ExtHostWebview;
    get viewType(): string;
    get title(): string;
    set title(value: string);
    get iconPath(): IconPath | undefined;
    set iconPath(value: IconPath | undefined);
    get options(): IWebviewPanelOptions;
    get viewColumn(): ViewColumn;
    _setViewColumn(value: ViewColumn): void;
    get active(): boolean;
    _setActive(value: boolean): void;
    get visible(): boolean;
    _setVisible(value: boolean): void;
    postMessage(message: any): Thenable<boolean>;
    reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;
    private assertNotDisposed;
}
export declare class ExtHostWebviewService implements IExtHostWebview {
    private rpcProtocol;
    private webviewHandlePool;
    private readonly _proxy;
    private readonly _webviewPanels;
    private readonly _localWebviews;
    private readonly _serializers;
    private resourceRoots;
    constructor(rpcProtocol: IRPCProtocol);
    $init(): Promise<void>;
    init(): Promise<void>;
    private getNextHandle;
    createWebview(extensionLocation: Uri | undefined, viewType: string, title: string, showOptions: ViewColumn | {
        viewColumn: ViewColumn;
        preserveFocus?: boolean;
    }, options: (IWebviewPanelOptions & IWebviewOptions) | undefined, extension: IExtensionInfo): ExtHostWebviewPanel;
    $pipeBrowserHostedWebviewPanel(handle: string, viewType: string): void;
    createLocalWebview(handle: string): ExtHostWebview;
    registerWebviewPanelSerializer(viewType: string, serializer: WebviewPanelSerializer): Disposable;
    private getExtHostWebview;
    $onMessage(handle: string, message: any): void;
    $onDidChangeWebviewPanelViewState(handle: string, newState: IWebviewPanelViewState): void;
    $onDidDisposeWebviewPanel(handle: string): Promise<void>;
    $deserializeWebviewPanel(webviewHandle: string, viewType: string, title: string, state: any, position: ViewColumn, options: IWebviewOptions & IWebviewPanelOptions): Promise<void>;
    getWebviewPanel(handle: string): ExtHostWebviewPanel | undefined;
}
export declare class ExtHostWebviewViews implements IExtHostWebviewView {
    private readonly _extHostWebview;
    private readonly _proxy;
    private readonly _viewProviders;
    private readonly _webviewViews;
    constructor(rpcProtocol: IRPCProtocol, _extHostWebview: ExtHostWebviewService);
    registerWebviewViewProvider(extension: IExtensionDescription, viewType: string, provider: WebviewViewProvider, webviewOptions?: {
        retainContextWhenHidden?: boolean;
    }): Disposable;
    $resolveWebviewView(webviewHandle: string, viewType: string, title: string | undefined, state: any, cancellation: CancellationToken): Promise<void>;
    $onDidChangeWebviewViewVisibility(webviewHandle: string, visible: boolean): Promise<void>;
    $disposeWebviewView(webviewHandle: string): Promise<void>;
    private getWebviewView;
}
export {};
//# sourceMappingURL=ext.host.api.webview.d.ts.map