import { RefObject } from 'react'; import { MorphTransitionConfig, UseLayoutMorphReturn } from '../types'; /** * Options for useLayoutMorph hook. */ export interface UseLayoutMorphOptions { /** Morph transition configuration */ config?: Partial; /** Callback when morph starts */ onMorphStart?: () => void; /** Callback when morph completes */ onMorphComplete?: () => void; /** Callback when morph is interrupted */ onMorphInterrupt?: () => void; } /** * Hook for controlling FLIP-based morph transitions. * * @param options - Hook configuration options * @returns Morph transition controls * * @example * ```tsx * function MorphingLayout() { * const { * morph, * cancel, * progress, * isTransitioning, * registerElement, * snapshot * } = useLayoutMorph({ * config: { duration: 300, easing: 'ease-out' }, * onMorphComplete: () => console.log('Morph complete!') * }); * * const handleLayoutChange = async () => { * snapshot(); // Capture current state * // Make layout changes... * await morph({ mode: 'list' }); * }; * * return ( *
* * {isTransitioning &&

Progress: {(progress * 100).toFixed(0)}%

} *
* ); * } * ``` */ export declare function useLayoutMorph(options?: UseLayoutMorphOptions): UseLayoutMorphReturn; /** * Hook for automatically registering an element with the morph system. * * @param morphHook - The morph hook return value * @param id - Unique ID for the element * @returns Ref to attach to the element * * @example * ```tsx * function MorphableCard({ id, morphHook }: { id: string; morphHook: UseLayoutMorphReturn }) { * const ref = useMorphElement(morphHook, id); * * return
Content
; * } * ``` */ export declare function useMorphElement(morphHook: Pick, id: string): RefObject; export type { UseLayoutMorphReturn };