feat(typings): add typing specs
add test in gulpfile which will compile a basic TS file with generated angular2.d.ts to ensure generated d.ts is valid syntactic TS Adds support for enums in .d.ts generation pipeline. Removes renaming reexports in http module.
This commit is contained in:
@ -10,7 +10,7 @@ module.exports = function createTypeDefinitionFile() {
|
||||
id: 'type-definition',
|
||||
aliases: ['type-definition'],
|
||||
path: 'type-definition',
|
||||
outputPath: 'angular2.d.ts',
|
||||
outputPath: 'typings/angular2/angular2.d.ts',
|
||||
modules: []
|
||||
};
|
||||
_.forEach(docs, function(doc) {
|
||||
|
@ -91,6 +91,13 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo
|
||||
}
|
||||
}
|
||||
|
||||
if (exportDoc.docType == 'enum') {
|
||||
exportDoc.members = [];
|
||||
for (var etype in resolvedExport.exports) {
|
||||
exportDoc.members.push(etype);
|
||||
}
|
||||
}
|
||||
|
||||
// Add this export doc to its module doc
|
||||
moduleDoc.exports.push(exportDoc);
|
||||
docs.push(exportDoc);
|
||||
@ -165,6 +172,7 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo
|
||||
fileInfo: getFileInfo(exportSymbol, basePath),
|
||||
location: getLocation(exportSymbol)
|
||||
};
|
||||
|
||||
if(exportSymbol.flags & ts.SymbolFlags.Function) {
|
||||
exportDoc.parameters = getParameters(typeChecker, exportSymbol);
|
||||
}
|
||||
@ -290,4 +298,4 @@ function anyMatches(regexes, item) {
|
||||
if ( item.match(regexes[i]) ) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user