https://github.com/tidev/titanium-es
Generates a modern ECMAScript wrapper for Titanium API
https://github.com/tidev/titanium-es
npm-package
Last synced: about 1 month ago
JSON representation
Generates a modern ECMAScript wrapper for Titanium API
- Host: GitHub
- URL: https://github.com/tidev/titanium-es
- Owner: tidev
- License: other
- Created: 2020-01-16T00:50:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T05:46:07.000Z (over 2 years ago)
- Last Synced: 2025-04-24T15:22:40.651Z (2 months ago)
- Topics: npm-package
- Language: JavaScript
- Homepage:
- Size: 201 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![]()
titanium-es
Generates a modern ECMAScript wrapper for Titanium API
### Generate Wrappers
```JS
import TitaniumES from 'titanium-es';await TitaniumES.generate('api.jsca', 'output');
```#### Example
```JS
import UI from 'Titanium/UI';
const { Window, Label, View, Animation, Matrix2D } = UI;const window = new Window({
title: 'Titanium-ECMAScript',
layout: 'vertical',
backgroundColor: 'gray'
});
const label = new Label({
color: 'white',
font: {
fontSize: '32'
},
text: 'Titanium-ECMAScript!'
});
const view = new View({
backgroundColor: 'red',
width: 100,
height: 100
});
const matrix = new Matrix2D({
rotate: 90
});
const animation = new Animation({
transform: matrix,
duration: 3000
});window.addEventListener('open', async _ => {
try {
await view.animate(animation);view.backgroundColor = 'orange';
alert('DONE ANIMATION!');
} catch (e) {
console.error(e);
}
});window.add([ label, view ]);
window.open();
```