File tree Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Expand file tree Collapse file tree 4 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -390,7 +390,9 @@ export class Printer {
390
390
} else if ( ts . isTypeLiteralNode ( node ) ) {
391
391
return this . printTypeLiteralNode ( node ) ;
392
392
} else if ( ts . isTypeReferenceNode ( node ) ) {
393
- return this . print ( node . typeName ) ;
393
+ return node . typeArguments
394
+ ? this . printTypeByType ( node )
395
+ : this . print ( node . typeName ) ;
394
396
} else if ( ts . isInterfaceDeclaration ( node ) ) {
395
397
return this . printInterfaceDeclaration ( node ) ;
396
398
} else if ( ts . isTypeAliasDeclaration ( node ) ) {
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import type { ExtractPropTypes } from " vue" ;
3
+ const testProps = {
4
+ a: {
5
+ type: String ,
6
+ },
7
+ };
8
+
9
+ type TestProps = ExtractPropTypes <typeof testProps >;
10
+ defineProps <TestProps >();
11
+ </script >
Original file line number Diff line number Diff line change @@ -491,6 +491,32 @@ export { core_8468 as default };
491
491
"
492
492
` ;
493
493
494
+ exports [` fixtures compiled > __fixtures__/defineProps/core#9774.vue 1` ] = `
495
+ "// core_9774.js
496
+ import { defineComponent } from 'vue';
497
+ import _export_sfc from '[NULL]/plugin-vue/export-helper';
498
+
499
+ var _sfc_main = /* @__PURE__ */ defineComponent({
500
+ __name : " core#9774" ,
501
+ props : { a: { required: false } },
502
+ setup (__props , { expose: __expose }) {
503
+ __expose();
504
+ const testProps = { a: { type: String } };
505
+ const __returned__ = { testProps };
506
+ Object .defineProperty (__returned__ , " __isScriptSetup" , {
507
+ enumerable: false ,
508
+ value: true
509
+ });
510
+ return __returned__ ;
511
+ }
512
+ });
513
+
514
+ var core_9774 = /* @__PURE__ */ _export_sfc(_sfc_main, [__FILE__]);
515
+
516
+ export { core_9774 as default } ;
517
+ "
518
+ ` ;
519
+
494
520
exports [` fixtures compiled > __fixtures__/defineProps/import-from-vue.vue 1` ] = `
495
521
"// import-from-vue.js
496
522
import { defineComponent } from 'vue';
Original file line number Diff line number Diff line change @@ -232,6 +232,23 @@ value: number
232
232
"
233
233
` ;
234
234
235
+ exports [` fixtures > __fixtures__/defineProps/core#9774.vue 1` ] = `
236
+ "<script setup lang = " ts" >
237
+ import type { ExtractPropTypes } from "vue";
238
+ const testProps = {
239
+ a : {
240
+ type: String ,
241
+ },
242
+ } ;
243
+
244
+ type TestProps = ExtractPropTypes<typeof testProps >;
245
+ defineProps<{
246
+ a ?: string | undefined
247
+ } >();
248
+ </script >
249
+ "
250
+ `;
251
+
235
252
exports[`fixtures > __fixtures__/defineProps/import-from-vue.vue 1`] = `
236
253
"<script setup lang = " ts" generic = " T extends string" >
237
254
import type { Foo } from "./import-from-vue-vue.exclude.vue";
You can’t perform that action at this time.
0 commit comments