import type { FlowSessionRuntime, FlowSessionScheduler } from './flowSessionScheduler.js'; import { type InteractiveStateDef, type InteractiveStateOption } from './interactiveStates.js'; import type { RoutePreviewCache } from './routePreview.js'; import type { RoutePreviewKeyRuntime } from './framePreviewKeys.js'; import type { PageModel } from './store.js'; /** Computes the exact selection recipe without mutating the current frame. */ export declare function deriveInteractiveVariantIdentity(page: PageModel, def: InteractiveStateDef, option: InteractiveStateOption, defs?: readonly InteractiveStateDef[]): PageModel | null; export interface InteractiveVariantPrefetchCandidate { axisId: string; optionId: string; /** The recipe key the option's real selection would publish under. */ cacheKey: string; /** Hypothetical identity handed to prefetchPageInteractiveVariant. */ variantPage: PageModel; } /** * One editor's speculative variant prefetch: the kill switch, the debounce, * the active round, and the subscription to its interactive runner. Bound to * one runtime and its flow-session scheduler. */ export declare function createVariantPrefetch(runtime: FlowSessionRuntime, flows: Pick): { planInteractiveStatePrefetch: (keyRuntime: RoutePreviewKeyRuntime & { readonly previews: Pick; }, page: PageModel, previewRevision: string, limit?: number) => InteractiveVariantPrefetchCandidate[]; setInteractiveStatePrefetchEnabled: (enabled: boolean) => void; interactiveStatePrefetchEnabled: () => boolean; setInteractiveStatePrefetchDebounceMs: (ms: number) => void; __variantPrefetchDebug: { requested: number; rounds: number; queued: number; exhausted: number; unavailable: number; }; startInteractiveStatePrefetch: (page: PageModel, previewRevision: string) => void; cancelScheduledInteractiveStatePrefetch: () => void; requestInteractiveStatePrefetch: (page: PageModel, previewRevision: string) => () => void; }; export type VariantPrefetch = ReturnType;