@@ -10,6 +10,7 @@ import {
1010 createTypeLiteralNode ,
1111 createTypeQueryNode ,
1212} from '../../../typescriptFactory/typescriptFactory' ;
13+ import GetDeclarationFromSymbol = TypescriptHelper . GetDeclarationFromSymbol ;
1314
1415type ExternalSource = ts . SourceFile | ts . ModuleDeclaration ;
1516
@@ -35,7 +36,8 @@ export function GetModuleDescriptor(
3536 }
3637
3738 const symbol : ts . Symbol = typeChecker . getAliasedSymbol ( symbolAlias ) ;
38- const externalModuleDeclaration : ts . NamedDeclaration = symbol . declarations [ 0 ] ;
39+ const externalModuleDeclaration : ts . NamedDeclaration =
40+ GetDeclarationFromSymbol ( symbol ) ;
3941
4042 if ( isExternalSource ( externalModuleDeclaration ) ) {
4143 return GetPropertiesFromSourceFileOrModuleDeclarationDescriptor (
@@ -83,12 +85,12 @@ export function GetPropertiesFromSourceFileOrModuleDeclaration(
8385 const moduleExports : ts . Symbol [ ] = typeChecker . getExportsOfModule ( symbol ) ;
8486
8587 return moduleExports
86- . map ( ( prop : ts . Symbol ) : ModuleExportsDeclarations => {
88+ . map ( ( prop : ts . Symbol ) : Partial < ModuleExportsDeclarations > => {
8789 const originalSymbol : ts . Symbol =
8890 TypescriptHelper . GetAliasedSymbolSafe ( prop ) ;
89- const originalDeclaration : ts . NamedDeclaration =
91+ const originalDeclaration : ts . NamedDeclaration | undefined =
9092 originalSymbol ?. declarations ?. [ 0 ] ;
91- const declaration : ts . Declaration = prop ?. declarations ?. [ 0 ] ;
93+ const declaration : ts . Declaration | undefined = prop ?. declarations ?. [ 0 ] ;
9294
9395 return {
9496 declaration,
0 commit comments