mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge pull request #22363 from DefinitelyTyped/not-needed-artyom.js
artyom.js: Provides its own types
This commit is contained in:
@@ -66,6 +66,12 @@
|
||||
"sourceRepoURL": "https://github.com/ranisalt/node-argon2",
|
||||
"asOfVersion": "0.15.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "artyom.js",
|
||||
"typingsPackageName": "artyom.js",
|
||||
"sourceRepoURL": "https://github.com/sdkcarlos/artyom.js",
|
||||
"asOfVersion": "1.0.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "askmethat-rating",
|
||||
"typingsPackageName": "askmethat-rating",
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import artyomjs = require('artyom.js');
|
||||
|
||||
// Get an unique ArtyomJS instance
|
||||
const 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();
|
||||
473
types/artyom.js/index.d.ts
vendored
473
types/artyom.js/index.d.ts
vendored
@@ -1,473 +0,0 @@
|
||||
// Type definitions for artyom.js 1.0
|
||||
// Project: https://github.com/sdkcarlos/artyom.js
|
||||
// Definitions by: Sema García (José Manuel García) <https://github.com/semagarcia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Extension of Window interface
|
||||
*/
|
||||
interface ArtyomWindow extends Window {
|
||||
webkitSpeechRecognition: any;
|
||||
SpeechRecognition: any;
|
||||
SpeechSynthesisUtterance: any;
|
||||
}
|
||||
|
||||
interface SpeechRecognition extends EventTarget {
|
||||
grammars: SpeechGrammarList;
|
||||
lang: string;
|
||||
continuous: boolean;
|
||||
interimResults: boolean;
|
||||
maxAlternatives: number;
|
||||
serviceURI: string;
|
||||
start(): void;
|
||||
stop(): void;
|
||||
abort(): void;
|
||||
onaudiostart(ev: Event): any;
|
||||
onsoundstart(ev: Event): any;
|
||||
onspeechstart(ev: Event): any;
|
||||
onspeechend(ev: Event): any;
|
||||
onsoundend(ev: Event): any;
|
||||
onresult(ev: SpeechRecognitionEvent): any;
|
||||
onnomatch(ev: SpeechRecognitionEvent): any;
|
||||
onerror(ev: SpeechRecognitionError): any;
|
||||
onstart(ev: Event): any;
|
||||
onend(ev: Event): any;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionStatic {
|
||||
prototype: SpeechRecognition;
|
||||
new (): SpeechRecognition;
|
||||
}
|
||||
|
||||
declare var SpeechRecognition: SpeechRecognitionStatic;
|
||||
declare var webkitSpeechRecognition: SpeechRecognitionStatic;
|
||||
|
||||
interface SpeechRecognitionError extends Event {
|
||||
error: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionAlternative {
|
||||
transcript: string;
|
||||
confidence: number;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionResult {
|
||||
length: number;
|
||||
item(index: number): SpeechRecognitionAlternative;
|
||||
[index: number]: SpeechRecognitionAlternative;
|
||||
isFinal: boolean;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionResultList {
|
||||
length: number;
|
||||
item(index: number): SpeechRecognitionResult;
|
||||
[index: number]: SpeechRecognitionResult;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionEvent extends Event {
|
||||
resultIndex: number;
|
||||
results: SpeechRecognitionResultList;
|
||||
interpretation: any;
|
||||
emma: Document;
|
||||
}
|
||||
|
||||
interface SpeechGrammar {
|
||||
src: string;
|
||||
weight: number;
|
||||
}
|
||||
|
||||
interface SpeechGrammarStatic {
|
||||
prototype: SpeechGrammar;
|
||||
new (): SpeechGrammar;
|
||||
}
|
||||
|
||||
declare var SpeechGrammar: SpeechGrammarStatic;
|
||||
declare var webkitSpeechGrammar: SpeechGrammarStatic;
|
||||
|
||||
interface SpeechGrammarList {
|
||||
length: number;
|
||||
item(index: number): SpeechGrammar;
|
||||
[index: number]: SpeechGrammar;
|
||||
addFromURI(src: string, weight: number): void;
|
||||
addFromString(string: string, weight: number): void;
|
||||
}
|
||||
|
||||
interface SpeechGrammarListStatic {
|
||||
prototype: SpeechGrammarList;
|
||||
new (): SpeechGrammarList;
|
||||
}
|
||||
|
||||
declare var SpeechGrammarList: SpeechGrammarListStatic;
|
||||
declare var webkitSpeechGrammarList: SpeechGrammarListStatic;
|
||||
|
||||
interface SpeechSynthesis extends EventTarget {
|
||||
pending: boolean;
|
||||
speaking: boolean;
|
||||
paused: boolean;
|
||||
|
||||
onvoiceschanged(ev: Event): any;
|
||||
speak(utterance: SpeechSynthesisUtterance): void;
|
||||
cancel(): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
getVoices(): SpeechSynthesisVoice[];
|
||||
}
|
||||
|
||||
interface SpeechSynthesisGetter {
|
||||
speechSynthesis: SpeechSynthesis;
|
||||
}
|
||||
|
||||
declare var speechSynthesis: SpeechSynthesis;
|
||||
|
||||
interface SpeechSynthesisUtterance extends EventTarget {
|
||||
text: string;
|
||||
lang: string;
|
||||
voice: SpeechSynthesisVoice;
|
||||
volume: number;
|
||||
rate: number;
|
||||
pitch: number;
|
||||
|
||||
onstart(ev: SpeechSynthesisEvent): any;
|
||||
onend(ev: SpeechSynthesisEvent): any;
|
||||
onerror(ev: SpeechSynthesisErrorEvent): any;
|
||||
onpause(ev: SpeechSynthesisEvent): any;
|
||||
onresume(ev: SpeechSynthesisEvent): any;
|
||||
onmark(ev: SpeechSynthesisEvent): any;
|
||||
onboundary(ev: SpeechSynthesisEvent): any;
|
||||
}
|
||||
|
||||
interface SpeechSynthesisUtteranceStatic {
|
||||
prototype: SpeechSynthesisUtterance;
|
||||
new (text?: string): SpeechSynthesisUtterance;
|
||||
}
|
||||
|
||||
declare var SpeechSynthesisUtterance: SpeechSynthesisUtteranceStatic;
|
||||
|
||||
interface SpeechSynthesisEvent extends Event {
|
||||
utterance: SpeechSynthesisUtterance;
|
||||
charIndex: number;
|
||||
elapsedTime: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface SpeechSynthesisVoice {
|
||||
voiceURI: string;
|
||||
name: string;
|
||||
lang: string;
|
||||
localService: boolean;
|
||||
default: boolean;
|
||||
}
|
||||
|
||||
declare namespace Artyom {
|
||||
interface ArtyomDevice {
|
||||
isChrome(): boolean;
|
||||
isMobile(): boolean;
|
||||
}
|
||||
|
||||
interface ArtyomBrowserVoiceObject {
|
||||
default: boolean;
|
||||
lang: string;
|
||||
localService: false;
|
||||
name: string;
|
||||
voiceURI: string;
|
||||
}
|
||||
|
||||
interface ArtyomConfigProperties {
|
||||
/** Set the default language of artyom with this property */
|
||||
lang?: string;
|
||||
recognizing?: boolean;
|
||||
/** Choose if should listen one command and then stops, or listening forever */
|
||||
continuous?: boolean;
|
||||
/** Moderates the speed with which Artyom talks (0 ~ 1) */
|
||||
speed?: number;
|
||||
/** Adjust the volume of the voice of artyom */
|
||||
volume?: number;
|
||||
/** If listen is equal to true the voice recognition will be started otherwise this property can be ignored */
|
||||
listen: boolean;
|
||||
/** Recognition mode: normal, quick, remote */
|
||||
mode?: string;
|
||||
/** Displays all the grammars recognized in the console */
|
||||
debug: boolean;
|
||||
helpers?: {
|
||||
redirectRecognizedTextOutput: any;
|
||||
remoteProcessorHandler: any;
|
||||
lastSay: any;
|
||||
};
|
||||
/** Set a keyword that allows your command to be executed immediately when you say this word (Useful in noisy environments) */
|
||||
executionKeyword?: string;
|
||||
/** Set a keyword that allows to enable the command recognition automatically if this word is recognized while artyom is paused (artyom.dontObey) */
|
||||
obeyKeyword?: string;
|
||||
speaking?: boolean;
|
||||
obeying?: boolean;
|
||||
soundex?: boolean;
|
||||
}
|
||||
|
||||
interface ArtyomCommand {
|
||||
/** Triggers of the command */
|
||||
indexes: string[];
|
||||
/** Logic to execute when the command is triggered */
|
||||
action(i: number, wildcard?: string, full?: string): void;
|
||||
/** Description of the command */
|
||||
description?: string;
|
||||
/** Flag to specify is a command is either normal or smart */
|
||||
smart?: boolean;
|
||||
}
|
||||
|
||||
interface ArtyomFlags {
|
||||
restartRecognition: boolean;
|
||||
}
|
||||
|
||||
interface ArtyomRecognizer {
|
||||
lang: string;
|
||||
continuous: boolean;
|
||||
interimResults: boolean;
|
||||
start(): void;
|
||||
stop(): void;
|
||||
onstart(): void;
|
||||
onresult(event: any): void;
|
||||
onerror(event: any): void;
|
||||
onend(): void;
|
||||
}
|
||||
|
||||
interface ArtyomJS {
|
||||
/**
|
||||
* Contains some basic information that artyom needs to know as the type of device and browser
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/6/read-doc/artyom-device/artyom-js
|
||||
*/
|
||||
device: ArtyomDevice;
|
||||
|
||||
/**
|
||||
* Object which provides the speech interface, and set some of its attributes and event handlers
|
||||
*/
|
||||
artyomWSR: ArtyomRecognizer;
|
||||
|
||||
/**
|
||||
* Artyom can return inmediately the voices available in your browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js
|
||||
*/
|
||||
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
|
||||
*/
|
||||
getAvailableCommands(): ArtyomCommand[];
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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
|
||||
*/
|
||||
emptyCommands(): ArtyomCommand[];
|
||||
|
||||
/**
|
||||
* Stops the actual and pendings messages that artyom have to say.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/23/read-doc/artyom-shutup/artyom-js
|
||||
*/
|
||||
shutUp(): void;
|
||||
|
||||
/**
|
||||
* Returns an object with the actual properties of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js
|
||||
*/
|
||||
getProperties(): ArtyomConfigProperties;
|
||||
|
||||
/**
|
||||
* Create a listener when an artyom action is called.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/24/read-doc/artyom-when/artyom-js
|
||||
*/
|
||||
when(event: any, action: any): any;
|
||||
|
||||
/**
|
||||
* 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 Language
|
||||
*/
|
||||
getLanguage(): string;
|
||||
|
||||
/**
|
||||
* Talks a text according to the given parameters (private function).
|
||||
* @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 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 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 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;
|
||||
|
||||
/**
|
||||
* Verify if the browser supports speechSynthesis.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js
|
||||
*/
|
||||
speechSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Verify if the browser supports webkitSpeechRecognition.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js
|
||||
*/
|
||||
recognizingSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Simulate a voice command via JS.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js
|
||||
*/
|
||||
simulateInstruction(sentence: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns an object with data of the matched element.
|
||||
* @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 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.
|
||||
*/
|
||||
redirectRecognizedTextOutput(action: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Says a random quote and returns it's object.
|
||||
*/
|
||||
sayRandom(data: any): any;
|
||||
|
||||
/**
|
||||
* Artyom provide an easy way to create a dictation for your user. Just create an instance and start and stop when you want.
|
||||
*/
|
||||
newDictation(settings: any): any;
|
||||
|
||||
/**
|
||||
* A voice prompt will be executed.
|
||||
*/
|
||||
newPrompt(config: any): any;
|
||||
|
||||
/**
|
||||
* Artyom awaits for orders when this function is executed. If artyom gets a first parameter the instance will be stopped.
|
||||
*/
|
||||
artyomHey(): any;
|
||||
|
||||
/**
|
||||
* This function will return the webkitSpeechRecognition object used by artyom retrieve it only to debug on it or get some
|
||||
* values, do not make changes directly.
|
||||
*/
|
||||
getNativeApi(): any;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
isRecognizing(): boolean;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
clearGarbageCollection(): any;
|
||||
|
||||
/**
|
||||
* Returns the SpeechSynthesisUtterance garbageobjects.
|
||||
*/
|
||||
getGarbageCollection(): any;
|
||||
|
||||
/**
|
||||
* Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds.
|
||||
*/
|
||||
dontObey(): any;
|
||||
|
||||
/**
|
||||
* Allow artyom to obey commands again.
|
||||
*/
|
||||
obey(): any;
|
||||
|
||||
/**
|
||||
* A boolean to check if artyom is obeying commands or not.
|
||||
*/
|
||||
isObeying(): boolean;
|
||||
|
||||
/**
|
||||
* Process the recognized text if artyom is active in remote mode.
|
||||
*/
|
||||
remoteProcessorService(action: any): any;
|
||||
|
||||
/**
|
||||
* Returns a string with the actual version of Artyom script.
|
||||
*/
|
||||
getVersion(): string;
|
||||
|
||||
/**
|
||||
* Add commands like an artisan. If you use artyom for simple
|
||||
* 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.
|
||||
*/
|
||||
on(indexes: any, smart: any): any;
|
||||
}
|
||||
|
||||
class ArtyomBuilder {
|
||||
static getInstance(): ArtyomJS;
|
||||
}
|
||||
}
|
||||
|
||||
export = Artyom;
|
||||
export as namespace Artyom;
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"noImplicitThis": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"artyom.js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODOs
|
||||
"export-just-namespace": false,
|
||||
"no-unnecessary-class": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user