@theia/core
Version:
Theia is a cloud & desktop IDE framework implemented in TypeScript.
59 lines • 3.64 kB
TypeScript
import { SecondaryWindow, SecondaryWindowOptions, SecondaryWindowService } from './secondary-window-service.js';
import { WindowService } from './window-service.js';
import { ExtractableWidget, Widget } from '../widgets/index.js';
import { ApplicationShell } from '../shell/index.js';
import { Emitter, Event, PreferenceService, ILogger } from '../../common/index.js';
import { SaveableService } from '../saveable-service.js';
import { WindowFocusService } from './window-focus-service.js';
import { SecondaryWindowCloseContribution } from './secondary-window-close-contribution.js';
import { ContributionProvider } from '../../common/contribution-provider.js';
export declare class DefaultSecondaryWindowService implements SecondaryWindowService {
protected readonly onWindowOpenedEmitter: Emitter<Window>;
readonly onWindowOpened: Event<Window>;
protected readonly onWindowLoadedEmitter: Emitter<Window>;
readonly onWindowLoaded: Event<Window>;
protected readonly onWindowClosedEmitter: Emitter<Window>;
readonly onWindowClosed: Event<Window>;
protected readonly beforeWidgetRestoreEmitter: Emitter<[Widget, Window]>;
readonly beforeWidgetRestore: Event<[Widget, Window]>;
protected static SECONDARY_WINDOW_URL: string;
/**
* Randomized prefix to be included in opened windows' ids.
* This avoids conflicts when creating sub-windows from multiple theia instances (e.g. by opening Theia multiple times in the same browser)
*/
protected readonly prefix: number;
/** Unique id. Increase after every access. */
private nextId;
protected secondaryWindows: Window[];
/**
* Whether the main window is shutting down, which closes all secondary windows. Such a close is not handled like a close by the user:
* the widgets stay in their windows, so that the windows are stored with the layout and restored on the next start.
*/
protected shuttingDown: boolean;
protected readonly windowService: WindowService;
protected readonly preferenceService: PreferenceService;
protected readonly saveResourceService: SaveableService;
protected readonly windowFocusService: WindowFocusService;
protected readonly logger: ILogger;
protected readonly closeContributions: ContributionProvider<SecondaryWindowCloseContribution>;
init(): void;
protected registerShutdownListeners(): void;
createSecondaryWindow(widget: ExtractableWidget, shell: ApplicationShell, options?: SecondaryWindowOptions): Window | SecondaryWindow | undefined;
protected windowCreated(newWindow: Window, widget: ExtractableWidget, shell: ApplicationShell): void;
protected findWindow<T>(windowName: string): Window | undefined;
protected findSecondaryWindowCoordinates(widget: ExtractableWidget): (number | undefined)[];
getWindows(): Window[];
focus(win: Window): void;
protected nextWindowId(): string;
restoreWidget(widget: Widget, secondaryWindow: Window, shell: ApplicationShell): Promise<void>;
/**
* @returns whether the given widget is to be moved back to the main window instead of being closed with its secondary window
*/
protected shouldRestoreOnClose(widget: Widget): Promise<boolean>;
/**
* Restore the widgets back to the main window, or close them, depending on the `window.secondaryWindowCloseBehavior` preference.
* SecondaryWindowHandler needs to get informated about this.
*/
protected restoreWidgets(newWindow: Window, extractableWidget: ExtractableWidget, shell: ApplicationShell): Promise<boolean>;
}
//# sourceMappingURL=default-secondary-window-service.d.ts.map