Skip to content

Commit 1c1ff55

Browse files
Florian KrönertFlorian Krönert
Florian Krönert
authored and
Florian Krönert
committed
Added types
1 parent 708ac8c commit 1c1ff55

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "A simple and elegant checkbox tree for React.",
55
"author": "Jake Zatecky",
66
"license": "MIT",
7+
"types": "src/types/index.d.ts",
78
"keywords": [
89
"react",
910
"checkbox",

src/types/index.d.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
declare module "react-checkbox-tree"
2+
{
3+
interface Node
4+
{
5+
label: string;
6+
value: string;
7+
children?: Array<Node>;
8+
className?: string;
9+
disabled?: boolean;
10+
icon?: JSX.Element;
11+
showCheckbox?: boolean;
12+
}
13+
14+
interface CheckboxProps
15+
{
16+
nodes: Array<Node>;
17+
checked: Array<string>;
18+
expanded: Array<string>;
19+
onCheck: (checked: Array<string>) => void;
20+
onExpand: (expanded: Array<string>) => void;
21+
22+
disabled?: boolean;
23+
expandDisabled?: boolean;
24+
expandOnClick?: boolean;
25+
name?: string;
26+
nameAsArray?: boolean;
27+
nativeCheckboxes?: boolean;
28+
noCascade?: boolean;
29+
onlyLeafCheckboxes?: boolean;
30+
optimisticToggle?: boolean;
31+
showNodeIcon?: boolean;
32+
onClick?: (clicked: string) => void;
33+
}
34+
35+
export default class CheckboxTree extends React.Component<CheckboxProps> { }
36+
}

0 commit comments

Comments
 (0)