-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.d.ts
35 lines (29 loc) · 818 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Component, ReactElement } from 'react';
import { StyleProp, TextStyle } from 'react-native';
export type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
export interface TreeItem {
id: string;
name: string;
parentId: string;
children?: TreeItem[];
}
export interface LeafClickProps {
item: TreeItem;
routes: Omit<TreeItem, 'children'>;
}
export interface TreeSelectProps {
data: TreeItem[];
onClick?: () => void;
onClickLeaf?: (p: LeafClickProps) => void;
isOpen?: boolean;
openIds?: TreeItem['id'][];
isShowTreeId?: boolean;
itemStyle?: StyleProp<TextStyle>;
selectedItemStyle?: StyleProp<TextStyle>;
treeNodeStyle?: {
openIcon?: ReactElement;
closeIcon?: ReactElement;
};
}
declare class TreeSelect extends Component<TreeSelectProps, {}> {}
export default TreeSelect;