diff --git a/types/options.d.ts b/types/options.d.ts index cc58affe6a..d0e7adac38 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 6fc9e35645..7df3250c1a 100644 --- a/types/test/options-test.ts +++ b/types/test/options-test.ts @@ -142,6 +142,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 5754c433dc..9247c47457 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 }; }