import { OpenRequestedDetail } from '@getuserfeedback/protocol/host'; type OpenRequestedPayload = OpenRequestedDetail; type OpenRequestedDecision = { allowed: true; } | { allowed: false; reason: string; }; type OpenRequestedSource = OpenRequestedPayload["source"]; type OpenRequestedEvent = { /** * Origin of this open request. * - `"command"`: requested by an explicit open command, e.g. when you call `client.flow(flowId).open()`. * - `"targeting"`: requested by targeting plan evaluation. */ readonly source: OpenRequestedSource; /** Flow identifier that is about to be opened. */ readonly flowId: string; readonly defaultPrevented: boolean; preventDefault: () => void; }; type OpenRequestListener = (event: OpenRequestedEvent) => void; type OpenRequestDispatcher = { subscribe: (listener: OpenRequestListener) => () => void; dispatch: (payload: OpenRequestedPayload, options?: { onListenerError?: (error: unknown) => void; preventHostDefault?: () => void; }) => OpenRequestedDecision; }; declare const createOpenRequestDispatcher: () => OpenRequestDispatcher; export { createOpenRequestDispatcher }; export type { OpenRequestDispatcher };