UNPKG

1.64 kBTypeScriptView Raw
1import type { CSSMotionProps } from 'rc-motion';
2import type * as React from 'react';
3export type CollapsibleType = 'header' | 'icon' | 'disabled';
4export interface ItemType extends Omit<CollapsePanelProps, 'header' | 'prefixCls' | 'panelKey' | 'isActive' | 'accordion' | 'openMotion' | 'expandIcon'> {
5 key?: CollapsePanelProps['panelKey'];
6 label?: CollapsePanelProps['header'];
7 ref?: React.RefObject<HTMLDivElement>;
8}
9export interface CollapseProps {
10 prefixCls?: string;
11 activeKey?: React.Key | React.Key[];
12 defaultActiveKey?: React.Key | React.Key[];
13 openMotion?: CSSMotionProps;
14 onChange?: (key: React.Key | React.Key[]) => void;
15 accordion?: boolean;
16 className?: string;
17 style?: object;
18 destroyInactivePanel?: boolean;
19 expandIcon?: (props: object) => React.ReactNode;
20 collapsible?: CollapsibleType;
21 children?: React.ReactNode;
22 /**
23 * Collapse items content
24 * @since 3.6.0
25 */
26 items?: ItemType[];
27}
28export interface CollapsePanelProps extends React.DOMAttributes<HTMLDivElement> {
29 id?: string;
30 header?: string | React.ReactNode;
31 prefixCls?: string;
32 headerClass?: string;
33 showArrow?: boolean;
34 className?: string;
35 style?: object;
36 isActive?: boolean;
37 openMotion?: CSSMotionProps;
38 destroyInactivePanel?: boolean;
39 accordion?: boolean;
40 forceRender?: boolean;
41 extra?: string | React.ReactNode;
42 onItemClick?: (panelKey: React.Key) => void;
43 expandIcon?: (props: object) => React.ReactNode;
44 panelKey?: React.Key;
45 role?: string;
46 collapsible?: CollapsibleType;
47 children?: React.ReactNode;
48}