parent
3963e0ab39
commit
9262727ae1
|
@ -51,7 +51,8 @@ module.exports = function addJadeDataDocsProcessor() {
|
||||||
var modulePageInfo = _.map(doc.exports, function(exportDoc) {
|
var modulePageInfo = _.map(doc.exports, function(exportDoc) {
|
||||||
return {
|
return {
|
||||||
name: exportDoc.name + '-' + exportDoc.docType,
|
name: exportDoc.name + '-' + exportDoc.docType,
|
||||||
title: exportDoc.name
|
title: exportDoc.name,
|
||||||
|
varType: exportDoc.symbolTypeName && titleCase(exportDoc.symbolTypeName)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
{%- for item in doc.data %}
|
{%- for item in doc.data %}
|
||||||
"{$ item.name $}" : {
|
"{$ item.name $}" : {
|
||||||
"title" : "{$ item.title $}"{% if item.intro %},
|
"title" : "{$ item.title $}"{% if item.intro %},
|
||||||
"intro" : "{$ item.intro $}"{% endif %}
|
"intro" : "{$ item.intro $}"{% endif %}{% if item.varType %},
|
||||||
|
"varType" : "{$ item.varType $}"{% endif %}
|
||||||
}{% if not loop.last %},{% endif %}
|
}{% if not loop.last %},{% endif %}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
}
|
}
|
|
@ -188,6 +188,12 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||||
location: getLocation(exportSymbol)
|
location: getLocation(exportSymbol)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (exportDoc.docType === 'var' || exportDoc.docType === 'const') {
|
||||||
|
exportDoc.symbolTypeName = exportSymbol.valueDeclaration.type &&
|
||||||
|
exportSymbol.valueDeclaration.type.typeName &&
|
||||||
|
exportSymbol.valueDeclaration.type.typeName.text;
|
||||||
|
}
|
||||||
|
|
||||||
if(exportSymbol.flags & ts.SymbolFlags.Function) {
|
if(exportSymbol.flags & ts.SymbolFlags.Function) {
|
||||||
exportDoc.parameters = getParameters(typeChecker, exportSymbol);
|
exportDoc.parameters = getParameters(typeChecker, exportSymbol);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue