Skip to content

Commit

Permalink
docs(typescript): update sdk version in typescript definition header (#…
Browse files Browse the repository at this point in the history
…10822)

* docs(typescript): update sdk version in typescript definition header
* ensure generated typescript def file passing linting
* docs(typescript): mark as non-npm package
Done by DefinitelyTyped maintainer in DefinitelyTyped/DefinitelyTyped@608c146#diff-948841420dd57be7be5d9d21fe002f4c so we should keep this
  • Loading branch information
ewanharris authored and sgtcoolguy committed Jun 6, 2019
1 parent 3f49d79 commit 35f281f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apidoc/Titanium/UI/ShortcutItem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ methods:
platforms: [android]

- name: pin
description: Pin shortcut to launcher.
summary: Pin shortcut to launcher.
platforms: [android]
osver: {android: {min: "8.0"}}

Expand All @@ -34,13 +34,13 @@ properties:
availability: creation

- name: title
description: Title of the shortcut.
summary: Title of the shortcut.
type: String
platforms: [android]
availability: creation

- name: description
description: Description of the shortcut.
summary: Description of the shortcut.
type: String
platforms: [android]
availability: creation
Expand Down
4 changes: 2 additions & 2 deletions apidoc/Titanium/UI/WebView.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ methods:
parameters:
- name: propertyList
summary: List of properties for listen.
type: Array
type: Array<String>

- name: stopListeningToProperties
summary: Remove native properties from observing.
Expand All @@ -306,7 +306,7 @@ methods:
parameters:
- name: propertyList
summary: List of properties to remove.
type: Array
type: Array<String>

- name: takeSnapshot
summary: Takes a snapshot of the view's visible viewport.
Expand Down
9 changes: 5 additions & 4 deletions apidoc/lib/typescript_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,17 @@ class GlobalTemplateWriter {
/**
* Writes the type definition header required by DefinitelyTyped.
*
* @todo Automatically update the Titanium version string.
*/
writeHeader() {
this.output += '// Type definitions for Titanium 7.1\n';
const { version } = require('../../package.json');
const versionSplit = version.split('.');
const majorMinor = `${versionSplit[0]}.${versionSplit[1]}`;
this.output += `// Type definitions for non-npm package Titanium ${majorMinor}\n`;
this.output += '// Project: https://github.com/appcelerator/titanium_mobile\n';
this.output += '// Definitions by: Axway Appcelerator <https://github.com/appcelerator>\n';
this.output += '// Jan Vennemann <https://github.com/janvennemann>\n';
this.output += '// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\n';
this.output += '// TypeScript Version: 2.6\n';
this.output += '\n';
}

/**
Expand Down Expand Up @@ -380,7 +381,7 @@ class GlobalTemplateWriter {
if (interfaceNode.methods.length > 0) {
interfaceNode.methods.forEach(methodNode => this.writeMethodNode(methodNode, nestingLevel + 1));
}
this.output += `${this.indent(nestingLevel)}}\n\n`;
this.output += `${this.indent(nestingLevel)}}\n`;
}

/**
Expand Down

0 comments on commit 35f281f

Please sign in to comment.