import { UseOnAnimationEndOptions } from './useOnAnimationEnd'; export interface PresenceState { /** Whether the element should be rendered in the DOM (open, or still playing its exit animation). */ isPresent: boolean; /** Whether the element is currently playing its exit animation. */ isExiting: boolean; } export interface UsePresenceOptions extends UseOnAnimationEndOptions { } /** * Presence lifecycle for elements that must stay mounted until their exit animation finishes: * keep the element in the DOM while `isPresent` is true, e.g. `if (!isPresent) return null;`. * Timing stays entirely in CSS; built on {@link useOnAnimationEnd} (Web Animations API). * Descendant animations are awaited only with `options.subtree`. * * One optional strategy for consumer-driven presence — libraries with their own exit lifecycle * (e.g. Motion's `AnimatePresence`) own mount/unmount on top of `keepMounted` and don't need this hook. * * @param open - Semantic open state (owned by the component/consumer). * @param ref - Ref to the animated DOM element. * @param onExitComplete - Optional callback fired once after the exit animation settles. */ export declare const usePresence: (open: boolean, ref: React.RefObject, onExitComplete?: () => void, options?: UsePresenceOptions) => PresenceState;