diff --git a/packages/language-core/lib/codegen/globalTypes.ts b/packages/language-core/lib/codegen/globalTypes.ts index 9908372d43..e6b852187a 100644 --- a/packages/language-core/lib/codegen/globalTypes.ts +++ b/packages/language-core/lib/codegen/globalTypes.ts @@ -92,7 +92,11 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates function __VLS_getVForSourceType(source: number): [number, number, number][]; function __VLS_getVForSourceType(source: string): [string, number, number][]; function __VLS_getVForSourceType(source: T): [ - item: T[number], + item: ${( + target >= 3 ? `import('${lib}').Reactive` : + target >= 2.7 ? `import('${lib}').UnwrapNestedRefs` : + `T[number]` + )}, key: number, index: number, ][]; diff --git a/packages/tsc/tests/__snapshots__/dts.spec.ts.snap b/packages/tsc/tests/__snapshots__/dts.spec.ts.snap index e26d792a89..74f66ee834 100644 --- a/packages/tsc/tests/__snapshots__/dts.spec.ts.snap +++ b/packages/tsc/tests/__snapshots__/dts.spec.ts.snap @@ -13,7 +13,7 @@ declare const _default: (__VLS_props: NonNullable; }): any; }; emit: {}; diff --git a/test-workspace/tsc/passedFixtures/vue3/#3204/main.vue b/test-workspace/tsc/passedFixtures/vue3/#3204/main.vue index c3bd92b45c..6f43f41746 100644 --- a/test-workspace/tsc/passedFixtures/vue3/#3204/main.vue +++ b/test-workspace/tsc/passedFixtures/vue3/#3204/main.vue @@ -1,4 +1,4 @@ -