Skip to content

Commit

Permalink
retype electron.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Sep 19, 2023
1 parent fd4fa9f commit 5a9f707
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/types/modules/electron.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
// TODO: Move this type to desktop/contextBridge.js once it is converted to TS
type ContextBridgeApi = {
send: (channel: string, data?: unknown) => void;
sendSync: (channel: string, data?: unknown) => unknown;
invoke: (channel: string, ...args: unknown) => Promise<unknown>;
on: (channel: string, func: () => void) => void;
removeAllListeners: (channel: string) => void;
};

declare global {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
interface Window {
electron: Electron.IpcRenderer;
electron: ContextBridgeApi;
}
}

Expand Down

0 comments on commit 5a9f707

Please sign in to comment.