UNPKG

2.03 kBTypeScriptView Raw
1import React from 'react';
2export declare type SelectSource = 'option' | 'selection' | 'input' | 'clear';
3export declare type Key = string | number;
4export declare type RawValueType = string | number;
5export interface LabelValueType {
6 key?: Key;
7 value?: RawValueType;
8 label?: React.ReactNode;
9 /** Only works on `treeCheckStrictly` */
10 halfChecked?: boolean;
11}
12export declare type DefaultValueType = RawValueType | RawValueType[] | LabelValueType | LabelValueType[];
13export interface DataNode {
14 value?: RawValueType;
15 title?: React.ReactNode;
16 label?: React.ReactNode;
17 key?: Key;
18 disabled?: boolean;
19 disableCheckbox?: boolean;
20 checkable?: boolean;
21 children?: DataNode[];
22 /** Customize data info */
23 [prop: string]: any;
24}
25export interface InnerDataNode extends DataNode {
26 key: Key;
27 value: RawValueType;
28 label?: React.ReactNode;
29 children?: InnerDataNode[];
30}
31export interface LegacyDataNode extends DataNode {
32 props: any;
33}
34export interface TreeDataNode extends DataNode {
35 key: Key;
36 children?: TreeDataNode[];
37}
38export interface FlattenDataNode {
39 data: DataNode;
40 key: Key;
41 level: number;
42}
43export interface SimpleModeConfig {
44 id?: Key;
45 pId?: Key;
46 rootPId?: Key;
47}
48/** @deprecated This is only used for legacy compatible. Not works on new code. */
49export interface LegacyCheckedNode {
50 pos: string;
51 node: React.ReactElement;
52 children?: LegacyCheckedNode[];
53}
54export interface ChangeEventExtra {
55 /** @deprecated Please save prev value by control logic instead */
56 preValue: LabelValueType[];
57 triggerValue: RawValueType;
58 /** @deprecated Use `onSelect` or `onDeselect` instead. */
59 selected?: boolean;
60 /** @deprecated Use `onSelect` or `onDeselect` instead. */
61 checked?: boolean;
62 /** @deprecated This prop not work as react node anymore. */
63 triggerNode: React.ReactElement;
64 /** @deprecated This prop not work as react node anymore. */
65 allCheckedNodes: LegacyCheckedNode[];
66}