Skip to content

Commit 041f91d

Browse files
committed
Add missing onExpand argument in TypeScript definitions
Resolves #248.
1 parent f75d5cd commit 041f91d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Bug Fixes
1212

1313
* [#208]: Add missing `onCheck` argument in TypeScript definition
14+
* [#248]: Add missing `onExpand` argument in TypeScript definition
1415

1516
## [v1.6.0](https://github.com/jakezatecky/react-checkbox-tree/compare/v1.5.0...v1.6.0) (2019-12-11)
1617

src/index.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ declare module "react-checkbox-tree" {
1313
}
1414

1515
interface OnCheckNode extends Node {
16-
checked: boolean;
16+
checked: boolean;
17+
}
18+
19+
interface OnExpandNode extends Node {
20+
expanded: boolean;
1721
}
1822

1923
interface Icons {
@@ -59,8 +63,8 @@ declare module "react-checkbox-tree" {
5963
showNodeIcon?: boolean;
6064
showNodeTitles?: boolean;
6165
onCheck?: (checked: Array<string>, node: OnCheckNode) => void;
62-
onClick?: (event: { checked: boolean, value: any }) => void;
63-
onExpand?: (expanded: Array<string>) => void;
66+
onClick?: (node: OnCheckNode) => void;
67+
onExpand?: (expanded: Array<string>, node: OnExpandNode) => void;
6468
}
6569

6670
export default class CheckboxTree extends React.Component<CheckboxProps> {}

0 commit comments

Comments
 (0)