///
export interface UseCollapseAnimationOptions {
/**
* 是否展开
*/
isOpen: boolean;
/**
* 动画时长(毫秒)
* @default 240
*/
duration?: number;
/**
* 是否禁用动画
* @default false
*/
disabled?: boolean;
/**
* 过渡函数
* @default 'cubic-bezier(.2,0,0,1)'
*/
timingFunction?: string;
/**
* 父元素的 open class 名称
* 用于在获取 scrollHeight 时临时添加,确保用户依赖此 class 的样式生效
*/
parentOpenClassName?: string;
}
export interface UseCollapseAnimationResult {
/**
* 是否应该隐藏元素(动画结束后且 isOpen 为 false 时返回 true)
*/
shouldHide: boolean;
/**
* 是否应该保持 open 状态(动画进行中时返回 true)
*/
shouldKeepOpen: boolean;
}
/**
* 为元素添加折叠/展开动画的 Hook
*
* @example
* ```tsx
* const ref = useRef(null);
* const { shouldHide, shouldKeepOpen } = useCollapseAnimation(ref, { isOpen: true });
*
* return Content
;
* ```
* @returns 动画状态对象
*/
export declare function useCollapseAnimation(elementRef: React.RefObject, options: UseCollapseAnimationOptions): UseCollapseAnimationResult;
//# sourceMappingURL=use-collapse-animation.d.ts.map