/** * The phase timing behind an animated menu screen: closed → entering → open → exiting → closed. Pure * timing over an injected clock, so a React block can animate with CSS and still know exactly when an * exit finished and the screen may unmount. Reduced motion collapses every duration to zero instead * of skipping the state machine, so callers never branch on it. */ /** Where a menu screen is in its enter/exit animation. */ export type MenuTransitionPhase = "closed" | "enter" | "open" | "exit"; /** Durations and accessibility policy for one transition. */ export interface MenuTransitionConfig { /** Enter duration, ms. Default 220. */ enterMs?: number; /** Exit duration, ms. Default 160. */ exitMs?: number; /** Collapse both durations to zero (the accessibility "reduced motion" preference). */ reducedMotion?: boolean; } /** Serializable phase state. */ export interface MenuTransitionSnapshot { phase: MenuTransitionPhase; /** Clock time (ms) the phase started. */ since: number; } /** Observable enter/exit phase machine. */ export interface MenuTransition { state(): MenuTransitionSnapshot; /** Begin entering from closed/exit, or go straight to open when motion is off. No-op when entering/open. */ open(now: number): void; /** Begin exiting from entering/open. No-op when already exiting/closed. */ close(now: number): void; /** Advance the machine to `now`; entering → open and exiting → closed happen here. */ tick(now: number): MenuTransitionSnapshot; subscribe(listener: () => void): () => void; snapshot(): MenuTransitionSnapshot; restore(snapshot: MenuTransitionSnapshot): void; } /** The enter and exit durations after reduced-motion is applied. */ export declare function menuTransitionDurations(config?: MenuTransitionConfig): { enter: number; exit: number; }; /** How long the current phase lasts, in ms (0 for open/closed). */ export declare function menuTransitionPhaseMs(phase: MenuTransitionPhase, config?: MenuTransitionConfig): number; /** * Create a {@link MenuTransition}. `open`/`close` start a phase; `tick` advances it once its duration * has elapsed. Nothing schedules timers here — the caller ticks from its animation loop or a timeout. * * @capability menu-transition enter/exit phase timing for an animated menu screen, with reduced-motion collapse and snapshot/restore */ export declare function createMenuTransition(config?: MenuTransitionConfig, initial?: MenuTransitionSnapshot): MenuTransition;