import type { DisplayMode, SelectModeFormatCommand, SelectModeOptimisticUpdatePayload, SelectModeSelectionType } from "../../_vendor/schemas/generated/selectMode"; /** * Inbound side of the iframe<->parent selectMode bridge. * * Listens for Website Builder → canopy methods and applies them locally: * - `setDisplayMode`: switch the iframe between `browse` and `selection`. * - `setSelectionType`: declarative push of the parent's current * selection type. The interesting transition is `* → "none"`, which * tears down any in-iframe selection frame / in-progress drag — agent-ui * drives it from `agentUiState.selectionType` so panel dismiss / submit * flow through the same path as exiting selection mode entirely. The * regression test in `EditorSelection.spec.tsx` covers the case where * losing this used to lock the iframe out of further selections. * * Also fires `iframeReady` on mount so the parent knows it's safe to push * the initial `setDisplayMode` — without this handshake the parent would * race the iframe's mount and the first message could be lost. */ export declare function useParentMessaging({ applyOptimisticUpdate, markCommitted, resolveSessionOverrides, onExpandToSection, onSetSectionPreview, onEnterEditMode, onExitEditMode, onFormatCommand, revertOverride, setDisplayMode, setSelectionType, }: { applyOptimisticUpdate?: (input: { editId: string; payload: SelectModeOptimisticUpdatePayload; targetSelector: string; targetMode: "primary" | "group"; }) => void; markCommitted?: (editId: string, sessionId: string) => void; resolveSessionOverrides?: (sessionId: string, outcome: "persisted" | "failed") => void; onExpandToSection?: (input: { targetSelector: string; }) => void; onSetSectionPreview?: (input: { targetSelector: string | null; }) => void; onEnterEditMode?: () => void; onExitEditMode?: () => void; onFormatCommand?: (command: SelectModeFormatCommand) => void; revertOverride?: (editId: string) => void; setDisplayMode: (displayMode: DisplayMode) => void; setSelectionType: (input: { selectionType: SelectModeSelectionType; selectors?: string[]; }) => void; }): void;