fix(typings): update test.typings for abstract superclasses
This commit is contained in:
@ -74,7 +74,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
|
||||
references: ['./angular2.d.ts', '../jasmine/jasmine.d.ts'],
|
||||
remapTypes: { Type: 'ng.Type', Binding: 'ng.Binding', ViewMetadata: 'ng.ViewMetadata', Injector: 'ng.Injector',
|
||||
Predicate: 'ng.Predicate', ElementRef: 'ng.ElementRef', DebugElement: 'ng.DebugElement',
|
||||
InjectableReference: 'ng.InjectableReference' },
|
||||
InjectableReference: 'ng.InjectableReference', ComponentRef: 'ng.ComponentRef' },
|
||||
modules: {'angular2/test_lib': {namespace: 'ngTestLib', id: 'angular2/test_lib'}}
|
||||
}
|
||||
];
|
||||
|
@ -59,6 +59,10 @@ DtsSerializer.prototype = {
|
||||
},
|
||||
|
||||
interfaceOrClass: function(buffer, ast, isInterface) {
|
||||
if (ast.abstract) {
|
||||
buffer.push('abstract ');
|
||||
}
|
||||
|
||||
buffer.push(isInterface ? 'interface ' : 'class ');
|
||||
buffer.push(ast.name);
|
||||
buffer.push(ast.typeParams);
|
||||
|
@ -223,6 +223,9 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||
if (exportSymbol.flags & ts.SymbolFlags.TypeAlias) {
|
||||
exportDoc.typeDefinition = typeDefinition;
|
||||
}
|
||||
if (isAbstract(exportSymbol)) {
|
||||
exportDoc.abstract = true;
|
||||
}
|
||||
|
||||
// Compute the original module name from the relative file path
|
||||
exportDoc.originalModule = exportDoc.fileInfo.relativePath
|
||||
@ -345,6 +348,10 @@ module.exports = function readTypeScriptModules(tsParser, modules, getFileInfo,
|
||||
}
|
||||
}
|
||||
|
||||
function isAbstract(symbol) {
|
||||
var declaration = symbol.valueDeclaration || symbol.declarations[0];
|
||||
return declaration.flags & ts.NodeFlags.Abstract;
|
||||
}
|
||||
|
||||
function expandSourceFiles(sourceFiles, basePath) {
|
||||
var filePaths = [];
|
||||
|
Reference in New Issue
Block a user