Files
DefinitelyTyped/artyom.js/artyom.js-tests.ts
Sema 9001e6d0ef artyom.js - Created typescript definition file (#13947)
* Initial version of types for artyom.js

* Added headers and documentation

* Removed tslint exception

In local, the npm run lint said that this header is not allowed, but in travis seems to work

* Added "noImplicitThis": true,

* Added MAJOR.MINOR to .d.ts header
2017-01-17 16:24:32 -08:00

32 lines
703 B
TypeScript

import artyomjs = require('artyom.js');
// Get an unique ArtyomJS instance
let artyom = artyomjs.ArtyomBuilder.getInstance();
// Add a command (not smart)
artyom.addCommands({
description: 'Test command',
indexes: ['hello', 'hi'],
action: (i: number) => {
console.log('hello action');
}
});
// Add a smart command
artyom.addCommands({
description: 'Test command 2',
smart: true,
indexes: ['test *'],
action: (i: number, wildcard: string) => {
console.log('wildcard: ', wildcard);
}
});
// Get the browser voices
artyom.getVoices();
// Get all supported languages for Artyom
artyom.getLanguage();
// Get the artyom.js version
artyom.getVersion();