Skip to content

Commit 40af716

Browse files
committed
Add @interface support
1 parent e9d17e8 commit 40af716

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/parse.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ var flatteners = {
7979
'instance': function (result) {
8080
result.scope = 'instance';
8181
},
82-
// 'interface'
82+
'interface': function (result, tag) {
83+
result.interface = true;
84+
if (tag.description) {
85+
result.name = tag.description;
86+
}
87+
},
8388
'kind': function (result, tag) {
8489
result.kind = tag.kind;
8590
},

test/lib/parse.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,18 @@ test('parse - @instance', function (t) {
254254
t.end();
255255
});
256256

257+
test('parse - @interface', function (t) {
258+
t.deepEqual(evaluate(function () {
259+
/** @interface */
260+
})[0].interface, true, 'anonymous');
261+
262+
t.deepEqual(evaluate(function () {
263+
/** @interface Foo */
264+
})[0].name, 'Foo', 'named');
265+
266+
t.end();
267+
});
268+
257269
test('parse - @kind', function (t) {
258270
t.equal(evaluate(function () {
259271
/** @kind class */

0 commit comments

Comments
 (0)