UNPKG

1.75 kBTypeScriptView Raw
1import * as React from 'react';
2import type { CollapseProps as RcCollapseProps } from 'rc-collapse';
3import type { SizeType } from '../config-provider/SizeContext';
4import type { CollapsibleType } from './CollapsePanel';
5/** @deprecated Please use `start` | `end` instead */
6type ExpandIconPositionLegacy = 'left' | 'right';
7export type ExpandIconPosition = 'start' | 'end' | ExpandIconPositionLegacy | undefined;
8export interface CollapseProps extends Pick<RcCollapseProps, 'items'> {
9 activeKey?: Array<string | number> | string | number;
10 defaultActiveKey?: Array<string | number> | string | number;
11 /** 手风琴效果 */
12 accordion?: boolean;
13 destroyInactivePanel?: boolean;
14 onChange?: (key: string[]) => void;
15 style?: React.CSSProperties;
16 className?: string;
17 rootClassName?: string;
18 bordered?: boolean;
19 prefixCls?: string;
20 expandIcon?: (panelProps: PanelProps) => React.ReactNode;
21 expandIconPosition?: ExpandIconPosition;
22 ghost?: boolean;
23 size?: SizeType;
24 collapsible?: CollapsibleType;
25 /**
26 * @deprecated use `items` instead
27 */
28 children?: React.ReactNode;
29}
30interface PanelProps {
31 isActive?: boolean;
32 header?: React.ReactNode;
33 className?: string;
34 style?: React.CSSProperties;
35 showArrow?: boolean;
36 forceRender?: boolean;
37 /** @deprecated Use `collapsible="disabled"` instead */
38 disabled?: boolean;
39 extra?: React.ReactNode;
40 collapsible?: CollapsibleType;
41}
42declare const _default: React.ForwardRefExoticComponent<CollapseProps & React.RefAttributes<HTMLDivElement>> & {
43 Panel: React.ForwardRefExoticComponent<import("./CollapsePanel").CollapsePanelProps & React.RefAttributes<HTMLDivElement>>;
44};
45export default _default;