1
- import { defineComponent , inject , VNode , PropType } from 'vue' ;
1
+ import { defineComponent , inject , VNode , PropType , CSSProperties } from 'vue' ;
2
2
import classNames from '../_util/classNames' ;
3
3
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined' ;
4
4
import FileOutlined from '@ant-design/icons-vue/FileOutlined' ;
@@ -24,22 +24,22 @@ export interface TreeDataItem {
24
24
disableCheckbox ?: boolean ;
25
25
disabled ?: boolean ;
26
26
class ?: string ;
27
- style ?: any ;
27
+ style ?: CSSProperties ;
28
28
checkable ?: boolean ;
29
- icon ?: any ;
30
- slots ?: any ;
31
- switcherIcon ?: any ;
29
+ icon ?: VNode ;
30
+ slots ?: Record < string , string > ;
31
+ switcherIcon ?: VNode ;
32
32
}
33
33
34
34
interface DefaultEvent {
35
35
nativeEvent : MouseEvent ;
36
- node : any ;
36
+ node : Record < string , any > ;
37
37
}
38
38
39
39
export interface CheckEvent extends DefaultEvent {
40
40
checked : boolean ;
41
- checkedNodes : VNode [ ] ;
42
- checkedNodesPositions : { node : VNode ; pos : string | number } [ ] ;
41
+ checkedNodes : Array < Record < string , any > > ;
42
+ checkedNodesPositions : { node : Record < string , any > ; pos : string | number } [ ] ;
43
43
event : string ;
44
44
halfCheckedKeys : ( string | number ) [ ] ;
45
45
}
@@ -51,7 +51,22 @@ export interface ExpendEvent extends DefaultEvent {
51
51
export interface SelectEvent extends DefaultEvent {
52
52
event : string ;
53
53
selected : boolean ;
54
- selectedNodes : VNode [ ] ;
54
+ selectedNodes : Array < Record < string , any > > ;
55
+ }
56
+
57
+ export interface TreeDragEvent {
58
+ event : DragEvent ;
59
+ expandedKeys : ( string | number ) [ ] ;
60
+ node : Record < string , any > ;
61
+ }
62
+
63
+ export interface DropEvent {
64
+ dragNode : Record < string , any > ;
65
+ dragNodesKeys : ( string | number ) [ ] ;
66
+ dropPosition : number ;
67
+ dropToGap : boolean ;
68
+ event : DragEvent ;
69
+ node : Record < string , any > ;
55
70
}
56
71
57
72
function TreeProps ( ) {
@@ -263,7 +278,7 @@ export default defineComponent({
263
278
onCheck : this . handleCheck ,
264
279
onExpand : this . handleExpand ,
265
280
onSelect : this . handleSelect ,
266
- } as any ;
281
+ } as Record < string , any > ;
267
282
if ( treeData ) {
268
283
vcTreeProps . treeData = treeData ;
269
284
}
0 commit comments