import { type ReactNode } from 'react'; import type { IUseReorderPresenceConfig, IUseReorderPresenceReturn } from './Reorder.types'; /** * Hook for managing presence animations in reorderable lists. * * Follows the pattern where elements stay in DOM until animation completes. * Consumer must keep items in their state until onAnimationComplete fires. * No "ghost" cloning — animations run on actual DOM elements. * * @param children - React children with unique keys * @param config - Presence animation configuration * @returns Presence API with presentChildren, triggerExit, and state queries * * @example * ```tsx * const [items, setItems] = useState(INITIAL_ITEMS); * * const { presentChildren, triggerExit } = useReorderPresence( * items.map(item =>