UNPKG

2.61 kBTypeScriptView Raw
1import { FrontendApplicationConfig } from '@theia/application-package';
2import { FrontendApplicationState, StopReason } from '../common/frontend-application-state';
3import { BrowserWindow, BrowserWindowConstructorOptions } from '../../electron-shared/electron';
4import { ElectronMainApplicationGlobals } from './electron-main-constants';
5import { DisposableCollection, Emitter, Event } from '../common';
6/**
7 * Theia tracks the maximized state of Electron Browser Windows.
8 */
9export interface TheiaBrowserWindowOptions extends BrowserWindowConstructorOptions {
10 isMaximized?: boolean;
11 isFullScreen?: boolean;
12 /**
13 * Represents the complete screen layout for all available displays.
14 * This field is used to determine if the layout was updated since the electron window was last opened,
15 * in which case we want to invalidate the stored options and use the default options instead.
16 */
17 screenLayout?: string;
18}
19export declare const TheiaBrowserWindowOptions: unique symbol;
20export declare const WindowApplicationConfig: unique symbol;
21export declare type WindowApplicationConfig = FrontendApplicationConfig;
22export declare class TheiaElectronWindow {
23 protected readonly options: TheiaBrowserWindowOptions;
24 protected readonly config: WindowApplicationConfig;
25 protected readonly globals: ElectronMainApplicationGlobals;
26 protected onDidCloseEmitter: Emitter<void>;
27 get onDidClose(): Event<void>;
28 protected readonly toDispose: DisposableCollection;
29 protected _window: BrowserWindow;
30 get window(): BrowserWindow;
31 protected closeIsConfirmed: boolean;
32 protected applicationState: FrontendApplicationState;
33 protected init(): void;
34 protected attachSecondaryWindowListener(): void;
35 /**
36 * Only show the window when the content is ready.
37 */
38 protected attachReadyToShow(): void;
39 protected attachCloseListeners(): void;
40 protected doCloseWindow(): void;
41 close(reason?: StopReason): Promise<boolean>;
42 protected reload(): void;
43 protected handleStopRequest(onSafeCallback: () => unknown, reason: StopReason): Promise<boolean>;
44 protected checkSafeToStop(reason: StopReason): Promise<boolean>;
45 protected restoreMaximizedState(): void;
46 protected trackApplicationState(): void;
47 protected attachReloadListener(): void;
48 dispose(): void;
49}
50export interface TheiaElectronWindowFactory {
51 (options: TheiaBrowserWindowOptions, config: FrontendApplicationConfig): TheiaElectronWindow;
52}
53export declare const TheiaElectronWindowFactory: unique symbol;
54//# sourceMappingURL=theia-electron-window.d.ts.map
\No newline at end of file