chore: add internal flag to work around ts issue

This commit is contained in:
Evan You 2024-05-03 16:57:47 -07:00
parent 908f70adc0
commit 801666fdad
No known key found for this signature in database
GPG Key ID: B9D421896CA450FB
1 changed files with 13 additions and 3 deletions

View File

@ -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<Value, Modifiers, Arg>,
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<HostElement, null, Value, Modifiers, Arg>
beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
@ -82,7 +92,7 @@ export interface ObjectDirective<
>
beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
getSSRProps?: SSRDirectiveHook
getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>
deep?: boolean
}