fixed broken sample code

fixed some errors in the sample code. tested using v3.0.3
Bilal Durrani 2018-10-01 22:03:14 -04:00
Родитель d6867c4321
Коммит 8e7d4bd1c8
1 изменённых файлов: 3 добавлений и 3 удалений

@ -722,7 +722,7 @@ function generateDocumentation(
function serializeSymbol(symbol: ts.Symbol): DocEntry {
return {
name: symbol.getName(),
documentation: ts.displayPartsToString(symbol.getDocumentationComment()),
documentation: ts.displayPartsToString(symbol.getDocumentationComment(checker)),
type: checker.typeToString(
checker.getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration!)
)
@ -749,14 +749,14 @@ function generateDocumentation(
return {
parameters: signature.parameters.map(serializeSymbol),
returnType: checker.typeToString(signature.getReturnType()),
documentation: ts.displayPartsToString(signature.getDocumentationComment())
documentation: ts.displayPartsToString(signature.getDocumentationComment(checker))
};
}
/** True if this is visible outside this file, false otherwise */
function isNodeExported(node: ts.Node): boolean {
return (
(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) !== 0 ||
(ts.getCombinedModifierFlags(<ts.Declaration>node) & ts.ModifierFlags.Export) !== 0 ||
(!!node.parent && node.parent.kind === ts.SyntaxKind.SourceFile)
);
}