@@ -2,13 +2,13 @@ import { getSlotsPropertyName } from '../utils/shared';
2
2
import type { VueCompilerOptions } from '../types' ;
3
3
4
4
export function resolveGlobalTypesName ( options : VueCompilerOptions ) {
5
- const { lib, target, strictAttributes , strictComponents } = options ;
6
- return `${ lib } _${ target } _${ strictAttributes } _${ strictComponents } .d.ts` ;
5
+ const { lib, target, strictTemplates } = options ;
6
+ return `${ lib } _${ target } _${ strictTemplates . attributes } _${ strictTemplates . components } .d.ts` ;
7
7
}
8
8
9
9
export function generateGlobalTypes ( options : VueCompilerOptions ) {
10
- const { lib, target, strictAttributes , strictComponents } = options ;
11
- const fnPropsType = `(K extends { $props: infer Props } ? Props : any)${ strictAttributes ? '' : ' & Record<string, unknown>' } ` ;
10
+ const { lib, target, strictTemplates } = options ;
11
+ const fnPropsType = `(K extends { $props: infer Props } ? Props : any)${ strictTemplates . attributes ? '' : ' & Record<string, unknown>' } ` ;
12
12
let text = `` ;
13
13
if ( target < 3.5 ) {
14
14
text += `
@@ -54,7 +54,7 @@ export function generateGlobalTypes(options: VueCompilerOptions) {
54
54
N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N1] } :
55
55
N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N2] } :
56
56
N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : { [K in N0]: __VLS_GlobalComponents[N3] } :
57
- ${ strictComponents ? '{}' : '{ [K in N0]: unknown }' }
57
+ ${ strictTemplates . components ? '{}' : '{ [K in N0]: unknown }' }
58
58
type __VLS_FunctionalComponentProps<T, K> =
59
59
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
60
60
: T extends (props: infer P, ...args: any) => any ? P :
@@ -140,8 +140,8 @@ export function generateGlobalTypes(options: VueCompilerOptions) {
140
140
} & { props?: ${ fnPropsType } ; expose?(exposed: K): void; } }
141
141
: T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
142
142
: T extends (...args: any) => any ? T
143
- : (_: {}${ strictAttributes ? '' : ' & Record<string, unknown>' } , ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {}${ strictAttributes ? '' : ' & Record<string, unknown>' } } };
144
- function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T${ strictComponents ? '' : ' & Record<string, unknown>' } ) => void;
143
+ : (_: {}${ strictTemplates . attributes ? '' : ' & Record<string, unknown>' } , ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {}${ strictTemplates . attributes ? '' : ' & Record<string, unknown>' } } };
144
+ function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T${ strictTemplates . components ? '' : ' & Record<string, unknown>' } ) => void;
145
145
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
146
146
function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
147
147
function __VLS_tryAsConstant<const T>(t: T): T;
0 commit comments