Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9bcfac2

Browse files
authored
feat(volar/jsx-directive): support infer type from setup (#982)
1 parent294b207 commit9bcfac2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

‎packages/volar/src/jsx-directive/context.ts‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@ declare function __VLS_getFunctionalComponentCtx<T, K, const S>(
4141
s: S,
4242
): S extends keyof typeof __VLS_nativeElements
4343
? { expose: (exposed: (typeof __VLS_nativeElements)[S]) => any }
44-
: '__ctx' extends keyof __VLS_PickNotAny<K, {}>
45-
? K extends { __ctx?: infer Ctx }
46-
? Ctx
47-
: never
48-
: T extends (props: infer P, ctx: infer Ctx) => any
49-
? { props: P } & Ctx
50-
: {};\n`)
44+
: T extends { setup: (props: infer P, ctx: infer Ctx) => any } ? { props: P } & Ctx :
45+
'__ctx' extends keyof __VLS_PickNotAny<K, {}>
46+
? K extends { __ctx?: infer Ctx } ? Ctx : never
47+
: T extends (props: infer P, ctx: infer Ctx) => any ? { props: P } & Ctx
48+
: {};\n`)
5149
}
5250

5351
returnnewMap(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp