UNPKG

@ant-design/x

Version:

Craft AI-driven interfaces effortlessly

29 lines (28 loc) 918 B
import type { CSSMotionProps } from '@rc-component/motion'; export type CollapsibleOptions = { /** * @desc 初始化展开的节点 * @descEN default expanded keys */ defaultExpandedKeys?: string[]; /** * @desc 当前展开的节点 * @descEN current expanded keys */ expandedKeys?: string[]; /** * @desc 展开节点变化回调 * @descEN callback when expanded keys change */ onExpand?: (expandedKeys: string[]) => void; }; export type Collapsible = boolean | CollapsibleOptions; type RequiredCollapsibleOptions = Required<CollapsibleOptions>; type UseCollapsible = (collapsible?: Collapsible, prefixCls?: string, rootPrefixCls?: string) => [ boolean, RequiredCollapsibleOptions['expandedKeys'], ((curKey: string) => void) | undefined, CSSMotionProps ]; declare const useCollapsible: UseCollapsible; export default useCollapsible;