Skip to content

⬅️ Back to Table of Contents

📄 useSpeechRecognition/types

📊 Analysis Summary

Metric Count
📐 Interfaces 8
📑 Type Aliases 1

📚 Table of Contents

🛠️ File Location:

📂 packages/core/useSpeechRecognition/types.ts

Interfaces

SpeechRecognitionErrorEventInit

Interface Code
export interface SpeechRecognitionErrorEventInit extends EventInit {
  error: SpeechRecognitionErrorCode
  message?: string
}

Properties

Name Type Optional Description
error SpeechRecognitionErrorCode not shown
message string not shown

SpeechRecognitionEventInit

Interface Code
export interface SpeechRecognitionEventInit extends EventInit {
  resultIndex?: number
  results: SpeechRecognitionResultList
}

Properties

Name Type Optional Description
resultIndex number not shown
results SpeechRecognitionResultList not shown

SpeechGrammar

Interface Code
interface SpeechGrammar {
  src: string
  weight: number
}

Properties

Name Type Optional Description
src string not shown
weight number not shown

SpeechGrammarList

Interface Code
interface SpeechGrammarList {
  readonly length: number
  addFromString: (string: string, weight?: number) => void
  addFromURI: (src: string, weight?: number) => void
  item: (index: number) => SpeechGrammar
  [index: number]: SpeechGrammar
}

Properties

Name Type Optional Description
length number not shown
addFromString (string: string, weight?: number) => void not shown
addFromURI (src: string, weight?: number) => void not shown
item (index: number) => SpeechGrammar not shown

SpeechRecognitionErrorEvent

Interface Code
export interface SpeechRecognitionErrorEvent extends Event {
  readonly error: SpeechRecognitionErrorCode
  readonly message: string
}

Properties

Name Type Optional Description
error SpeechRecognitionErrorCode not shown
message string not shown

SpeechRecognitionEvent

Interface Code
interface SpeechRecognitionEvent extends Event {
  readonly resultIndex: number
  readonly results: SpeechRecognitionResultList
}

Properties

Name Type Optional Description
resultIndex number not shown
results SpeechRecognitionResultList not shown

SpeechRecognitionEventMap

Interface Code
interface SpeechRecognitionEventMap {
  audioend: Event
  audiostart: Event
  end: Event
  error: SpeechRecognitionErrorEvent
  nomatch: SpeechRecognitionEvent
  result: SpeechRecognitionEvent
  soundend: Event
  soundstart: Event
  speechend: Event
  speechstart: Event
  start: Event
}

Properties

Name Type Optional Description
audioend Event not shown
audiostart Event not shown
end Event not shown
error SpeechRecognitionErrorEvent not shown
nomatch SpeechRecognitionEvent not shown
result SpeechRecognitionEvent not shown
soundend Event not shown
soundstart Event not shown
speechend Event not shown
speechstart Event not shown
start Event not shown

SpeechRecognition

Interface Code
export interface SpeechRecognition extends EventTarget {
  continuous: boolean
  grammars: SpeechGrammarList
  interimResults: boolean
  lang: string
  maxAlternatives: number
  onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null
  onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null
  onend: ((this: SpeechRecognition, ev: Event) => any) | null
  onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) | null
  onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null
  onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null
  onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null
  onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null
  onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null
  onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null
  onstart: ((this: SpeechRecognition, ev: Event) => any) | null
  abort: () => void
  start: () => void
  stop: () => void
  addEventListener: (<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void)
  removeEventListener: (<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void)
}

Properties

Name Type Optional Description
continuous boolean not shown
grammars SpeechGrammarList not shown
interimResults boolean not shown
lang string not shown
maxAlternatives number not shown
onaudioend ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onaudiostart ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onend ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onerror ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) \| null not shown
onnomatch ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) \| null not shown
onresult ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) \| null not shown
onsoundend ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onsoundstart ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onspeechend ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onspeechstart ((this: SpeechRecognition, ev: Event) => any) \| null not shown
onstart ((this: SpeechRecognition, ev: Event) => any) \| null not shown
abort () => void not shown
start () => void not shown
stop () => void not shown
addEventListener (<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: Speech... not shown
removeEventListener (<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: Speech... not shown

Type Aliases

SpeechRecognitionErrorCode

type SpeechRecognitionErrorCode = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed';

Generated by Syntax Scribe