@@ -19,34 +19,34 @@ type ReplaceFieldTypes<TSource, TReplacement> = {
1919 [ P in keyof TSource ] : P extends keyof TReplacement ? TReplacement [ P ] : TSource [ P ] ;
2020}
2121
22- type ITreeViewOptionsNarrowedEvents < TKey = any > = {
23- onContentReady ?: ( ( e : ContentReadyEvent < TKey > ) => void ) ;
24- onDisposing ?: ( ( e : DisposingEvent < TKey > ) => void ) ;
25- onInitialized ?: ( ( e : InitializedEvent < TKey > ) => void ) ;
26- onItemClick ?: ( ( e : ItemClickEvent < TKey > ) => void ) ;
27- onItemCollapsed ?: ( ( e : ItemCollapsedEvent < TKey > ) => void ) ;
28- onItemContextMenu ?: ( ( e : ItemContextMenuEvent < TKey > ) => void ) ;
29- onItemExpanded ?: ( ( e : ItemExpandedEvent < TKey > ) => void ) ;
30- onItemHold ?: ( ( e : ItemHoldEvent < TKey > ) => void ) ;
31- onItemRendered ?: ( ( e : ItemRenderedEvent < TKey > ) => void ) ;
32- onSelectAllValueChanged ?: ( ( e : SelectAllValueChangedEvent < TKey > ) => void ) ;
22+ type ITreeViewOptionsNarrowedEvents < TItem = any , TKey = any > = {
23+ onContentReady ?: ( ( e : ContentReadyEvent < TItem , TKey > ) => void ) ;
24+ onDisposing ?: ( ( e : DisposingEvent < TItem , TKey > ) => void ) ;
25+ onInitialized ?: ( ( e : InitializedEvent < TItem , TKey > ) => void ) ;
26+ onItemClick ?: ( ( e : ItemClickEvent < TItem , TKey > ) => void ) ;
27+ onItemCollapsed ?: ( ( e : ItemCollapsedEvent < TItem , TKey > ) => void ) ;
28+ onItemContextMenu ?: ( ( e : ItemContextMenuEvent < TItem , TKey > ) => void ) ;
29+ onItemExpanded ?: ( ( e : ItemExpandedEvent < TItem , TKey > ) => void ) ;
30+ onItemHold ?: ( ( e : ItemHoldEvent < TItem , TKey > ) => void ) ;
31+ onItemRendered ?: ( ( e : ItemRenderedEvent < TItem , TKey > ) => void ) ;
32+ onSelectAllValueChanged ?: ( ( e : SelectAllValueChangedEvent < TItem , TKey > ) => void ) ;
3333}
3434
35- type ITreeViewOptions < TKey = any > = React . PropsWithChildren < ReplaceFieldTypes < Properties < TKey > , ITreeViewOptionsNarrowedEvents < TKey > > & IHtmlOptions & {
36- dataSource ?: Properties < TKey > [ "dataSource" ] ;
35+ type ITreeViewOptions < TItem = any , TKey = any > = React . PropsWithChildren < ReplaceFieldTypes < Properties < TItem , TKey > , ITreeViewOptionsNarrowedEvents < TItem , TKey > > & IHtmlOptions & {
36+ dataSource ?: Properties < TItem , TKey > [ "dataSource" ] ;
3737 itemRender ?: ( ...params : any ) => React . ReactNode ;
3838 itemComponent ?: React . ComponentType < any > ;
3939 defaultItems ?: Array < dxTreeViewItem > ;
4040 onItemsChange ?: ( value : Array < dxTreeViewItem > ) => void ;
4141} >
4242
43- interface TreeViewRef < TKey = any > {
44- instance : ( ) => dxTreeView < TKey > ;
43+ interface TreeViewRef < TItem = any , TKey = any > {
44+ instance : ( ) => dxTreeView < TItem , TKey > ;
4545}
4646
4747const TreeView = memo (
4848 forwardRef (
49- < TKey = any > ( props : React . PropsWithChildren < ITreeViewOptions < TKey > > , ref : ForwardedRef < TreeViewRef < TKey > > ) => {
49+ < TItem = any , TKey = any > ( props : React . PropsWithChildren < ITreeViewOptions < TItem , TKey > > , ref : ForwardedRef < TreeViewRef < TItem , TKey > > ) => {
5050 const baseRef = useRef < ComponentRef > ( null ) ;
5151
5252 useImperativeHandle ( ref , ( ) => (
@@ -78,7 +78,7 @@ const TreeView = memo(
7878 ] ) , [ ] ) ;
7979
8080 return (
81- React . createElement ( BaseComponent < React . PropsWithChildren < ITreeViewOptions < TKey > > > , {
81+ React . createElement ( BaseComponent < React . PropsWithChildren < ITreeViewOptions < TItem , TKey > > > , {
8282 WidgetClass : dxTreeView ,
8383 ref : baseRef ,
8484 subscribableOptions,
@@ -91,7 +91,7 @@ const TreeView = memo(
9191 ) ;
9292 } ,
9393 ) ,
94- ) as < TKey = any > ( props : React . PropsWithChildren < ITreeViewOptions < TKey > > & { ref ?: Ref < TreeViewRef < TKey > > } ) => ReactElement | null ;
94+ ) as < TItem = any , TKey = any > ( props : React . PropsWithChildren < ITreeViewOptions < TItem , TKey > > & { ref ?: Ref < TreeViewRef < TItem , TKey > > } ) => ReactElement | null ;
9595
9696
9797// owners:
0 commit comments