Add @extends annotations to generated externs

This commit is contained in:
Andreas Hocevar
2014-08-27 15:51:47 +02:00
parent 507dd4d534
commit 80ea1772e2
2 changed files with 6 additions and 0 deletions

View File

@@ -88,6 +88,9 @@ exports.publish = function(data, opts) {
stability: doc.api, stability: doc.api,
path: path.join(doc.meta.path, doc.meta.filename) path: path.join(doc.meta.path, doc.meta.filename)
}; };
if (doc.augments) {
symbol.extends = doc.augments[0];
}
if (doc.type) { if (doc.type) {
symbol.types = getTypes(doc.type.names); symbol.types = getTypes(doc.type.names);
} }

View File

@@ -93,6 +93,9 @@ function generateExterns(typedefs, symbols, externs, interfaces) {
if (symbol.kind === 'class') { if (symbol.kind === 'class') {
constructors[name] = true; constructors[name] = true;
lines.push(' * @constructor'); lines.push(' * @constructor');
if (symbol.extends) {
lines.push(' * @extends {' + symbol.extends + '}');
}
} }
if (symbol.types) { if (symbol.types) {
lines.push(' * @type {' + noGoogTypes(symbol.types).join('|') + '}'); lines.push(' * @type {' + noGoogTypes(symbol.types).join('|') + '}');