@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
65 lines • 3.56 kB
TypeScript
import { ExtractableWidget, Widget } from './widgets';
import { MessageService } from '../common/message-service';
import { ApplicationShell } from './shell/application-shell';
import { Emitter } from '../common/event';
import { SecondaryWindowService } from './window/secondary-window-service';
import { KeybindingRegistry } from './keybinding';
import { ColorApplicationContribution } from './color-application-contribution';
import { StylingService } from './styling-service';
/**
* Offers functionality to move a widget out of the main window to a newly created window.
* Widgets must explicitly implement the `ExtractableWidget` interface to support this.
*
* This handler manages the opened secondary windows and sets up messaging between them and the Theia main window.
* In addition, it provides access to the extracted widgets and provides notifications when widgets are added to or removed from this handler.
*
* @experimental The functionality provided by this handler is experimental and has known issues in Electron apps.
*/
export declare class SecondaryWindowHandler {
/** List of widgets in secondary windows. */
protected readonly _widgets: ExtractableWidget[];
protected applicationShell: ApplicationShell;
protected keybindings: KeybindingRegistry;
protected colorAppContribution: ColorApplicationContribution;
protected stylingService: StylingService;
protected readonly onDidAddWidgetEmitter: Emitter<Widget>;
/** Subscribe to get notified when a widget is added to this handler, i.e. the widget was moved to an secondary window . */
readonly onDidAddWidget: import("../common/event").Event<Widget>;
protected readonly onDidRemoveWidgetEmitter: Emitter<Widget>;
/** Subscribe to get notified when a widget is removed from this handler, i.e. the widget's window was closed or the widget was disposed. */
readonly onDidRemoveWidget: import("../common/event").Event<Widget>;
protected readonly messageService: MessageService;
protected readonly secondaryWindowService: SecondaryWindowService;
/** @returns List of widgets in secondary windows. */
get widgets(): ReadonlyArray<Widget>;
/**
* Sets up message forwarding from the main window to secondary windows.
* Does nothing if this service has already been initialized.
*
* @param shell The `ApplicationShell` that widgets will be moved out from.
*/
init(shell: ApplicationShell): void;
/**
* Moves the given widget to a new window.
*
* @param widget the widget to extract
*/
moveWidgetToSecondaryWindow(widget: ExtractableWidget): void;
/**
* If the given widget is tracked by this handler, activate it and focus its secondary window.
*
* @param widgetId The widget to activate specified by its id
* @returns The activated `ExtractableWidget` or `undefined` if the given widget id is unknown to this handler.
*/
activateWidget(widgetId: string): ExtractableWidget | undefined;
/**
* If the given widget is tracked by this handler, reveal it by focussing its secondary window.
*
* @param widgetId The widget to reveal specified by its id
* @returns The revealed `ExtractableWidget` or `undefined` if the given widget id is unknown to this handler.
*/
revealWidget(widgetId: string): ExtractableWidget | undefined;
protected addWidget(widget: ExtractableWidget): void;
protected removeWidget(widget: ExtractableWidget): void;
}
//# sourceMappingURL=secondary-window-handler.d.ts.map