feat(desktop): add recovery bridge methods to preload + types

- rendererReady (boot-completion ping)
- getRecoveryState / onRecoveryStateChanged (recovery.html subscribers)
- recoveryAction (button click dispatcher with enum action)

Type declarations kept ambient (no export) to preserve window.backspace
global augmentation — exporting from an ambient .d.ts converts it to a
module and breaks the Window interface extension.
This commit is contained in:
Jannis Braun
2026-05-03 11:57:51 +02:00
parent d8266e62da
commit ece81a2b71
2 changed files with 44 additions and 0 deletions
+19
View File
@@ -107,4 +107,23 @@ contextBridge.exposeInMainWorld('backspace', {
return () => { ipcRenderer.removeListener('keybind-hook-error', handler); };
},
checkAccessibility: () => ipcRenderer.invoke('check-accessibility'),
// Recovery mode bridge (Task 11)
rendererReady: (): void => {
ipcRenderer.send('renderer-ready');
},
getRecoveryState: (): Promise<unknown> => {
return ipcRenderer.invoke('get-recovery-state');
},
onRecoveryStateChanged: (cb: (state: unknown) => void): (() => void) => {
const handler = (_e: Electron.IpcRendererEvent, state: unknown) => cb(state);
ipcRenderer.on('recovery-state-changed', handler);
return () => { ipcRenderer.removeListener('recovery-state-changed', handler); };
},
recoveryAction: (action: string): void => {
ipcRenderer.send('recovery-action', action);
},
});