/** Where a surface is in its life: arriving, at rest, or on its way out. */ export type PresencePhase = 'entering' | 'present' | 'leaving'; export interface UsePresenceTransitionOptions { /** * Fallback exit length in milliseconds, used when the element does not * resolve an `--animation-duration` token. Default 200 (`--duration-normal`). */ durationMs?: number; /** * Force the reduced-motion branch. Defaults to reading * `prefers-reduced-motion: reduce`. When reduced, the surface mounts and * unmounts synchronously and is never reported as entering or leaving. */ reduceMotion?: boolean; /** Fires once the exit has played and the surface has unmounted. */ onExited?: () => void; } export interface UsePresenceTransitionReturn { /** Render the surface while this is true, including the whole exit. */ mounted: boolean; /** Reflect onto the surface (e.g. `data-presence`) and paint it in CSS. */ phase: PresencePhase; /** * Attach to the surface. The hook reads the element's resolved * `--animation-duration`, so the accessible theme's 0ms ends the exit at once. */ ref: (node: T | null) => void; } /** * Keeps a surface mounted long enough to animate out, and gives it one frame * of `entering` so it has somewhere to animate in from. * * A panel that mounts and unmounts on a boolean cannot transition: there is * no element left to fade when it closes, and none yet painted when it opens. * This hook sits between the boolean and the render. The hook owns timing * only; paint the phases in CSS, keyed off `phase`, against the * `--animation-duration` token. */ export declare function usePresenceTransition(present: boolean, { durationMs, reduceMotion, onExited, }?: UsePresenceTransitionOptions): UsePresenceTransitionReturn; //# sourceMappingURL=use-presence-transition.d.ts.map