/** * Reveal intent — authoring sugar over Pose/Transition/Policy graph nodes (#124). * * `Reveal.intent` is data over canonical intent: it lowers to real DocumentGraph * node families and has no behavior authority. Motion compiles through * `interpretTransition` → CSS projection + runtime leaf-write floor. * * @module */ import type { ContentAddress, StateName } from './brands.js'; import type { DocumentGraph } from './document-graph.js'; import type { Easing } from './easing.js'; import { sourceToInput } from './signal-input.js'; import type { MotionTier } from './ui-quality.js'; import type { BranchCondition, TransitionProgram } from './transition-program.js'; /** Reduced-motion handling for a reveal. */ export type RevealReducedMotion = 'settle' | 'none'; /** View-timeline or scroll trigger for a reveal. */ export type RevealTrigger = { readonly type: 'view'; readonly range: readonly [string, string]; } | { readonly type: 'scroll'; readonly axis?: 'progress' | 'y' | 'x'; }; /** Timing config for the reveal transition. */ export interface RevealTransition { readonly durationMs: number; readonly easing?: 'linear' | 'ease' | 'spring'; /** * Spring physics for `easing: 'spring'` (ignored otherwise). Carried through to * the lowered {@link TransitionNode} so BOTH the CSS `linear()` and the JS floor * sample this ONE config; omitted ⇒ the shared `DEFAULT_MOTION_SPRING`. */ readonly spring?: Easing.Config; } /** Policy gate for reduced-motion and motion tier. */ export interface RevealPolicy { readonly reducedMotion: RevealReducedMotion; readonly motionTier: MotionTier; } /** Authoring input to {@link Reveal.intent}. */ export interface RevealIntentInput { readonly target: string; readonly trigger: RevealTrigger; readonly from: Readonly>; readonly to: Readonly>; readonly transition: RevealTransition; readonly policy: RevealPolicy; } /** Sealed reveal intent — data over graph, no behavior authority. */ export interface RevealIntent extends RevealIntentInput { readonly _tag: 'RevealIntent'; } /** Graph bundle produced by {@link lowerRevealIntent}. */ export interface LoweredReveal { readonly graph: DocumentGraph; readonly intent: RevealIntent; readonly transitionId: ContentAddress; readonly componentId: ContentAddress; readonly entityId: ContentAddress; readonly policyId: ContentAddress; readonly projectionId: ContentAddress; } /** SSR first-paint payload for a reveal boundary. */ export interface RevealSsrPaint { readonly state: StateName; readonly cssVars: Readonly>; readonly boundaryAttr: string; } /** Map a motion property key to a CSS custom-property binding for a target. */ export declare function motionPropToBinding(target: string, key: string): string; /** * Resolve the discrete state for SSR / reduced-motion first paint. * * When `reducedMotion: 'settle'` and the user prefers reduced motion, the reveal * settles immediately to the `after` pose — no tween, no per-frame patch. */ export declare function resolveRevealInitialState(intent: RevealIntent, opts: { prefersReducedMotion: boolean; }): StateName; /** Compute SSR first-paint CSS custom properties for a reveal boundary. */ export declare function ssrRevealPaint(intent: RevealIntent, opts: { prefersReducedMotion: boolean; }): RevealSsrPaint; /** * Lower a {@link RevealIntent} into real DocumentGraph node families: * Signal → Entity → Component → Pose×2 → Transition → Policy → Projection. */ export declare function lowerRevealIntent(intent: RevealIntent): LoweredReveal; /** One authored step in a {@link RevealChainInput}: a pose→pose tween on the target. */ export interface RevealChainStep { readonly from: Readonly>; readonly to: Readonly>; readonly transition: RevealTransition; /** Dead time before this step within the sequence (rides the seq offset). */ readonly delayMs?: number; } /** One `choice` arm appended to a chain: a condition over a named signal → a step. */ export interface RevealChainBranch { readonly when: BranchCondition; readonly source: ReturnType; readonly step: RevealChainStep; } /** * Authoring input to {@link lowerRevealChain} — a REAL multi-step chain on ONE * target: a `seq` of steps, optionally followed by a `choice` (branches + an * `otherwise`). Lowers to one graph + a {@link TransitionProgram} the motion floor * drives, replacing the pre-W9 routing-label collapse (#141). */ export interface RevealChainInput { readonly target: string; readonly trigger: RevealTrigger; readonly steps: readonly RevealChainStep[]; readonly choice?: { readonly branches: readonly RevealChainBranch[]; readonly otherwise?: RevealChainStep; }; readonly policy: RevealPolicy; } /** Graph bundle + composed program produced by {@link lowerRevealChain}. */ export interface LoweredRevealChain { readonly graph: DocumentGraph; readonly program: TransitionProgram; readonly transitionIds: readonly ContentAddress[]; readonly componentId: ContentAddress; readonly signalId: ContentAddress; readonly policyId: ContentAddress; } /** * Lower a {@link RevealChainInput} into ONE DocumentGraph (one signal + component + * entity, N pose pairs + N transitions) plus a {@link TransitionProgram} composing * them: `seq` over the steps, with an optional trailing `choice`. This is the * authoring sugar for the explicit multi-transition algebra — `interpretProgram` * lowers the returned program to multi-offset keyframes + per-window sub-samplers. */ export declare function lowerRevealChain(input: RevealChainInput): LoweredRevealChain; /** Authoring sugar namespace — data over intent, no behavior authority. */ export declare const Reveal: { /** Seal a reveal intent from authoring input. */ readonly intent: (input: RevealIntentInput) => RevealIntent; /** Author a multi-step chain (`seq` + optional `choice`) → graph + {@link TransitionProgram}. */ readonly chain: typeof lowerRevealChain; }; //# sourceMappingURL=reveal.d.ts.map