export enum ElectronEvent { FULLSCREEN_CHANGE = 'fullscreen-change', UPDATE_ERROR = 'update-error', UPDATE_AVAILABLE = 'update-available', DEEPLINK = 'deeplink', } export enum ElectronAction { GET_IS_FULLSCREEN = 'get-is-fullscreen', INSTALL_UPDATE = 'install-update', HANDLE_DOUBLE_CLICK = 'handle-double-click', OPEN_NEW_WINDOW = 'open-new-window', SET_WINDOW_TITLE = 'set-window-title', SET_TRAFFIC_LIGHT_POSITION = 'set-traffic-light-position', SET_IS_AUTO_UPDATE_ENABLED = 'set-is-auto-update-enabled', GET_IS_AUTO_UPDATE_ENABLED = 'get-is-auto-update-enabled', SET_IS_TRAY_ICON_ENABLED = 'set-is-tray-icon-enabled', GET_IS_TRAY_ICON_ENABLED = 'get-is-tray-icon-enabled', RESTORE_LOCAL_STORAGE = 'restore-local-storage', } export type TrafficLightPosition = 'standard' | 'lowered'; export interface ElectronApi { isFullscreen: () => Promise; installUpdate: () => Promise; handleDoubleClick: () => Promise; openNewWindow: (url: string, title?: string) => Promise; setWindowTitle: (title?: string) => Promise; setTrafficLightPosition: (position: TrafficLightPosition) => Promise; setIsAutoUpdateEnabled: (value: boolean) => Promise; getIsAutoUpdateEnabled: () => Promise; setIsTrayIconEnabled: (value: boolean) => Promise; getIsTrayIconEnabled: () => Promise; restoreLocalStorage: () => Promise; on: (eventName: ElectronEvent, callback: any) => VoidFunction; } declare global { interface Window { electron?: ElectronApi; } }