feat(overlay-sync): wire OverlaySyncService into DI, IPC and renderer gating
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user