MCPcopy
hub / github.com/BuilderIO/agent-native / ElectronAPI

Interface ElectronAPI

packages/desktop-app/src/renderer/global.d.ts:21–86  ·  view source on GitHub ↗

Electron APIs exposed to the renderer via the preload contextBridge

Source from the content-addressed store, hash-verified

19
20/** Electron APIs exposed to the renderer via the preload contextBridge */
21interface ElectronAPI {
22 platform: string;
23
24 windowControls: {
25 minimize(): void;
26 maximize(): void;
27 close(): void;
28 isMaximized(): Promise<boolean>;
29 onMaximizedChange(cb: (isMaximized: boolean) => void): () => void;
30 };
31
32 shortcuts: {
33 onCloseTab(cb: () => void): () => void;
34 onKeydown(
35 cb: (info: { key: string; shiftKey: boolean; altKey?: boolean }) => void,
36 ): () => void;
37 };
38
39 setActiveApp(appId: string): void;
40 setActiveWebview(target: { appId: string; webContentsId?: number }): void;
41
42 interApp: {
43 send(targetAppId: string, event: string, data: unknown): void;
44 on(cb: (from: string, event: string, data: unknown) => void): () => void;
45 };
46
47 frame: {
48 load(): Promise<{
49 enabled: boolean;
50 mode: "dev" | "prod";
51 prodUrl?: string;
52 }>;
53 update(settings: {
54 enabled?: boolean;
55 mode?: "dev" | "prod";
56 prodUrl?: string;
57 }): Promise<{
58 enabled: boolean;
59 mode: "dev" | "prod";
60 prodUrl?: string;
61 }>;
62 };
63
64 updater: {
65 check(): Promise<UpdateStatus>;
66 download(): Promise<UpdateStatus>;
67 install(): void;
68 getStatus(): Promise<UpdateStatus>;
69 onStatusChange(cb: (status: UpdateStatus) => void): () => void;
70 };
71
72 appConfig: {
73 load(): Promise<import("@agent-native/shared-app-config").AppConfig[]>;
74 add(
75 app: import("@agent-native/shared-app-config").AppConfig,
76 ): Promise<import("@agent-native/shared-app-config").AppConfig[]>;
77 remove(
78 id: string,

Callers 2

AppFunction · 0.80
reportActiveWebviewFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected