@@ -468,7 +468,7 @@ interface ComponentMeta<T> {
468468 for ( const symbol of exportedSymbols ) {
469469 const [ declaration ] = symbol . getDeclarations ( ) ?? [ ] ;
470470
471- if ( ts . isExportAssignment ( declaration ) ) {
471+ if ( declaration && ts . isExportAssignment ( declaration ) ) {
472472 symbolNode = declaration . expression ;
473473 }
474474 }
@@ -599,30 +599,30 @@ function createSchemaResolvers(
599599 let getSchema = ( ) => [ ] as PropertyMetaSchema [ ] ;
600600
601601 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 ) {
604604 subtypeStr = getFullyQualifiedName ( subtype ) ;
605605 getSchema = ( ) => typeChecker . getTypeArguments ( subtype ! as ts . TypeReference ) . map ( resolveSchema ) ;
606606 }
607607 else {
608608 subtypeStr = '[' ;
609609 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 ) )
611611 + ', ' ;
612612 }
613613 subtypeStr = subtypeStr . slice ( 0 , - 2 ) + ']' ;
614614 getSchema = ( ) => {
615615 const result : PropertyMetaSchema [ ] = [ ] ;
616616 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 ) ) ) ;
618618 }
619619 return result ;
620620 } ;
621621 }
622622 }
623623
624624 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 ,
626626 description : ts . displayPartsToString ( call . getDocumentationComment ( typeChecker ) ) ,
627627 tags : call . getJsDocTags ( ) . map ( tag => ( {
628628 name : tag . name ,
@@ -646,10 +646,10 @@ function createSchemaResolvers(
646646 kind : 'event' ,
647647 type : typeChecker . signatureToString ( signature ) ,
648648 get schema ( ) {
649- return schema ??= signature . parameters . length > 0
649+ return schema ??= signature . parameters . length
650650 ? typeChecker
651651 . getTypeArguments (
652- typeChecker . getTypeOfSymbolAtLocation ( signature . parameters [ 0 ] , symbolNode ) as ts . TypeReference ,
652+ typeChecker . getTypeOfSymbolAtLocation ( signature . parameters [ 0 ] ! , symbolNode ) as ts . TypeReference ,
653653 )
654654 . map ( resolveSchema )
655655 : undefined ;
@@ -700,7 +700,7 @@ function createSchemaResolvers(
700700 } ;
701701 }
702702 else if ( subtype . getCallSignatures ( ) . length === 1 ) {
703- return resolveCallbackSchema ( subtype . getCallSignatures ( ) [ 0 ] ) ;
703+ return resolveCallbackSchema ( subtype . getCallSignatures ( ) [ 0 ] ! ) ;
704704 }
705705
706706 return type ;
@@ -909,7 +909,7 @@ function readTsComponentDefaultProps(
909909 // export default defineComponent({ ... })
910910 else if ( ts . isCallExpression ( component ) ) {
911911 if ( component . arguments . length ) {
912- const arg = component . arguments [ 0 ] ;
912+ const arg = component . arguments [ 0 ] ! ;
913913 if ( ts . isObjectLiteralExpression ( arg ) ) {
914914 return arg ;
915915 }
0 commit comments