Skip to content

Commit f6da89f

Browse files
petebacondarwinmhevery
authored andcommitted
chore(doc-gen): export interfaces over vars
If a symbol is declared as an interface and a var then we should export it as an interface rather than a var.
1 parent 3437d56 commit f6da89f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/typescript-package/services/tsParser/getExportDocType.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ var ts = require('typescript');
33
module.exports = function getExportDocType(log) {
44

55
return function(symbol) {
6-
if(symbol.flags & ts.SymbolFlags.FunctionScopedVariable) {
7-
return 'var';
8-
}
9-
if(symbol.flags & ts.SymbolFlags.BlockScopedVariable) {
10-
return getBlockScopedVariableDocType(symbol);
11-
}
126
if(symbol.flags & ts.SymbolFlags.Function) {
137
return 'function';
148
}
@@ -30,6 +24,12 @@ module.exports = function getExportDocType(log) {
3024
if(symbol.flags & ts.SymbolFlags.TypeAlias) {
3125
return 'type-alias';
3226
}
27+
if(symbol.flags & ts.SymbolFlags.FunctionScopedVariable) {
28+
return 'var';
29+
}
30+
if(symbol.flags & ts.SymbolFlags.BlockScopedVariable) {
31+
return getBlockScopedVariableDocType(symbol);
32+
}
3333

3434
log.warn('getExportDocType(): Unknown symbol type', {
3535
symbolName: symbol.name,

0 commit comments

Comments
 (0)