import { WebviewPanelOptions, WebviewPortMapping } from '@theia/plugin'; import { BaseWidget, Message } from '@theia/core/lib/browser/widgets/widget'; import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable'; import { ApplicationShellMouseTracker } from '@theia/core/lib/browser/shell/application-shell-mouse-tracker'; import { StatefulWidget } from '@theia/core/lib/browser/shell/shell-layout-restorer'; import { WebviewPanelViewState, ThemeIcon as ThemeIconDTO } from '../../../common/plugin-api-rpc'; import { IconUrl } from '../../../common/plugin-protocol'; import { Deferred } from '@theia/core/lib/common/promise-util'; import { WebviewEnvironment } from './webview-environment'; import URI from '@theia/core/lib/common/uri'; import { Emitter } from '@theia/core/lib/common/event'; import { OpenerService } from '@theia/core/lib/browser/opener-service'; import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding'; import { PluginSharedStyle } from '../plugin-shared-style'; import { WebviewThemeDataProvider } from './webview-theme-data-provider'; import { ExternalUriService } from '@theia/core/lib/browser/external-uri-service'; import { OutputChannelManager } from '@theia/output/lib/browser/output-channel'; import { WebviewResourceCache } from './webview-resource-cache'; import { FileService } from '@theia/filesystem/lib/browser/file-service'; import { ExtractableWidget } from '@theia/core/lib/browser/widgets/extractable-widget'; import { MenuPath } from '@theia/core'; import { ContextMenuRenderer } from '@theia/core/lib/browser'; import { ContextKeyService } from '@theia/core/lib/browser/context-key-service'; import { WebviewPreferences } from '../../common/webview-preferences'; export declare const WEBVIEW_CONTEXT_MENU: MenuPath; export declare const enum WebviewMessageChannels { onmessage = "onmessage", didClickLink = "did-click-link", didFocus = "did-focus", didBlur = "did-blur", doUpdateState = "do-update-state", doReload = "do-reload", loadResource = "load-resource", loadLocalhost = "load-localhost", webviewReady = "webview-ready", didKeydown = "did-keydown", didMouseDown = "did-mousedown", didMouseUp = "did-mouseup", onconsole = "onconsole", didcontextmenu = "did-context-menu" } export interface WebviewContentOptions { readonly allowScripts?: boolean; readonly allowForms?: boolean; readonly localResourceRoots?: ReadonlyArray; readonly portMapping?: ReadonlyArray; readonly enableCommandUris?: boolean | readonly string[]; } export interface WebviewConsoleLog { level: Extract; message?: string; optionalParams?: string; } export declare class WebviewWidgetIdentifier { id: string; viewId?: string; } export declare const WebviewWidgetExternalEndpoint: unique symbol; export declare class WebviewWidget extends BaseWidget implements StatefulWidget, ExtractableWidget { private static readonly standardSupportedLinkSchemes; static FACTORY_ID: string; protected element: HTMLIFrameElement | undefined; protected transparentOverlay: HTMLElement; readonly identifier: WebviewWidgetIdentifier; readonly externalEndpoint: string; protected readonly mouseTracker: ApplicationShellMouseTracker; protected readonly environment: WebviewEnvironment; protected readonly openerService: OpenerService; protected readonly keybindings: KeybindingRegistry; protected readonly sharedStyle: PluginSharedStyle; protected readonly themeDataProvider: WebviewThemeDataProvider; protected readonly externalUriService: ExternalUriService; protected readonly outputManager: OutputChannelManager; protected readonly preferences: WebviewPreferences; protected readonly fileService: FileService; protected readonly resourceCache: WebviewResourceCache; protected readonly contextMenuRenderer: ContextMenuRenderer; protected readonly contextKeyService: ContextKeyService; viewState: WebviewPanelViewState; protected html: string; protected _contentOptions: WebviewContentOptions; get contentOptions(): WebviewContentOptions; protected _state: string | undefined; get state(): string | undefined; viewType: string; options: WebviewPanelOptions; protected ready: Deferred; protected readonly onMessageEmitter: Emitter; readonly onMessage: import("@theia/core").Event; protected readonly pendingMessages: any[]; protected readonly toHide: DisposableCollection; protected hideTimeout: any | number | undefined; isExtractable: boolean; secondaryWindow: Window | undefined; protected init(): void; protected onBeforeAttach(msg: Message): void; protected onAfterAttach(msg: Message): void; protected onBeforeShow(msg: Message): void; protected onAfterHide(msg: Message): void; protected doHide(): void; protected forceHide(): void; protected doShow(): void; protected loadLocalhost(origin: string): Promise; protected dispatchMouseEvent(type: string, data: MouseEvent): void; handleContextMenu(event: { clientX: number; clientY: number; context: any; }): void; protected getRedirect(url: string): Promise; protected toRemoteUrl(localUri: URI): Promise; setContentOptions(contentOptions: WebviewContentOptions): void; protected iconUrl: IconUrl | ThemeIconDTO | undefined; protected readonly toDisposeOnIcon: DisposableCollection; setIconUrl(iconUrl: IconUrl | ThemeIconDTO | undefined): void; protected toEndpoint(pathname: string): string; setHTML(value: string): void; protected preprocessHtml(value: string): string; protected onActivateRequest(msg: Message): void; reload(): void; protected forwardConsoleLog(log: WebviewConsoleLog): void; protected style(): void; protected openLink(link: URI): void; protected toSupportedLink(link: URI): URI | undefined; protected loadResource(requestPath: string, requestQuery?: string): Promise; protected normalizeRequestUri(requestPath: string): URI; sendMessage(data: any): void; protected doUpdateContent(): void; storeState(): WebviewWidget.State; restoreState(oldState: WebviewWidget.State): void; setIframeHeight(height: number): void; protected doSend(channel: string, data?: any): Promise; protected postMessage(channel: string, data?: any): void; protected on(channel: WebviewMessageChannels, handler: (data: T) => void): Disposable; protected trace(kind: 'in' | 'out', channel: string, data?: any): void; } export declare namespace WebviewWidget { namespace Styles { const WEBVIEW = "theia-webview"; } interface State { viewType: string; title: string; iconUrl?: IconUrl | ThemeIconDTO; options: WebviewPanelOptions; contentOptions: WebviewContentOptions; state?: string; } } //# sourceMappingURL=webview.d.ts.map