/** * Possible states for open/close transitions */ export type OpenCloseTransitionStates = "opening" | "open" | "closing" | "closed"; /** * Effects configuration for open/close transition states * @property {() => void} [onOpenAnimationStart] - Callback when opening animation starts * @property {() => void} [onCloseAnimationStart] - Callback when closing animation starts * @property {() => void} [onOpenAnimationComplete] - Callback when opening animation completes * @property {() => void} [onCloseAnimationComplete] - Callback when closing animation completes * @property {number | (() => number)} [durationMs] - Duration of the animation in milliseconds (or a function that returns the duration) */ export type OpenCloseTransitionStateEffects = { /** * Callback when opening animation starts */ onOpenAnimationStart?: () => void; /** * Callback when closing animation starts */ onCloseAnimationStart?: () => void; /** * Callback when opening animation completes */ onOpenAnimationComplete?: () => void; /** * Callback when closing animation completes */ onCloseAnimationComplete?: () => void; }; export type OpenCloseTransitionState = { state: OpenCloseTransitionStates; beginClosing: () => void; isOpenOrOpening: boolean; isClosedOrClosing: boolean; }; export type OpenCloseTransitionStateOptions = { durationMs: number | (() => number); onOpenAnimationStart?: () => void; onCloseAnimationStart?: () => void; onOpenAnimationComplete?: () => void; onCloseAnimationComplete?: () => void; }; /** * Custom hook for managing open/close transition states and animations. * * @param openProp - The open prop controlling visibility * @param options - Additional, optional options including callbacks for animation start, complete, and initialization * @returns Object containing state, control functions, and utility flags */ export declare const useOpenCloseTransitionStates: (openProp: boolean | undefined, options?: OpenCloseTransitionStateOptions) => OpenCloseTransitionState;