@@ -66,7 +66,7 @@ export namespace ApiHelpers {
6666 apiItem = new ApiEnumMember ( declaration , symbol , options ) ;
6767 } else if ( ts . isInterfaceDeclaration ( declaration ) ) {
6868 apiItem = new ApiInterface ( declaration , symbol , options ) ;
69- } else if ( ts . isPropertySignature ( declaration ) ) {
69+ } else if ( ts . isPropertySignature ( declaration ) || ts . isPropertyAssignment ( declaration ) ) {
7070 apiItem = new ApiProperty ( declaration , symbol , options ) ;
7171 } else if ( ts . isMethodSignature ( declaration ) ) {
7272 apiItem = new ApiMethod ( declaration , symbol , options ) ;
@@ -94,9 +94,9 @@ export namespace ApiHelpers {
9494 apiItem = new ApiConstruct ( declaration , symbol , options ) ;
9595 } else if ( ts . isTypeParameterDeclaration ( declaration ) ) {
9696 apiItem = new ApiTypeParameter ( declaration , symbol , options ) ;
97- } else if ( ts . isTypeLiteralNode ( declaration ) ) {
97+ } else if ( ts . isTypeLiteralNode ( declaration ) || ts . isObjectLiteralExpression ( declaration ) ) {
9898 apiItem = new ApiTypeLiteral ( declaration , symbol , options ) ;
99- } else if ( ts . isFunctionTypeNode ( declaration ) ) {
99+ } else if ( ts . isFunctionTypeNode ( declaration ) || ts . isArrowFunction ( declaration ) || ts . isFunctionExpression ( declaration ) ) {
100100 apiItem = new ApiFunctionType ( declaration , symbol , options ) ;
101101 } else if ( ts . isMappedTypeNode ( declaration ) ) {
102102 apiItem = new ApiMapped ( declaration , symbol , options ) ;
@@ -181,12 +181,22 @@ export namespace ApiHelpers {
181181 }
182182 const symbolItems : string [ ] = [ ] ;
183183
184- symbol . declarations . forEach ( declaration => {
184+ // Filter out the same namespace.
185+ const filteredDeclarations : ts . Declaration [ ] = [ ] ;
186+ for ( const declaration of symbol . declarations ) {
187+ if ( filteredDeclarations . find ( x => ts . isModuleDeclaration ( x ) ) != null ) {
188+ continue ;
189+ }
190+
191+ filteredDeclarations . push ( declaration ) ;
192+ }
193+
194+ for ( const declaration of filteredDeclarations ) {
185195 const itemId = GetItemId ( declaration , symbol , options ) ;
186196 if ( itemId != null ) {
187197 symbolItems . push ( itemId ) ;
188198 }
189- } ) ;
199+ }
190200
191201 return {
192202 Alias : symbol . name ,
@@ -263,7 +273,7 @@ export namespace ApiHelpers {
263273 export function LogWithNodePosition ( logLevel : LogLevel , declaration : ts . Node , message : string ) : void {
264274 const sourceFile = declaration . getSourceFile ( ) ;
265275 const position = sourceFile . getLineAndCharacterOfPosition ( declaration . getStart ( ) ) ;
266- const linePrefix = `${ sourceFile . fileName } [ ${ position . line + 1 } : ${ position . character + 1 } ] ` ;
276+ const linePrefix = `${ sourceFile . fileName } ( ${ position . line + 1 } , ${ position . character + 1 } ) ` ;
267277 Logger . Log ( logLevel , `${ linePrefix } : ${ message } ` ) ;
268278 }
269279
0 commit comments