UNPKG

1.61 kBTypeScriptView Raw
1import { Menu, MenuItemConstructorOptions, WebContents } from '@theia/electron/shared/electron';
2import { FrontendApplicationState, StopReason } from '../common/frontend-application-state';
3import { ElectronSecurityToken } from '../electron-common/electron-token';
4import { WindowEvent, InternalMenuDto } from '../electron-common/electron-api';
5import { ElectronMainApplication, ElectronMainApplicationContribution } from './electron-main-application';
6import { Disposable, MaybePromise } from '../common';
7export declare class TheiaMainApi implements ElectronMainApplicationContribution {
8 protected electronSecurityToken: ElectronSecurityToken;
9 protected readonly openPopups: Map<number, Menu>;
10 onStart(application: ElectronMainApplication): MaybePromise<void>;
11 fromMenuDto(sender: WebContents, menuId: number, menuDto: InternalMenuDto[]): MenuItemConstructorOptions[];
12}
13export declare namespace TheiaRendererAPI {
14 function sendWindowEvent(wc: WebContents, event: WindowEvent): void;
15 function requestClose(wc: WebContents, stopReason: StopReason): Promise<boolean>;
16 function requestSecondaryClose(mainWindow: WebContents, secondaryWindow: WebContents): Promise<boolean>;
17 function onRequestReload(wc: WebContents, handler: () => void): Disposable;
18 function onApplicationStateChanged(wc: WebContents, handler: (state: FrontendApplicationState) => void): Disposable;
19 function onIpcData(handler: (sender: WebContents, data: Uint8Array) => void): Disposable;
20 function sendData(wc: WebContents, data: Uint8Array): void;
21}
22//# sourceMappingURL=electron-api-main.d.ts.map
\No newline at end of file