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) {
144144 type __VLS_UseTemplateRef<T> = Readonly<import('${ lib } ').ShallowRef<T | null>>;
145145 type __VLS_ProxyRefs<T> = import('${ lib } ').ShallowUnwrapRef<T>;
146146
147+ function __VLS_definePublicProps<T>(options: T): import('${ lib } ').${
148+ target >= 3.3 ? `ExtractPublicPropTypes` : `ExtractPropTypes`
149+ } <T>;
147150 function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
148151 item: T extends number ? number
149152 : T extends string ? string
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ export function* generateScriptSetup(
5959 if ( ctx . generatedPropsType ) {
6060 propTypes . push ( `__VLS_PublicProps` ) ;
6161 }
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+ }
6273 if ( scriptSetupRanges . defineEmits || scriptSetupRanges . defineModel . length ) {
6374 propTypes . push ( `__VLS_EmitProps` ) ;
6475 }
You can’t perform that action at this time.
0 commit comments