Skip to content

Commit

Permalink
feat(docgen): typescript: inject "id" prop into "Ti.Proxy"
Browse files Browse the repository at this point in the history
  • Loading branch information
drauggres committed Dec 18, 2019
1 parent 572c478 commit 3eecc87
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/titanium-docgen/generators/typescript_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,21 @@ class InterfaceNode extends MemberNode {
this.parseProperties(typeDoc.properties);
this.parseMethods(typeDoc.methods);
}
// FIXME: Ti.Proxy has no documented "id" property
// currently if we put it in docs - accessors methods will show up in
// every class extended from Ti.Proxy
if (this.fullyQualifiedName === 'Titanium.Proxy') {
const array = this.properties.filter(prop => prop.name === 'id');
if (!array.length) {
// injecting "id" property into "Titanium.Proxy"
this.properties.push(new VariableNode({
name: 'id',
optional: true,
summary: 'Proxy identifier',
type: 'string | number'
}, false));
}
}
}

filterProperties(propertyDoc) {
Expand Down

0 comments on commit 3eecc87

Please sign in to comment.