Skip to content

Commit cc88ad3

Browse files
Updating Typing for the new method "addChildren" (#461)
Co-authored-by: Ben Kremer <[email protected]>
1 parent 8d7c9b1 commit cc88ad3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/types/common.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type PathFunction = (link: TreeLinkDatum, orientation: Orientation) => st
3333
export type PathClassFunction = PathFunction;
3434

3535
export type SyntheticEventHandler = (evt: SyntheticEvent) => void;
36+
export type AddChildren = (children: RawNodeDatum[]) => void;
3637

3738
/**
3839
* The properties that are passed to the user-defined `renderCustomNodeElement` render function.
@@ -66,6 +67,10 @@ export interface CustomNodeElementProps {
6667
* The `onNodeMouseOut` handler defined for `Tree` (if any).
6768
*/
6869
onNodeMouseOut: SyntheticEventHandler;
70+
/**
71+
* The `Node` class's internal `addChildren` handler.
72+
*/
73+
addChildren: AddChildren;
6974
}
7075

7176
export type RenderCustomNodeElementFn = (rd3tNodeProps: CustomNodeElementProps) => JSX.Element;

0 commit comments

Comments
 (0)