2024-05-14 08:45:41 +02:00
|
|
|
// Copyright 2024, Command Line Inc.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2024-05-27 08:05:11 +02:00
|
|
|
declare global {
|
2024-06-04 22:05:44 +02:00
|
|
|
type TabLayoutData = {
|
|
|
|
blockId: string;
|
|
|
|
};
|
2024-06-14 01:49:25 +02:00
|
|
|
|
2024-06-20 00:42:19 +02:00
|
|
|
type ContextMenuOpts = {
|
|
|
|
showCut?: boolean;
|
|
|
|
onlyPaste?: boolean;
|
|
|
|
};
|
|
|
|
|
2024-06-14 01:49:25 +02:00
|
|
|
type ElectronApi = {
|
2024-06-19 20:15:14 +02:00
|
|
|
/**
|
|
|
|
* Determines whether the current app instance is a development build.
|
|
|
|
* @returns True if the current app instance is a development build.
|
|
|
|
*/
|
2024-06-14 01:49:25 +02:00
|
|
|
isDev: () => boolean;
|
2024-06-19 20:15:14 +02:00
|
|
|
/**
|
|
|
|
* Determines whether the current app instance is hosted in a Vite dev server.
|
|
|
|
* @returns True if the current app instance is hosted in a Vite dev server.
|
|
|
|
*/
|
2024-06-14 01:49:25 +02:00
|
|
|
isDevServer: () => boolean;
|
2024-06-19 20:15:14 +02:00
|
|
|
/**
|
|
|
|
* Get a point value representing the cursor's position relative to the calling BrowserWindow
|
|
|
|
* @returns A point value.
|
|
|
|
*/
|
|
|
|
getCursorPoint: () => Electron.Point;
|
2024-06-20 00:42:19 +02:00
|
|
|
|
|
|
|
contextEditMenu: (position: { x: number; y: number }, opts: ContextMenuOpts) => void;
|
|
|
|
showContextMenu: (menu: ElectronContextMenuItem[], position: { x: number; y: number }) => void;
|
|
|
|
onContextMenuClick: (callback: (id: string) => void) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
type ElectronContextMenuItem = {
|
|
|
|
id: string; // unique id, used for communication
|
|
|
|
label: string;
|
|
|
|
role?: string; // electron role (optional)
|
|
|
|
type?: "separator" | "normal" | "submenu";
|
|
|
|
submenu?: ElectronContextMenuItem[];
|
|
|
|
};
|
|
|
|
|
|
|
|
type ContextMenuItem = {
|
|
|
|
label?: string;
|
|
|
|
type?: "separator" | "normal" | "submenu";
|
|
|
|
role?: string; // electron role (optional)
|
|
|
|
click?: () => void; // not required if role is set
|
|
|
|
submenu?: ContextMenuItem[];
|
2024-06-14 01:49:25 +02:00
|
|
|
};
|
2024-06-18 07:38:48 +02:00
|
|
|
|
|
|
|
type SubjectWithRef<T> = rxjs.Subject<T> & { refCount: number; release: () => void };
|
2024-05-27 08:05:11 +02:00
|
|
|
}
|
2024-05-14 08:45:41 +02:00
|
|
|
|
|
|
|
export {};
|