diff --git a/packages/runtime-core/src/directives.ts b/packages/runtime-core/src/directives.ts index c6dce57c1b6..afc7d3c1d28 100644 --- a/packages/runtime-core/src/directives.ts +++ b/packages/runtime-core/src/directives.ts @@ -52,8 +52,12 @@ export type DirectiveHook< prevVNode: Prev, ) => void -export type SSRDirectiveHook = ( - binding: DirectiveBinding, +export type SSRDirectiveHook< + Value = any, + Modifiers extends string = string, + Arg extends string = string, +> = ( + binding: DirectiveBinding, vnode: VNode, ) => Data | undefined @@ -63,6 +67,12 @@ export interface ObjectDirective< Modifiers extends string = string, Arg extends string = string, > { + /** + * @internal without this, ts-expect-error in directives.test-d.ts somehow + * fails when running tsc, but passes in IDE and when testing against built + * dts. Could be a TS bug. + */ + __mod?: Modifiers created?: DirectiveHook beforeMount?: DirectiveHook mounted?: DirectiveHook @@ -82,7 +92,7 @@ export interface ObjectDirective< > beforeUnmount?: DirectiveHook unmounted?: DirectiveHook - getSSRProps?: SSRDirectiveHook + getSSRProps?: SSRDirectiveHook deep?: boolean }