CSAPP/src/types/electron.d.ts

16 lines
601 B
TypeScript
Raw Normal View History

2025-04-29 18:36:29 +08:00
export interface ElectronAPI {
onOpenTab: (callback: (webContentId: number, url: string) => void) => void;
getPrimaryDisplay: () => Promise<Electron.Display>;
checkUrlAvailable: (url: string) => Promise<{ ok: boolean; status: number; error?: string }>;
setWebviewCookie: (url: string, cookie: string) => Promise<boolean>;
setSessionStorage: (key: string, value: string) => void;
getSessionStorage: (key: string) => string | null;
removeSessionStorage: (key: string) => void;
clearSessionStorage: () => void;
2025-04-29 18:36:29 +08:00
}
declare global {
interface Window {
electronAPI: ElectronAPI;
}
}