From 801666fdade7632716474147599ac65595109fb8 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 3 May 2024 16:57:47 -0700 Subject: [PATCH] chore: add internal flag to work around ts issue --- packages/runtime-core/src/directives.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 }