mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
artyom.js: Fix lint (#20851)
This commit is contained in:
58
types/artyom.js/index.d.ts
vendored
58
types/artyom.js/index.d.ts
vendored
@@ -249,14 +249,12 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Artyom can return inmediately the voices available in your browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js
|
||||
* @returns {Array}
|
||||
*/
|
||||
getVoices(): SpeechSynthesisVoice[];
|
||||
|
||||
/**
|
||||
* Returns an array with all the available commands for artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/10/read-doc/artyom-getavailablecommands/artyom-js
|
||||
* @returns {Array}
|
||||
*/
|
||||
getAvailableCommands(): ArtyomCommand[];
|
||||
|
||||
@@ -264,38 +262,30 @@ declare namespace Artyom {
|
||||
* Set up artyom for the application. This function will set the default language used by artyom
|
||||
* or notice the user if artyom is not supported in the actual browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/15/read-doc/artyom-initialize/artyom-js
|
||||
* @param {ArtyomConfigProperties} config
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
initialize(config: ArtyomConfigProperties): boolean;
|
||||
|
||||
/**
|
||||
* Force artyom to stop listen even if is in continuos mode.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/9/read-doc/artyom-fatality/artyom-js
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
fatality(): boolean;
|
||||
|
||||
/**
|
||||
* Add dinamically commands to artyom using. You can even add commands while artyom is active.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/4/read-doc/artyom-addcommands/artyom-js
|
||||
* @param {ArtyomCommand | Array[ArtyomCommand]} newCommand
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
addCommands(newCommand: ArtyomCommand | ArtyomCommand[]): boolean;
|
||||
|
||||
/**
|
||||
* Remove the commands of artyom with indexes that matches with the given text.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/19/read-doc/artyom-removecommands/artyom-js
|
||||
* @param {string} identifier
|
||||
* @returns {Array}
|
||||
*/
|
||||
removeCommands(identifier: string): number[];
|
||||
|
||||
/**
|
||||
* Removes all the added commands of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/7/read-doc/artyom-emptycommands/artyom-js
|
||||
* @returns {Array}
|
||||
*/
|
||||
emptyCommands(): ArtyomCommand[];
|
||||
|
||||
@@ -308,7 +298,6 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Returns an object with the actual properties of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js
|
||||
* @returns {ArtyomConfigProperties}
|
||||
*/
|
||||
getProperties(): ArtyomConfigProperties;
|
||||
|
||||
@@ -321,37 +310,34 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Returns the code language of artyom according to initialize function.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/11/read-doc/artyom-getlanguage/artyom-js
|
||||
* @returns {String} Language
|
||||
* @returns Language
|
||||
*/
|
||||
getLanguage(): string;
|
||||
|
||||
/**
|
||||
* Talks a text according to the given parameters (private function).
|
||||
* @param {String} text Text to be spoken
|
||||
* @param {Int} actualChunk Number of chunk of the
|
||||
* @param {Int} totalChunks
|
||||
* @param {any} callbacks
|
||||
* @param text Text to be spoken
|
||||
* @param actualChunk Number of chunk of the
|
||||
*/
|
||||
artyomTalk(text: any, actualChunk: any, totalChunks: any, callbacks: any): any;
|
||||
|
||||
/**
|
||||
* Splits a string into an array of strings with a limited size (chunk_length).
|
||||
* @param {String} input text to split into chunks
|
||||
* @param {Integer} chunk_length limit of characters in every chunk
|
||||
* @param input text to split into chunks
|
||||
* @param chunk_length limit of characters in every chunk
|
||||
*/
|
||||
splitStringByChunks(input: any, chunk_length: any): string[];
|
||||
|
||||
/**
|
||||
* Process the given text into chunks and execute the private function artyom_talk.
|
||||
* @param {String} message Text to be spoken
|
||||
* @param {Object} callbacks { onStart, onEnd }
|
||||
* @param message Text to be spoken
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/20/read-doc/artyom-say/artyom-js
|
||||
*/
|
||||
say(message: any, callbacks: any): void;
|
||||
|
||||
/**
|
||||
* Repeats the last sentence that artyom said. Useful in noisy environments.
|
||||
* @param {Boolean} returnObject If set to true, an object with the text and the timestamp when was executed will be returned.
|
||||
* @param returnObject If set to true, an object with the text and the timestamp when was executed will be returned.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/25/read-doc/artyom-repeatlastsay/artyom-js
|
||||
*/
|
||||
repeatLastSay(returnObject: any): void;
|
||||
@@ -359,50 +345,42 @@ declare namespace Artyom {
|
||||
/**
|
||||
* Verify if the browser supports speechSynthesis.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
speechSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Verify if the browser supports webkitSpeechRecognition.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
recognizingSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Simulate a voice command via JS.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js
|
||||
* @param {string} sentence
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
simulateInstruction(sentence: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns an object with data of the matched element.
|
||||
* @param {string} voiceCommand
|
||||
* @returns {Object | Function}. There is a result field when the function should return a boolean value.
|
||||
* @returns . There is a result field when the function should return a boolean value.
|
||||
*/
|
||||
artyomExecute(voiceCommand: string): any;
|
||||
|
||||
/**
|
||||
* Displays a message in the console if the artyom propery DEBUG is set to true.
|
||||
* @param {string} error The error to be debugged
|
||||
* @param {string} traceLevel Error level: { error | warn | info }
|
||||
* @param error The error to be debugged
|
||||
* @param traceLevel Error level: { error | warn | info }
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/38/read-doc/artyom-debug/artyom-js
|
||||
*/
|
||||
debug(stringEvent: string, traceLevel: string): void;
|
||||
|
||||
/**
|
||||
* Allows to retrieve the recognized spoken text of artyom and do something with it everytime something is recognized.
|
||||
* @param {Function} action
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
redirectRecognizedTextOutput(action: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Says a random quote and returns it's object.
|
||||
* @param data
|
||||
*/
|
||||
sayRandom(data: any): any;
|
||||
|
||||
@@ -431,7 +409,6 @@ declare namespace Artyom {
|
||||
* This function returns a boolean according to the SpeechRecognition status if artyom is listening, will return true.
|
||||
* Note: This is not a feature of SpeechRecognition, therefore this value hangs on the fiability of the onStart and onEnd
|
||||
* events of the SpeechRecognition
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isRecognizing(): boolean;
|
||||
|
||||
@@ -439,14 +416,12 @@ declare namespace Artyom {
|
||||
* This function returns a boolean according to the speechSynthesis status if artyom is speaking, will return true.
|
||||
* Note: This is not a feature of speechSynthesis, therefore this value hangs on the fiability of the onStart and onEnd
|
||||
* events of the speechSynthesis.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isSpeaking(): boolean;
|
||||
|
||||
/**
|
||||
* The SpeechSynthesisUtterance objects are stored in the artyom_garbage_collector variable to prevent the wrong behaviour
|
||||
* of artyom.say. Use this method to clear all spoken SpeechSynthesisUtterance unused objects.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
clearGarbageCollection(): any;
|
||||
|
||||
@@ -457,31 +432,26 @@ declare namespace Artyom {
|
||||
|
||||
/**
|
||||
* Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
dontObey(): any;
|
||||
|
||||
/**
|
||||
* Allow artyom to obey commands again.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
obey(): any;
|
||||
|
||||
/**
|
||||
* A boolean to check if artyom is obeying commands or not.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isObeying(): boolean;
|
||||
|
||||
/**
|
||||
* Process the recognized text if artyom is active in remote mode.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
remoteProcessorService(action: any): any;
|
||||
|
||||
/**
|
||||
* Returns a string with the actual version of Artyom script.
|
||||
* @returns {String}
|
||||
*/
|
||||
getVersion(): string;
|
||||
|
||||
@@ -490,22 +460,14 @@ declare namespace Artyom {
|
||||
* tasks then probably you don't like to write a lot to achieve it.
|
||||
* Use the artisan syntax to write less, but with the same accuracy.
|
||||
* @disclaimer Not a promise-based implementation, just syntax.
|
||||
* @returns {Object}
|
||||
*/
|
||||
on(indexes: any, smart: any): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* ArtyomBuilder bla, bla...
|
||||
*/
|
||||
class ArtyomBuilder {
|
||||
/**
|
||||
* Method to bla, bla, bla...
|
||||
*/
|
||||
static getInstance(): ArtyomJS;
|
||||
}
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:export-just-namespace
|
||||
export = Artyom;
|
||||
export as namespace Artyom;
|
||||
|
||||
@@ -1 +1,8 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODOs
|
||||
"export-just-namespace": false,
|
||||
"no-unnecessary-class": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user