/** * The **Toast Animation Manager** — centralizes enter/exit transitions so the * component and container never hand-roll animation logic, and so * `prefers-reduced-motion` is honored in exactly one place. * * It is purely class-toggle + transition-end driven (no keyframe injection, no * layout thrash): the actual motion lives in themeable CSS * (`toast.css.ts`). Each method resolves once the transition ends, with a * safety timeout so a missed `transitionend` (e.g. a display-swapped element) * never leaves a dangling promise. * * @packageDocumentation */ import { ToastAnimation } from './toast.types'; /** Drives themeable enter/exit transitions for toast elements. */ export declare class ToastAnimationManager { private animation; private respectReducedMotion; /** * @param animation - The animation style class applied to elements. * @param respectReducedMotion - When `true`, animations are skipped if the OS * requests reduced motion. */ constructor(animation: ToastAnimation, respectReducedMotion: boolean); /** Updates the active animation style. */ setAnimation(animation: ToastAnimation): void; /** Updates the reduced-motion policy. */ setRespectReducedMotion(value: boolean): void; /** The base animation class an element carries for its whole lifetime. */ animationClass(): string; /** @returns `true` when motion should be suppressed for accessibility. */ private reducedMotion; /** * Plays the enter transition: the element starts in its `--enter` state and * transitions to its resting state on the next frame. * * @param el - The toast root element (already inserted into the DOM). * @returns Resolves when the enter transition completes. */ enter(el: HTMLElement): Promise; /** * Plays the exit transition: the element transitions to its `--exit` state. * * @param el - The toast root element. * @returns Resolves when the exit transition completes (element ready to remove). */ exit(el: HTMLElement): Promise; /** Resolves on the next animation frame (or immediately outside the DOM). */ private nextFrame; /** Resolves on the element's next `transitionend`, or after a fallback timeout. */ private awaitTransition; } //# sourceMappingURL=toast-animation-manager.d.ts.map