import type { DesignScreenInteraction, StoryboardEnvironment } from './designImport.js'; export interface ScreenFlowWaypoint { /** Catalog id of the screen this waypoint materializes (importPageId). */ screenId: string; /** * The walk delta: interactions leading from the previous waypoint (or the * boot, for the first waypoint) to this screen's state. */ steps?: readonly DesignScreenInteraction[]; } export interface ScreenFlowPath { id: string; /** Canonical product route the instance starts from. */ route: string; /** Optional host-owned gateway used only to boot this flow in previews. */ previewRoute?: string; /** * Declarative browser environment of the whole instance, merged over the * storyboard baseline. Branch paths (error states, special fixtures) * declare their overrides here and pay their own boot. */ environment?: StoryboardEnvironment; waypoints: readonly ScreenFlowWaypoint[]; } export interface ScreenFlowDiagnostic { severity: 'error' | 'warning'; pathId: string; message: string; } /** * Structural validation of host-declared flow paths against the screen * catalog. Errors mark paths the runner will refuse; warnings surface * declarations that will behave surprisingly but still run. */ export declare function validateScreenFlows(paths: readonly ScreenFlowPath[], screens: readonly { id: string; }[]): ScreenFlowDiagnostic[]; /** * Orders paths for a materialization round: paths that deliver a priority * screen (the active frame, the hovered frame) run first; the declared order * is kept otherwise. */ export declare function orderFlowPaths(paths: readonly T[], priorityScreenIds: ReadonlySet): T[]; /** One editor's declared screen flows. */ export declare function createScreenFlows(): { setScreenFlows: (paths: readonly ScreenFlowPath[]) => void; getScreenFlows: () => readonly ScreenFlowPath[]; flowPathForScreen: (screenId: string) => ScreenFlowPath | null; }; export type ScreenFlows = ReturnType;