X Tutup
Skip to content

Commit 341af7e

Browse files
committed
Add some code comments
1 parent e5d5cb3 commit 341af7e

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

apps/api-extractor/src/analyzer/AstModule.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import * as ts from 'typescript';
66
import { AstSymbol } from './AstSymbol';
77
import { AstEntity } from './AstSymbolTable';
88

9+
/**
10+
* Represents information collected by {@link AstSymbolTable.fetchAstModuleExportInfo}
11+
*/
912
export class AstModuleExportInfo {
1013
public readonly exportedLocalEntities: Map<string, AstEntity> = new Map<string, AstEntity>();
1114
public readonly starExportedExternalModules: Set<AstModule> = new Set<AstModule>();

apps/api-extractor/src/analyzer/AstSymbolTable.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,17 @@ export class AstSymbolTable {
106106
return this._exportAnalyzer.fetchAstModuleFromSourceFile(sourceFile, undefined);
107107
}
108108

109+
/**
110+
* This crawls the specified entry point and collects the full set of exported AstSymbols.
111+
*/
109112
public fetchAstModuleExportInfo(astModule: AstModule): AstModuleExportInfo {
110113
return this._exportAnalyzer.fetchAstModuleExportInfo(astModule);
111114
}
112115

116+
/**
117+
* Attempts to retrieve an export by name from the specified `AstModule`.
118+
* Returns undefined if no match was found.
119+
*/
113120
public tryGetExportOfAstModule(exportName: string, astModule: AstModule): AstEntity | undefined {
114121
return this._exportAnalyzer.tryGetExportOfAstModule(exportName, astModule);
115122
}

apps/api-extractor/src/analyzer/ExportAnalyzer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export class ExportAnalyzer {
212212
}
213213

214214
/**
215-
* This crawls the specified entry point and collects the full set of exported AstSymbols.
215+
* Implementation of {@link AstSymbolTable.fetchAstModuleExportInfo}.
216216
*/
217217
public fetchAstModuleExportInfo(entryPointAstModule: AstModule): AstModuleExportInfo {
218218
if (entryPointAstModule.isExternal) {
@@ -542,6 +542,9 @@ export class ExportAnalyzer {
542542
return astEntity;
543543
}
544544

545+
/**
546+
* Implementation of {@link AstSymbolTable.tryGetExportOfAstModule}.
547+
*/
545548
public tryGetExportOfAstModule(exportName: string, astModule: AstModule): AstEntity | undefined {
546549
const visitedAstModules: Set<AstModule> = new Set<AstModule>();
547550
return this._tryGetExportOfAstModule(exportName, astModule,

apps/api-extractor/src/api/ExtractorMessageId.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export const enum ExtractorMessageId {
6666
* "The `@inheritDoc` tag needs a TSDoc declaration reference; signature matching is not supported yet".
6767
*
6868
* @privateRemarks
69-
* In the future, we can implement signature matching so that you can write `{@inheritDoc}` and API Extractor
70-
* will find the corresponding member from a base class (or implemented interface). Until then, the tag needs
71-
* an explicit declaration reference such as `{@inhertDoc MyBaseClass.sameMethod}`.
69+
* In the future, we will implement signature matching so that you can write `{@inheritDoc}` and API Extractor
70+
* will find a corresponding member from a base class (or implemented interface). Until then, the tag
71+
* always needs an explicit declaration reference such as `{@inhertDoc MyBaseClass.sameMethod}`.
7272
*/
7373
UnresolvedInheritDocBase = 'ae-unresolved-inheritdoc-base'
7474
}

0 commit comments

Comments
 (0)
X Tutup