forked from franco-chan/OneKey-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.d.ts
54 lines (53 loc) · 1.8 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Interface for exposed Electron API (ipcRenderer)
export interface DesktopApi {
send: (channel: string, data?: any) => void;
on: (channel: string, func: (...args: any[]) => any) => void;
once: (channel: string, func: (...args: any[]) => any) => void;
removeAllListeners: (channel: string) => void;
// App Ready
ready: () => void;
// Auto Updater
checkForUpdates: (isManual?: boolean) => void;
downloadUpdate: () => void;
installUpdate: () => void;
cancelUpdate: () => void;
skipUpdate: (version: string) => void;
// Window controls
windowClose: () => void;
windowMinimize: () => void;
windowFocus: () => void;
windowMaximize: () => void;
windowUnmaximize: () => void;
// Client controls
clientReady: () => void;
// Metadata
metadataWrite: (options: {
file: string;
content: string;
}) => Promise<{ success: true } | { success: false; error: string }>;
metadataRead: (options: {
file: string;
}) => Promise<{ success: true; payload: string } | { success: false; error: string }>;
// HttpReceiver
getHttpReceiverAddress: (route: string) => Promise<string>;
// Tor
getStatus: () => void;
toggleTor: (start: boolean) => void;
getTorAddress: () => Promise<string>;
setTorAddress: (address: string) => void;
// Analytics
getOSVersion: () => Promise<
| { success: true; payload: { platform: string; release: string } }
| { success: false; error: string }
>;
openExternal: (url: string) => void;
}
declare global {
interface Window {
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: () => any | null;
INJECT_PATH: string;
desktopApi?: DesktopApi; // Electron API
$BLE_MODE?: boolean;
$BLE_DATA?: Record<string, string>;
}
}