titanium-es

1.1.2 • Public • Published

titanium-es

Generates a modern ECMAScript wrapper for Titanium API

Generate Wrappers

import TitaniumES from 'titanium-es';

await TitaniumES.generate('api.jsca', 'output');

Example

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();

Package Sidebar

Install

npm i titanium-es

Weekly Downloads

1

Version

1.1.2

License

Apache-2.0

Unpacked Size

34.1 kB

Total Files

7

Last publish

Collaborators

  • gmathews_axway