@@ -78,7 +78,6 @@ export function generate(
78
78
mergePropDefaults : false ,
79
79
ConstructorOverloads : false ,
80
80
WithTemplateSlots : false ,
81
- ToTemplateSlots : false ,
82
81
PropsChildren : false ,
83
82
} ;
84
83
@@ -156,9 +155,6 @@ export function generate(
156
155
`} };\n` ,
157
156
) ;
158
157
}
159
- if ( usedHelperTypes . ToTemplateSlots ) {
160
- codes . push ( `type __VLS_ToTemplateSlots<T> = { [K in keyof T]?: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : (props: T[K]) => any };\n` ) ;
161
- }
162
158
if ( usedHelperTypes . PropsChildren ) {
163
159
codes . push ( `type __VLS_PropsChildren<S> = { [K in keyof (boolean extends (JSX.ElementChildrenAttribute extends never ? true : false) ? never : JSX.ElementChildrenAttribute)]?: S; };\n` ) ;
164
160
}
@@ -385,22 +381,20 @@ export function generate(
385
381
codes . push ( `};\n` ) ;
386
382
}
387
383
if ( scriptSetupRanges . slotsTypeArg && vueCompilerOptions . jsxSlots ) {
388
- usedHelperTypes . ToTemplateSlots = true ;
389
384
usedHelperTypes . PropsChildren = true ;
390
- codes . push ( ` & __VLS_PropsChildren<__VLS_ToTemplateSlots< ` ) ;
385
+ codes . push ( ` & __VLS_PropsChildren<` ) ;
391
386
addExtraReferenceVirtualCode ( 'scriptSetup' , scriptSetupRanges . slotsTypeArg . start , scriptSetupRanges . slotsTypeArg . end ) ;
392
- codes . push ( `>> ` ) ;
387
+ codes . push ( `>` ) ;
393
388
}
394
389
codes . push ( `;\n` ) ;
395
390
}
396
391
else {
397
392
codes . push ( `const __VLS_props: {}` ) ;
398
393
if ( scriptSetupRanges . slotsTypeArg && vueCompilerOptions . jsxSlots ) {
399
- usedHelperTypes . ToTemplateSlots = true ;
400
394
usedHelperTypes . PropsChildren = true ;
401
- codes . push ( ` & __VLS_PropsChildren<__VLS_ToTemplateSlots< ` ) ;
395
+ codes . push ( ` & __VLS_PropsChildren<` ) ;
402
396
addExtraReferenceVirtualCode ( 'scriptSetup' , scriptSetupRanges . slotsTypeArg . start , scriptSetupRanges . slotsTypeArg . end ) ;
403
- codes . push ( `>> ` ) ;
397
+ codes . push ( `>` ) ;
404
398
}
405
399
if ( scriptSetupRanges . propsTypeArg ) {
406
400
codes . push ( ' & ' ) ;
@@ -685,10 +679,9 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
685
679
generateConstNameOption ( ) ;
686
680
687
681
if ( scriptSetupRanges ?. slotsTypeArg && sfc . scriptSetup ) {
688
- usedHelperTypes . ToTemplateSlots = true ;
689
- codes . push ( `var __VLS_slots!: __VLS_ToTemplateSlots<` ) ;
682
+ codes . push ( `var __VLS_slots!: ` ) ;
690
683
addExtraReferenceVirtualCode ( 'scriptSetup' , scriptSetupRanges . slotsTypeArg . start , scriptSetupRanges . slotsTypeArg . end ) ;
691
- codes . push ( '> ;\n' ) ;
684
+ codes . push ( ';\n' ) ;
692
685
} ;
693
686
694
687
codes . push ( `function __VLS_template() {\n` ) ;
@@ -875,10 +868,9 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
875
868
if ( ! htmlGen ) {
876
869
codes . push ( `// no template\n` ) ;
877
870
if ( scriptSetupRanges ?. slotsTypeArg && sfc . scriptSetup ) {
878
- usedHelperTypes . ToTemplateSlots = true ;
879
- codes . push ( `let __VLS_slots!: __VLS_ToTemplateSlots<` ) ;
871
+ codes . push ( `let __VLS_slots!: ` ) ;
880
872
addExtraReferenceVirtualCode ( 'scriptSetup' , scriptSetupRanges . slotsTypeArg . start , scriptSetupRanges . slotsTypeArg . end ) ;
881
- codes . push ( `> ;\n` ) ;
873
+ codes . push ( `;\n` ) ;
882
874
}
883
875
else {
884
876
codes . push ( `const __VLS_slots = {};\n` ) ;
0 commit comments