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:
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user