Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 801666f

Browse files
committed
chore: add internal flag to work around ts issue
1 parent 908f70a commit 801666f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

packages/runtime-core/src/directives.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ export type DirectiveHook<
5252
prevVNode: Prev,
5353
) => void
5454

55-
export type SSRDirectiveHook = (
56-
binding: DirectiveBinding,
55+
export type SSRDirectiveHook<
56+
Value = any,
57+
Modifiers extends string = string,
58+
Arg extends string = string,
59+
> = (
60+
binding: DirectiveBinding<Value, Modifiers, Arg>,
5761
vnode: VNode,
5862
) => Data | undefined
5963

@@ -63,6 +67,12 @@ export interface ObjectDirective<
6367
Modifiers extends string = string,
6468
Arg extends string = string,
6569
> {
70+
/**
71+
* @internal without this, ts-expect-error in directives.test-d.ts somehow
72+
* fails when running tsc, but passes in IDE and when testing against built
73+
* dts. Could be a TS bug.
74+
*/
75+
__mod?: Modifiers
6676
created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
6777
beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
6878
mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
@@ -82,7 +92,7 @@ export interface ObjectDirective<
8292
>
8393
beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
8494
unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>
85-
getSSRProps?: SSRDirectiveHook
95+
getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>
8696
deep?: boolean
8797
}
8898

0 commit comments

Comments
 (0)