/** * The live document currently reproducing a right-panel screen state. * * State preservation and state presentation are intentionally separate. The * flow runner keeps this iframe alive until its exact frozen snapshot is * published, while the active frame may mirror the running document * immediately so capture stability never becomes interaction latency. */ import type { DesignScreenDesiredState } from './designImport.js'; import type { RoutePreviewShadowArtifact } from './routePreview.js'; export interface InteractiveSessionSurface { iframe: HTMLIFrameElement; screenId: string; } interface DirectStatePreviewRequest { pageId: string; stateId: string; desiredState: DesignScreenDesiredState; } /** Stable presentation slot shared by sibling direct-state options. */ export declare function directInteractiveSessionSurfaceId(pageId: string, stateId: string): string; /** * One editor's registry of live documents presenting a screen state, with the * two direct-state handlers its flow-session scheduler installs. Every runtime * owns one, so a store's option click reaches its own scheduler. */ export declare function createInteractiveSessionSurfaces(): { claimStoryboardLiveFrame: (pageId: string) => { update(key: string, status: "pending" | "ready" | "failed", artifact?: RoutePreviewShadowArtifact): void; dispose(): void; }; storyboardLiveFrameStatus: (pageId: string, key: string) => "ready" | "pending" | "failed" | undefined; storyboardLiveFrameSnapshot: (pageId: string, key: string) => RoutePreviewShadowArtifact | null; subscribeStoryboardLiveFrames: (listener: () => void) => () => void; getStoryboardLiveFrameRevision: () => number; claimDirectInteractiveStateScope: () => () => void; attachDirectInteractiveStateConsumer: (pageId: string, consumer: { preview(request: DirectStatePreviewRequest): boolean; request(): void; }) => () => void; attachInteractiveSessionPresentation: (iframe: HTMLIFrameElement, pageId: string, anchor: HTMLElement) => () => void; canPresentInteractiveSessionSurface: (iframe: HTMLIFrameElement, pageId: string) => boolean; presentInteractiveSessionSurface: (iframe: HTMLIFrameElement, pageId: string) => boolean; setDirectInteractiveStateRequestHandler: (handler: ((pageId: string) => void) | null) => void; requestDirectInteractiveState: (pageId: string) => boolean; setDirectInteractiveStatePreviewHandler: (handler: ((request: { pageId: string; stateId: string; desiredState: DesignScreenDesiredState; }) => boolean) | null) => void; requestDirectInteractiveStatePreview: (request: { pageId: string; stateId: string; desiredState: DesignScreenDesiredState; }) => boolean; exposeInteractiveSessionSurface: (screenId: string, iframe: HTMLIFrameElement) => void; redirectInteractiveSessionSurface: (fromScreenId: string, toScreenId: string) => boolean; releaseInteractiveSessionSurface: (screenId: string, iframe: HTMLIFrameElement) => void; clearInteractiveSessionSurface: (screenId: string) => void; hasInteractiveSessionSurfaceIframe: (iframe: HTMLIFrameElement) => boolean; getInteractiveSessionSurface: (screenId: string) => InteractiveSessionSurface | null; subscribeInteractiveSessionSurface: (screenId: string, listener: () => void) => () => void; }; export type InteractiveSessionSurfaces = ReturnType; export {};