import { Widget } from '@theia/core/shared/@lumino/widgets'; import URI from '@theia/core/lib/common/uri'; import { MaybePromise } from '@theia/core/lib/common/types'; import { QuickInputService } from '@theia/core/lib/browser'; import { ApplicationShell } from '@theia/core/lib/browser/shell'; import { Command, CommandContribution, CommandRegistry } from '@theia/core/lib/common/command'; import { MenuContribution, MenuModelRegistry } from '@theia/core/lib/common/menu'; import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar'; import { NavigatableWidget, NavigatableWidgetOpenHandler } from '@theia/core/lib/browser/navigatable'; import { OpenerService } from '@theia/core/lib/browser/opener-service'; import { LabelProvider } from '@theia/core/lib/browser/label-provider'; import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution'; import { WidgetOpenerOptions } from '@theia/core/lib/browser/widget-open-handler'; import { MiniBrowserService } from '../common/mini-browser-service'; import { MiniBrowser, MiniBrowserProps } from './mini-browser'; import { LocationMapperService } from './location-mapper-service'; export declare namespace MiniBrowserCommands { const PREVIEW_CATEGORY = "Preview"; const PREVIEW_CATEGORY_KEY: string; const PREVIEW: Command; const OPEN_SOURCE: Command; const OPEN_URL: Command; } /** * Further options for opening a new `Mini Browser` widget. */ export interface MiniBrowserOpenerOptions extends WidgetOpenerOptions, MiniBrowserProps { /** * Controls how the mini-browser widget should be opened. * - `source`: editable source. * - `preview`: rendered content of the source. */ openFor?: 'source' | 'preview'; } export declare class MiniBrowserOpenHandler extends NavigatableWidgetOpenHandler implements FrontendApplicationContribution, CommandContribution, MenuContribution, TabBarToolbarContribution { static PREVIEW_URI: URI; /** * Instead of going to the backend with each file URI to ask whether it can handle the current file or not, * we have this map of extension and priority pairs that we populate at application startup. * The real advantage of this approach is the following: [Lumino cannot run async code when invoking `isEnabled`/`isVisible` * for the command handlers](https://github.com/eclipse-theia/theia/issues/1958#issuecomment-392829371) * so the menu item would be always visible for the user even if the file type cannot be handled eventually. * Hopefully, we could get rid of this hack once we have migrated the existing Lumino code to [React](https://github.com/eclipse-theia/theia/issues/1915). */ protected readonly supportedExtensions: Map; readonly id: string; readonly label: string; protected readonly openerService: OpenerService; protected readonly labelProvider: LabelProvider; protected readonly quickInputService: QuickInputService; protected readonly miniBrowserService: MiniBrowserService; protected readonly locationMapperService: LocationMapperService; onStart(): void; canHandle(uri: URI, options?: MiniBrowserOpenerOptions): number; open(uri: URI, options?: MiniBrowserOpenerOptions): Promise; protected getOrCreateWidget(uri: URI, options?: MiniBrowserOpenerOptions): Promise; protected options(uri?: URI, options?: MiniBrowserOpenerOptions): Promise; protected resetBackground(uri: URI): MaybePromise; protected defaultOptions(): Promise; registerCommands(commands: CommandRegistry): void; registerMenus(menus: MenuModelRegistry): void; registerToolbarItems(toolbar: TabBarToolbarRegistry): void; protected canPreviewWidget(widget?: Widget): boolean; protected getUriToPreview(widget?: Widget): URI | undefined; protected getWidgetToPreview(widget?: Widget): NavigatableWidget | undefined; protected preview(widget?: Widget): Promise; protected openSource(ref?: Widget): Promise; protected getSourceUri(ref?: Widget): URI | undefined; protected openUrl(arg?: string): Promise; openPreview(startPage: string): Promise; protected getOpenPreviewProps(startPage: string): Promise; } //# sourceMappingURL=mini-browser-open-handler.d.ts.map