TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Incomplete SpeechRecognition declarations

Open jozefchutka opened this issue 2 years ago • 0 comments

SpeechRecognition related:

// https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition
interface SpeechRecognition extends EventTarget {
	continuous:boolean;
	lang:string;
	interimResults:boolean;
	maxAlternatives:number;

	start():void;
	stop():void;

	addEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: FontFaceSet, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
	addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
	removeEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: FontFaceSet, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
	removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}

class SpeechRecognitionEvent extends Event {
	readonly resultIndex:number;
	readonly results:SpeechRecognitionResultList;
}

interface SpeechRecognitionEventMap {
	result:SpeechRecognitionEvent;
}

var SpeechRecognition: {
	prototype: SpeechRecognition;
	new(): SpeechRecognition;
}

interface Window {
	readonly SpeechRecognition?:SpeechRecognition;
	readonly webkitSpeechRecognition?:SpeechRecognition;
}

jozefchutka avatar May 08 '23 07:05 jozefchutka