1 | import { NativeKeyboardLayout } from '../common/keyboard/keyboard-layout-provider';
|
2 | import { Disposable } from '../common';
|
3 | import { FrontendApplicationState, StopReason } from '../common/frontend-application-state';
|
4 | export declare type MenuRole = ('undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectAll' | 'about' | 'services' | 'hide' | 'hideOthers' | 'unhide' | 'quit');
|
5 | export interface MenuDto {
|
6 | id?: string;
|
7 | label?: string;
|
8 | submenu?: MenuDto[];
|
9 | type?: ('normal' | 'separator' | 'submenu' | 'checkbox' | 'radio');
|
10 | checked?: boolean;
|
11 | enabled?: boolean;
|
12 | visible?: boolean;
|
13 | role?: MenuRole;
|
14 | accelerator?: string;
|
15 | execute?: () => void;
|
16 | }
|
17 | export declare type InternalMenuDto = Omit<MenuDto, 'execute' | 'submenu'> & {
|
18 | submenu?: InternalMenuDto[];
|
19 | handlerId?: number;
|
20 | };
|
21 | export declare type WindowEvent = 'maximize' | 'unmaximize' | 'focus';
|
22 | export interface TheiaCoreAPI {
|
23 | getSecurityToken: () => string;
|
24 | attachSecurityToken: (endpoint: string) => Promise<void>;
|
25 | setMenuBarVisible(visible: boolean, windowName?: string): void;
|
26 | setMenu(menu: MenuDto[] | undefined): void;
|
27 | popup(menu: MenuDto[], x: number, y: number, onClosed: () => void): Promise<number>;
|
28 | closePopup(handle: number): void;
|
29 | focusWindow(name: string): void;
|
30 | showItemInFolder(fsPath: string): void;
|
31 | getTitleBarStyleAtStartup(): Promise<string>;
|
32 | setTitleBarStyle(style: string): void;
|
33 | setBackgroundColor(backgroundColor: string): void;
|
34 | minimize(): void;
|
35 | isMaximized(): boolean;
|
36 | maximize(): void;
|
37 | unMaximize(): void;
|
38 | close(): void;
|
39 | onWindowEvent(event: WindowEvent, handler: () => void): Disposable;
|
40 | setCloseRequestHandler(handler: (reason: StopReason) => Promise<boolean>): void;
|
41 | setSecondaryWindowCloseRequestHandler(windowName: string, handler: () => Promise<boolean>): void;
|
42 | toggleDevTools(): void;
|
43 | getZoomLevel(): Promise<number>;
|
44 | setZoomLevel(desired: number): void;
|
45 | isFullScreenable(): boolean;
|
46 | isFullScreen(): boolean;
|
47 | toggleFullScreen(): void;
|
48 | requestReload(): void;
|
49 | restart(): void;
|
50 | applicationStateChanged(state: FrontendApplicationState): void;
|
51 | readClipboard(): string;
|
52 | writeClipboard(text: string): void;
|
53 | onKeyboardLayoutChanged(handler: (newLayout: NativeKeyboardLayout) => void): Disposable;
|
54 | sendData(data: Uint8Array): void;
|
55 | onData(handler: (data: Uint8Array) => void): Disposable;
|
56 | }
|
57 | declare global {
|
58 | interface Window {
|
59 | electronTheiaCore: TheiaCoreAPI;
|
60 | }
|
61 | }
|
62 | export declare const CHANNEL_SET_MENU = "SetMenu";
|
63 | export declare const CHANNEL_SET_MENU_BAR_VISIBLE = "SetMenuBarVisible";
|
64 | export declare const CHANNEL_INVOKE_MENU = "InvokeMenu";
|
65 | export declare const CHANNEL_OPEN_POPUP = "OpenPopup";
|
66 | export declare const CHANNEL_ON_CLOSE_POPUP = "OnClosePopup";
|
67 | export declare const CHANNEL_CLOSE_POPUP = "ClosePopup";
|
68 | export declare const CHANNEL_GET_SECURITY_TOKEN = "GetSecurityToken";
|
69 | export declare const CHANNEL_FOCUS_WINDOW = "FocusWindow";
|
70 | export declare const CHANNEL_SHOW_OPEN = "ShowOpenDialog";
|
71 | export declare const CHANNEL_SHOW_SAVE = "ShowSaveDialog";
|
72 | export declare const CHANNEL_SHOW_ITEM_IN_FOLDER = "ShowItemInFolder";
|
73 | export declare const CHANNEL_ATTACH_SECURITY_TOKEN = "AttachSecurityToken";
|
74 | export declare const CHANNEL_GET_TITLE_STYLE_AT_STARTUP = "GetTitleStyleAtStartup";
|
75 | export declare const CHANNEL_SET_TITLE_STYLE = "SetTitleStyle";
|
76 | export declare const CHANNEL_SET_BACKGROUND_COLOR = "SetBackgroundColor";
|
77 | export declare const CHANNEL_CLOSE = "Close";
|
78 | export declare const CHANNEL_MINIMIZE = "Minimize";
|
79 | export declare const CHANNEL_MAXIMIZE = "Maximize";
|
80 | export declare const CHANNEL_IS_MAXIMIZED = "IsMaximized";
|
81 | export declare const CHANNEL_UNMAXIMIZE = "UnMaximize";
|
82 | export declare const CHANNEL_ON_WINDOW_EVENT = "OnWindowEvent";
|
83 | export declare const CHANNEL_TOGGLE_DEVTOOLS = "ToggleDevtools";
|
84 | export declare const CHANNEL_GET_ZOOM_LEVEL = "GetZoomLevel";
|
85 | export declare const CHANNEL_SET_ZOOM_LEVEL = "SetZoomLevel";
|
86 | export declare const CHANNEL_IS_FULL_SCREENABLE = "IsFullScreenable";
|
87 | export declare const CHANNEL_IS_FULL_SCREEN = "IsFullScreen";
|
88 | export declare const CHANNEL_TOGGLE_FULL_SCREEN = "ToggleFullScreen";
|
89 | export declare const CHANNEL_REQUEST_SECONDARY_CLOSE = "RequestSecondaryClose";
|
90 | export declare const CHANNEL_REQUEST_CLOSE = "RequestClose";
|
91 | export declare const CHANNEL_REQUEST_RELOAD = "RequestReload";
|
92 | export declare const CHANNEL_RESTART = "Restart";
|
93 | export declare const CHANNEL_APP_STATE_CHANGED = "ApplicationStateChanged";
|
94 | export declare const CHANNEL_READ_CLIPBOARD = "ReadClipboard";
|
95 | export declare const CHANNEL_WRITE_CLIPBOARD = "WriteClipboard";
|
96 | export declare const CHANNEL_KEYBOARD_LAYOUT_CHANGED = "KeyboardLayoutChanged";
|
97 | export declare const CHANNEL_IPC_CONNECTION = "IpcConnection";
|
98 |
|
\ | No newline at end of file |