Skip to content

Commit

Permalink
[FRAME-5] Generate TypeScript definitions from docs (#9936)
Browse files Browse the repository at this point in the history
* [FRAME-5] Generate TypeScript definitions from docs

* [FRAME-5] Remove unused method

* [FRAME-5] Allow string values as point coordinates

In various places a point needs to be described in devie specific units or as a percent value for which we need string values.

* Remove unnecessary quotes

* [FRAME-5] Use method overloads and use inheritance where possible

* [FRAME-5] Use default array type for rest parameters

* Add more JSDocs

* [FRAME-5] Use correct path for index.d.ts output file
  • Loading branch information
janvennemann authored and sgtcoolguy committed Apr 23, 2018
1 parent 2178aa0 commit b291bd7
Show file tree
Hide file tree
Showing 5 changed files with 858 additions and 4 deletions.
1 change: 1 addition & 0 deletions apidoc/Titanium/UI/Tab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ methods:
Identical to the `options` parameter to [Window.open](Titanium.UI.Window.open).
iOS only supports the **animated** parameter.
type: Object
optional: true

- name: close
summary: Closes the top-level window for this tab.
Expand Down
7 changes: 4 additions & 3 deletions apidoc/Titanium/UI/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ methods:
- name: callback
summary: Function to be invoked upon completion of the animation.
type: Callback<Object>
optional: true

- name: finishLayout
since: "2.0.0"
Expand Down Expand Up @@ -1088,7 +1089,7 @@ properties:
{ x: 30, y: 30 }
Or:
{ x: '50%', y: '50%' }
When specifying multiple colors, you can specify an *offset* value for each color, defining
Expand Down Expand Up @@ -1769,11 +1770,11 @@ since: "1.8.0"
platforms: [android, iphone, ipad]
properties:
- name: x
type: Number
type: [Number, String]
summary: The x-axis coordinate of this point.

- name: y
type: Number
type: [Number, String]
summary: The y-axis coordinate of this point.
---
name: Gradient
Expand Down
3 changes: 3 additions & 0 deletions apidoc/docgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,9 @@ formats.forEach(function (format) {
case 'solr' :
render = JSON.stringify(exportData, null, ' ');
output = pathMod.join(outputPath, 'api_solr.json');
case 'typescript':
render = exportData;
output = pathMod.join(outputPath, 'index.d.ts');
}

if (!~[ 'addon' ].indexOf(format)) {
Expand Down

0 comments on commit b291bd7

Please sign in to comment.