@@ -640,14 +640,23 @@ function getIndexDts (apis, quasarLangIndex) {
640
640
writeLine ( contents )
641
641
642
642
// Provide `GlobalComponents`, expected to be used for Volar
643
- writeLine ( contents , 'declare module \'@vue/runtime-core\' {' )
644
- writeLine ( contents , 'interface GlobalComponents {' , 1 )
645
-
643
+ // See: https://github.com/vuejs/language-tools/issues/4170#issuecomment-2025528945
644
+ writeLine ( contents , 'interface _GlobalComponents {' )
646
645
for ( const [ typeName , { props : propsTypeName , slots : slotsTypeName } ] of Object . entries ( componentToSubTypeMap ) ) {
647
- writeLine ( contents , `${ typeName } : GlobalComponentConstructor<${ propsTypeName } , ${ slotsTypeName } >` , 2 )
646
+ writeLine ( contents , `${ typeName } : GlobalComponentConstructor<${ propsTypeName } , ${ slotsTypeName } >` , 1 )
648
647
}
649
-
650
- writeLine ( contents , '}' , 1 )
648
+ writeLine ( contents , '}' )
649
+ writeLine ( contents )
650
+ writeLine ( contents , 'declare module \'@vue/runtime-core\' {' )
651
+ writeLine ( contents , 'interface GlobalComponents extends _GlobalComponents {}' , 1 )
652
+ writeLine ( contents , '}' )
653
+ writeLine ( contents )
654
+ writeLine ( contents , 'declare module \'@vue/runtime-dom\' {' )
655
+ writeLine ( contents , 'interface GlobalComponents extends _GlobalComponents {}' , 1 )
656
+ writeLine ( contents , '}' )
657
+ writeLine ( contents )
658
+ writeLine ( contents , 'declare module \'vue\' {' )
659
+ writeLine ( contents , 'interface GlobalComponents extends _GlobalComponents {}' , 1 )
651
660
writeLine ( contents , '}' )
652
661
writeLine ( contents )
653
662
0 commit comments