File tree 3 files changed +15
-5
lines changed
vue-language-core/src/generators
vue-test-workspace/vue-tsc
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ export function generate(
156
156
) ;
157
157
}
158
158
if ( usedHelperTypes . ToTemplateSlots ) {
159
- codes . push ( `type __VLS_ToTemplateSlots<T> = { [K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : (props: T[K]) => any };\n` ) ;
159
+ codes . push ( `type __VLS_ToTemplateSlots<T> = { [K in keyof T]? : NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : (props: T[K]) => any };\n` ) ;
160
160
}
161
161
if ( usedHelperTypes . PropsChildren ) {
162
162
codes . push ( `type __VLS_PropsChildren<S> = { [K in keyof (boolean extends (JSX.ElementChildrenAttribute extends never ? true : false) ? never : JSX.ElementChildrenAttribute)]?: S; };\n` ) ;
Original file line number Diff line number Diff line change
1
+ <script lang="ts">
2
+ import { defineComponent } from ' vue' ;
3
+ import MyComp from ' ./main.vue' ;
4
+
5
+ export default defineComponent ({
6
+ components: {
7
+ MyComp ,
8
+ },
9
+ });
10
+ </script >
Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ declare const ScriptSetupGenericExact: <T, >(
67
67
_props : NonNullable <typeof _setup >[' props' ] & import (' vue' ).VNodeProps & import (' vue' ).AllowedComponentProps & import (' vue' ).ComponentCustomProps ,
68
68
_ctx ? : Pick <NonNullable <typeof _setup >, ' attrs' | ' emit' | ' slots' >,
69
69
_setup ? : {
70
- props: { foo: T } & { [K in keyof JSX .ElementChildrenAttribute ]? : { default(data : T ): any } },
70
+ props: { foo: T } & { [K in keyof JSX .ElementChildrenAttribute ]? : { default? (data : T ): any } },
71
71
attrs: any ,
72
- slots: { default(data : T ): any },
72
+ slots: { default? (data : T ): any },
73
73
emit: { (e : ' bar' , data : T ): void },
74
74
expose(_exposed : { baz: T }): void ,
75
75
}
@@ -83,7 +83,7 @@ exactType(ScriptSetupGeneric, ScriptSetupGenericExact);
83
83
exactType ((new ShortDefineSlots ()).$slots .foo , {} as ((props : {
84
84
id: string ;
85
85
} | undefined ) => any ) | undefined );
86
- exactType ((new ShortDefineSlots ()).$slots .bar , {} as (props : {
86
+ exactType ((new ShortDefineSlots ()).$slots .bar , {} as (( props : {
87
87
id: number ;
88
- }) => any );
88
+ }) => any ) | undefined ) ;
89
89
</script >
You can’t perform that action at this time.
0 commit comments