@@ -20,28 +20,28 @@ import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
2020import { ComponentPublicInstance } from './componentPublicInstance'
2121
2222export 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
2626> {
2727 instance : ComponentPublicInstance | null
28- value : V
29- oldValue : V | null
28+ value : Value
29+ oldValue : Value | null
3030 arg ?: Arg
3131 modifiers : DirectiveModifiers < Modifiers >
32- dir : ObjectDirective < any , V >
32+ dir : ObjectDirective < any , Value >
3333}
3434
3535export 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
4141> = (
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 > ,
4545 prevVNode : Prev
4646) => void
4747
@@ -51,26 +51,48 @@ export type SSRDirectiveHook = (
5151) => Data | undefined
5252
5353export 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
5858> {
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 >
6678 getSSRProps ?: SSRDirectiveHook
6779}
6880
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 >
7087
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 >
7496
7597export type DirectiveModifiers < K extends string = string > = Record < K , boolean >
7698
0 commit comments