@@ -20,28 +20,28 @@ import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
20
20
import { ComponentPublicInstance } from './componentPublicInstance'
21
21
22
22
export interface DirectiveBinding <
23
- V = any ,
24
- Arg extends string = string ,
25
- Modifiers extends string = string
23
+ Value = any ,
24
+ Modifiers extends string = string ,
25
+ Arg extends string = string
26
26
> {
27
27
instance : ComponentPublicInstance | null
28
- value : V
29
- oldValue : V | null
28
+ value : Value
29
+ oldValue : Value | null
30
30
arg ?: Arg
31
31
modifiers : DirectiveModifiers < Modifiers >
32
- dir : ObjectDirective < any , V >
32
+ dir : ObjectDirective < any , Value >
33
33
}
34
34
35
35
export type DirectiveHook <
36
- T = any ,
37
- Prev = VNode < any , T > | null ,
38
- V = any ,
39
- Arg extends string = string ,
40
- Modifiers extends string = string
36
+ HostElement = any ,
37
+ Prev = VNode < any , HostElement > | null ,
38
+ Value = any ,
39
+ Modifiers extends string = string ,
40
+ Arg extends string = string
41
41
> = (
42
- el : T ,
43
- binding : DirectiveBinding < V , Arg , Modifiers > ,
44
- vnode : VNode < any , T > ,
42
+ el : HostElement ,
43
+ binding : DirectiveBinding < Value , Arg , Modifiers > ,
44
+ vnode : VNode < any , HostElement > ,
45
45
prevVNode : Prev
46
46
) => void
47
47
@@ -51,26 +51,48 @@ export type SSRDirectiveHook = (
51
51
) => Data | undefined
52
52
53
53
export interface ObjectDirective <
54
- T = any ,
55
- V = any ,
56
- Arg extends string = string ,
57
- Modifiers extends string = string
54
+ HostElement = any ,
55
+ Value = any ,
56
+ Modifiers extends string = string ,
57
+ Arg extends string = string
58
58
> {
59
- created ?: DirectiveHook < T , null , V , Arg , Modifiers >
60
- beforeMount ?: DirectiveHook < T , null , V , Arg , Modifiers >
61
- mounted ?: DirectiveHook < T , null , V , Arg , Modifiers >
62
- beforeUpdate ?: DirectiveHook < T , VNode < any , T > , V , Arg , Modifiers >
63
- updated ?: DirectiveHook < T , VNode < any , T > , V , Arg , Modifiers >
64
- beforeUnmount ?: DirectiveHook < T , null , V , Arg , Modifiers >
65
- unmounted ?: DirectiveHook < T , null , V , Arg , Modifiers >
59
+ created ?: DirectiveHook < HostElement , null , Value , Arg , Modifiers >
60
+ beforeMount ?: DirectiveHook < HostElement , null , Value , Arg , Modifiers >
61
+ mounted ?: DirectiveHook < HostElement , null , Value , Arg , Modifiers >
62
+ beforeUpdate ?: DirectiveHook <
63
+ HostElement ,
64
+ VNode < any , HostElement > ,
65
+ Value ,
66
+ Arg ,
67
+ Modifiers
68
+ >
69
+ updated ?: DirectiveHook <
70
+ HostElement ,
71
+ VNode < any , HostElement > ,
72
+ Value ,
73
+ Arg ,
74
+ Modifiers
75
+ >
76
+ beforeUnmount ?: DirectiveHook < HostElement , null , Value , Arg , Modifiers >
77
+ unmounted ?: DirectiveHook < HostElement , null , Value , Arg , Modifiers >
66
78
getSSRProps ?: SSRDirectiveHook
67
79
}
68
80
69
- export type FunctionDirective < T = any , V = any > = DirectiveHook < T , any , V >
81
+ export type FunctionDirective <
82
+ HostElement = any ,
83
+ V = any ,
84
+ Modifiers extends string = string ,
85
+ Arg extends string = string
86
+ > = DirectiveHook < HostElement , any , V , Arg , Modifiers >
70
87
71
- export type Directive < T = any , V = any > =
72
- | ObjectDirective < T , V >
73
- | FunctionDirective < T , V >
88
+ export type Directive <
89
+ HostElement = any ,
90
+ Value = any ,
91
+ Modifiers extends string = string ,
92
+ Arg extends string = string
93
+ > =
94
+ | ObjectDirective < HostElement , Value , Arg , Modifiers >
95
+ | FunctionDirective < HostElement , Value , Arg , Modifiers >
74
96
75
97
export type DirectiveModifiers < K extends string = string > = Record < K , boolean >
76
98
0 commit comments