diff --git a/types/options.d.ts b/types/options.d.ts index 25eb8a0fdf3..8ae8f93599c 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -160,9 +160,13 @@ export interface WatchOptionsWithHandler extends WatchOptions { handler: WatchHandler; } +export interface DirectiveBinding extends Readonly { + readonly modifiers: { [key: string]: boolean }; +} + export type DirectiveFunction = ( el: HTMLElement, - binding: VNodeDirective, + binding: DirectiveBinding, vnode: VNode, oldVnode: VNode ) => void; diff --git a/types/test/options-test.ts b/types/test/options-test.ts index 17a54fd360b..83972d05c1d 100644 --- a/types/test/options-test.ts +++ b/types/test/options-test.ts @@ -154,6 +154,10 @@ Vue.component('component', { props: { myProp: "bar" }, + directives: [{ + name: 'a', + value: 'foo' + }], domProps: { innerHTML: "baz" }, diff --git a/types/vnode.d.ts b/types/vnode.d.ts index 5754c433dcd..9247c474575 100644 --- a/types/vnode.d.ts +++ b/types/vnode.d.ts @@ -58,10 +58,10 @@ export interface VNodeData { } export interface VNodeDirective { - readonly name: string; - readonly value: any; - readonly oldValue: any; - readonly expression: any; - readonly arg: string; - readonly modifiers: { [key: string]: boolean }; + name: string; + value?: any; + oldValue?: any; + expression?: any; + arg?: string; + modifiers?: { [key: string]: boolean }; }