Handle interfaces in the generate-externs task

This commit is contained in:
Andreas Hocevar
2014-08-27 16:13:12 +02:00
parent 4e8abb62f9
commit e560f529c6
4 changed files with 31 additions and 10 deletions

View File

@@ -28,6 +28,7 @@ exports.publish = function(data, opts) {
[
{define: {isObject: true}},
{api: {isString: true}},
{'interface': {is: true}},
function() {
return this.meta && (/[\\\/]externs$/).test(this.meta.path);
}
@@ -40,6 +41,7 @@ exports.publish = function(data, opts) {
var defines = [];
var typedefs = [];
var externs = [];
var interfaces = [];
docs.filter(function(doc) {
var include = true;
var constructor = doc.memberof;
@@ -118,7 +120,7 @@ exports.publish = function(data, opts) {
return true;
});
}
var target = isExterns ? externs : symbols;
var target = isExterns ? externs : (doc.interface ? interfaces : symbols);
target.push(symbol);
}
});
@@ -128,7 +130,8 @@ exports.publish = function(data, opts) {
symbols: symbols,
defines: defines,
typedefs: typedefs,
externs: externs
externs: externs,
interfaces: interfaces
}, null, 2));
};