import { type Accessor } from "solid-js"; /** * The element source accepted by {@link useAnimationsFinished}. Consumers may * pass either: * * - An accessor that returns the element (preferred — re-reading it lets the * primitive pick up late-mounted elements). * - A plain `HTMLElement | null` reference captured via `ref`. */ export type ElementSource = Accessor | HTMLElement | null; /** * Returns a function that, given a callback, waits for all CSS * animations/transitions on the target element to settle before invoking it. * * Mirrors Base UI React's `useAnimationsFinished` * (`packages/react/src/internals/useAnimationsFinished.ts`), but without * `ReactDOM.flushSync` — Solid 2 uses `flush()` for synchronous application, * and consumers that need a synchronous apply can wrap the callback * themselves. The vast majority of callers just want "run after animations", * so we invoke the callback directly. * * Options: * * - `waitForStartingStyleRemoved`: if `true`, waits for * `[data-starting-style]` to be removed from the element before probing * `getAnimations()`. This matches React's behavior for "open" animations * that aren't registered until the starting-style attribute is cleared. * - `treatAbortedAsFinished`: if `false`, when an animation is aborted the * primitive re-probes for new animations instead of treating it as * finished. * * The returned function is stabilized via {@link createStableCallback} so its * identity never changes — safe to pass through directives or capture in * long-lived subscriptions. * * Solid 2 notes: * * - Must be called from an owned scope (the internal `useAnimationFrame` * registers an `onCleanup`). * - No DOM reads happen during setup; the element is resolved lazily each * time the returned function is called, so it's safe to pass an accessor * that returns `null` on the first call. */ export declare function useAnimationsFinished(elementSource: ElementSource, waitForStartingStyleRemoved?: boolean, treatAbortedAsFinished?: boolean): (fnToExecute: () => void, signal?: AbortSignal | null) => void; //# sourceMappingURL=use-animations-finished.d.ts.map