/** * Web Animations helpers. * * @module bquery/motion */ import type { AnimateOptions } from './types'; type KeyframeBoundary = 'first' | 'last'; /** @internal */ export declare const applyKeyframeStyles: (element: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes, boundary?: KeyframeBoundary) => void; /** @internal */ export declare const applyFinalKeyframeStyles: (element: Element, keyframes: Keyframe[] | PropertyIndexedKeyframes) => void; /** * Animate an element using the Web Animations API with reduced-motion fallback. * * Supports cancellation via `AbortSignal` and an override `playbackRate`. * * @param element - Element to animate * @param config - Animation configuration * @returns Promise that resolves when animation completes * * @example * ```ts * await animate(element, { * keyframes: [{ opacity: 0 }, { opacity: 1 }], * options: { duration: 200, easing: 'ease-out' }, * }); * * // Cancellable: * const ctrl = new AbortController(); * animate(element, { keyframes: [...], signal: ctrl.signal }); * ctrl.abort(); * ``` */ export declare const animate: (element: Element, config: AnimateOptions) => Promise; /** * CSS property record accepted by {@link animateTo}. * * Keys are camelCase or kebab-case CSS property names; values are * either single CSS values (interpreted as the destination state) or * `[from, to]` tuples for explicit two-keyframe ranges. */ export type AnimateToStyles = Record; /** * Options for {@link animateTo}. */ export interface AnimateToOptions extends Omit, Omit { /** Optional override keyframe options merged with the top-level ones. */ options?: Omit; } /** * Animate an element to a target set of CSS properties. * * Build keyframes from a property record without manually authoring a * `Keyframe[]` array. Single values become destination-only keyframes; * `[from, to]` tuples become explicit start/end keyframes. * * @example * ```ts * await animateTo(card, { opacity: 1, transform: 'translateY(0)' }, { * duration: 320, * easing: 'ease-out', * }); * * // Explicit start/end: * await animateTo(card, { opacity: [0, 1] }, { duration: 200 }); * ``` */ export declare const animateTo: (element: Element, styles: AnimateToStyles, options?: AnimateToOptions) => Promise; export {}; //# sourceMappingURL=animate.d.ts.map