@@ -16,11 +16,12 @@ export type NavigationTreeNodeType =
1616 | 'transfer'
1717 | 'view' ;
1818
19- export interface NavigationTreeDataItem {
19+ export interface NavigationTreeDataItem < M = unknown > {
2020 name : string ;
2121 type : NavigationTreeNodeType ;
2222 /** determined by type by default */
2323 expandable ?: boolean ;
24+ meta ?: M ;
2425}
2526
2627export interface NavigationTreeState {
@@ -39,6 +40,7 @@ export interface NavigationTreeNodeState {
3940 error : boolean ;
4041 children : string [ ] ;
4142 level ?: number ;
43+ meta ?: unknown ;
4244}
4345
4446export interface NavigationTreeServiceNode {
@@ -52,18 +54,23 @@ export type NavigationTreeNodePartialState = Omit<
5254 'loading' | 'loaded' | 'error' | 'children'
5355> ;
5456
55- export interface NavigationTreeProps < D = any > {
57+ export interface NavigationTreeProps < D = any , M = any > {
5658 rootState : NavigationTreeNodePartialState ;
57- fetchPath : ( path : string ) => Promise < NavigationTreeDataItem [ ] > ;
59+ fetchPath : ( path : string ) => Promise < NavigationTreeDataItem < M > [ ] > ;
5860 onActionsOpenToggle ?: ( args : {
5961 path : string ;
6062 type : NavigationTreeNodeType ;
6163 isOpen : boolean ;
6264 } ) => void ;
63- getActions ?: ( path : string , type : NavigationTreeNodeType ) => DropdownMenuItemMixed < D > [ ] ;
65+ getActions ?: (
66+ path : string ,
67+ type : NavigationTreeNodeType ,
68+ meta : M ,
69+ ) => DropdownMenuItemMixed < D > [ ] ;
6470 renderAdditionalNodeElements ?: (
6571 path : string ,
6672 type : NavigationTreeNodeType ,
73+ meta : M ,
6774 ) => JSX . Element | undefined ;
6875 activePath ?: string ;
6976 onActivePathUpdate ?: ( activePath : string ) => void ;
0 commit comments