File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/language-core/lib/codegen Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ export function generateGlobalTypes(options: VueCompilerOptions) {
144
144
type __VLS_UseTemplateRef<T> = Readonly<import('${ lib } ').ShallowRef<T | null>>;
145
145
type __VLS_ProxyRefs<T> = import('${ lib } ').ShallowUnwrapRef<T>;
146
146
147
+ function __VLS_definePublicProps<T>(options: T): import('${ lib } ').${
148
+ target >= 3.3 ? `ExtractPublicPropTypes` : `ExtractPropTypes`
149
+ } <T>;
147
150
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
148
151
item: T extends number ? number
149
152
: T extends string ? string
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ export function* generateScriptSetup(
59
59
if ( ctx . generatedPropsType ) {
60
60
propTypes . push ( `__VLS_PublicProps` ) ;
61
61
}
62
+ if ( scriptSetupRanges . defineProps ?. arg ) {
63
+ yield `const __VLS_publicProps = __VLS_definePublicProps(` ;
64
+ yield generateSfcBlockSection (
65
+ scriptSetup ,
66
+ scriptSetupRanges . defineProps . arg . start ,
67
+ scriptSetupRanges . defineProps . arg . end ,
68
+ codeFeatures . navigation ,
69
+ ) ;
70
+ yield `)${ endOfLine } ` ;
71
+ propTypes . push ( `typeof __VLS_publicProps` ) ;
72
+ }
62
73
if ( scriptSetupRanges . defineEmits || scriptSetupRanges . defineModel . length ) {
63
74
propTypes . push ( `__VLS_EmitProps` ) ;
64
75
}
You can’t perform that action at this time.
0 commit comments