feat(overlay-sync): wire OverlaySyncService into DI, IPC and renderer gating

This commit is contained in:
2025-11-26 19:14:25 +01:00
parent d08f9e5264
commit 1d7c4f78d1
20 changed files with 611 additions and 561 deletions

View File

@@ -54,6 +54,9 @@ export interface ElectronAPI {
// Checkout Confirmation APIs
onCheckoutConfirmationRequest: (callback: (request: CheckoutConfirmationRequest) => void) => () => void;
confirmCheckout: (decision: 'confirmed' | 'cancelled' | 'timeout') => void;
// Overlay / Automation events
overlayActionRequest: (action: { id: string; label: string; meta?: Record<string, unknown>; timeoutMs?: number }) => Promise<{ id: string; status: 'confirmed' | 'tentative' | 'failed'; reason?: string }>;
onAutomationEvent: (callback: (event: any) => void) => () => void;
}
contextBridge.exposeInMainWorld('electronAPI', {
@@ -87,4 +90,14 @@ contextBridge.exposeInMainWorld('electronAPI', {
confirmCheckout: (decision: 'confirmed' | 'cancelled' | 'timeout') => {
ipcRenderer.send('checkout:confirm', decision);
},
// Overlay APIs
overlayActionRequest: (action: { id: string; label: string; meta?: Record<string, unknown>; timeoutMs?: number }) =>
ipcRenderer.invoke('overlay-action-request', action),
onAutomationEvent: (callback: (event: any) => void) => {
const listener = (_event: any, event: any) => callback(event);
ipcRenderer.on('automation-event', listener);
return () => {
ipcRenderer.removeListener('automation-event', listener);
};
},
} as ElectronAPI);