-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathindex.d.ts
More file actions
32 lines (28 loc) · 909 Bytes
/
index.d.ts
File metadata and controls
32 lines (28 loc) · 909 Bytes
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
import React from 'react'
import {ViewStyle} from 'react-native'
interface NodeAction<DataType> {
node: DataType
level: number
}
interface RenderNodeProps<DataType> extends NodeAction<DataType> {
isExpanded: boolean
hasChildrenNodes: boolean
}
interface Props<DataType> {
data: DataType[]
renderNode: React.ElementType<RenderNodeProps<DataType>>
initialExpanded: boolean
getCollapsedNodeHeight?: (args: NodeAction<DataType>) => ViewStyle['height']
idKey?: string
activeOpacityNode?: number
childrenKey?: string
onNodePress?: (
args: NodeAction<DataType>
) => void | boolean | Promise<boolean> | Promise<void>
onNodeLongPress?: (args: NodeAction<DataType>) => number
isNodeExpanded?: (args: DataType) => boolean,
shouldDisableTouchOnLeaf?: (args: NodeAction<DataType>) => boolean
}
export default class TreeView<DataType> extends React.Component<
Props<DataType>
> {}