|
@@ -1,7 +1,7 @@
|
|
|
import { VNode } from '../vdom'
|
|
import { VNode } from '../vdom'
|
|
|
import { MountedComponent } from '../component'
|
|
import { MountedComponent } from '../component'
|
|
|
|
|
|
|
|
-export interface DirectiveBinding {
|
|
|
|
|
|
|
+interface DirectiveBinding {
|
|
|
instance: MountedComponent
|
|
instance: MountedComponent
|
|
|
value?: any
|
|
value?: any
|
|
|
oldValue?: any
|
|
oldValue?: any
|
|
@@ -9,14 +9,14 @@ export interface DirectiveBinding {
|
|
|
modifiers?: DirectiveModifiers
|
|
modifiers?: DirectiveModifiers
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export type DirectiveHook = (
|
|
|
|
|
|
|
+type DirectiveHook = (
|
|
|
el: any,
|
|
el: any,
|
|
|
binding: DirectiveBinding,
|
|
binding: DirectiveBinding,
|
|
|
vnode: VNode,
|
|
vnode: VNode,
|
|
|
prevVNode: VNode | void
|
|
prevVNode: VNode | void
|
|
|
) => void
|
|
) => void
|
|
|
|
|
|
|
|
-export interface Directive {
|
|
|
|
|
|
|
+interface Directive {
|
|
|
beforeMount: DirectiveHook
|
|
beforeMount: DirectiveHook
|
|
|
mounted: DirectiveHook
|
|
mounted: DirectiveHook
|
|
|
beforeUpdate: DirectiveHook
|
|
beforeUpdate: DirectiveHook
|
|
@@ -25,7 +25,7 @@ export interface Directive {
|
|
|
unmounted: DirectiveHook
|
|
unmounted: DirectiveHook
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export type DirectiveModifiers = Record<string, boolean>
|
|
|
|
|
|
|
+type DirectiveModifiers = Record<string, boolean>
|
|
|
|
|
|
|
|
const valueCache = new WeakMap<Directive, WeakMap<any, any>>()
|
|
const valueCache = new WeakMap<Directive, WeakMap<any, any>>()
|
|
|
|
|
|