@@ -468,7 +468,7 @@ interface ComponentMeta<T> {
468
468
for ( const symbol of exportedSymbols ) {
469
469
const [ declaration ] = symbol . getDeclarations ( ) ?? [ ] ;
470
470
471
- if ( ts . isExportAssignment ( declaration ) ) {
471
+ if ( declaration && ts . isExportAssignment ( declaration ) ) {
472
472
symbolNode = declaration . expression ;
473
473
}
474
474
}
@@ -599,30 +599,30 @@ function createSchemaResolvers(
599
599
let getSchema = ( ) => [ ] as PropertyMetaSchema [ ] ;
600
600
601
601
if ( call . parameters . length >= 2 ) {
602
- subtype = typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ 1 ] , symbolNode ) ;
603
- if ( ( call . parameters [ 1 ] . valueDeclaration as any ) ?. dotDotDotToken ) {
602
+ subtype = typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ 1 ] ! , symbolNode ) ;
603
+ if ( ( call . parameters [ 1 ] ! . valueDeclaration as any ) ?. dotDotDotToken ) {
604
604
subtypeStr = getFullyQualifiedName ( subtype ) ;
605
605
getSchema = ( ) => typeChecker . getTypeArguments ( subtype ! as ts . TypeReference ) . map ( resolveSchema ) ;
606
606
}
607
607
else {
608
608
subtypeStr = '[' ;
609
609
for ( let i = 1 ; i < call . parameters . length ; i ++ ) {
610
- subtypeStr += getFullyQualifiedName ( typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ i ] , symbolNode ) )
610
+ subtypeStr += getFullyQualifiedName ( typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ i ] ! , symbolNode ) )
611
611
+ ', ' ;
612
612
}
613
613
subtypeStr = subtypeStr . slice ( 0 , - 2 ) + ']' ;
614
614
getSchema = ( ) => {
615
615
const result : PropertyMetaSchema [ ] = [ ] ;
616
616
for ( let i = 1 ; i < call . parameters . length ; i ++ ) {
617
- result . push ( resolveSchema ( typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ i ] , symbolNode ) ) ) ;
617
+ result . push ( resolveSchema ( typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ i ] ! , symbolNode ) ) ) ;
618
618
}
619
619
return result ;
620
620
} ;
621
621
}
622
622
}
623
623
624
624
return {
625
- name : ( typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ 0 ] , symbolNode ) as ts . StringLiteralType ) . value ,
625
+ name : ( typeChecker . getTypeOfSymbolAtLocation ( call . parameters [ 0 ] ! , symbolNode ) as ts . StringLiteralType ) . value ,
626
626
description : ts . displayPartsToString ( call . getDocumentationComment ( typeChecker ) ) ,
627
627
tags : call . getJsDocTags ( ) . map ( tag => ( {
628
628
name : tag . name ,
@@ -646,10 +646,10 @@ function createSchemaResolvers(
646
646
kind : 'event' ,
647
647
type : typeChecker . signatureToString ( signature ) ,
648
648
get schema ( ) {
649
- return schema ??= signature . parameters . length > 0
649
+ return schema ??= signature . parameters . length
650
650
? typeChecker
651
651
. getTypeArguments (
652
- typeChecker . getTypeOfSymbolAtLocation ( signature . parameters [ 0 ] , symbolNode ) as ts . TypeReference ,
652
+ typeChecker . getTypeOfSymbolAtLocation ( signature . parameters [ 0 ] ! , symbolNode ) as ts . TypeReference ,
653
653
)
654
654
. map ( resolveSchema )
655
655
: undefined ;
@@ -700,7 +700,7 @@ function createSchemaResolvers(
700
700
} ;
701
701
}
702
702
else if ( subtype . getCallSignatures ( ) . length === 1 ) {
703
- return resolveCallbackSchema ( subtype . getCallSignatures ( ) [ 0 ] ) ;
703
+ return resolveCallbackSchema ( subtype . getCallSignatures ( ) [ 0 ] ! ) ;
704
704
}
705
705
706
706
return type ;
@@ -909,7 +909,7 @@ function readTsComponentDefaultProps(
909
909
// export default defineComponent({ ... })
910
910
else if ( ts . isCallExpression ( component ) ) {
911
911
if ( component . arguments . length ) {
912
- const arg = component . arguments [ 0 ] ;
912
+ const arg = component . arguments [ 0 ] ! ;
913
913
if ( ts . isObjectLiteralExpression ( arg ) ) {
914
914
return arg ;
915
915
}
0 commit comments