# @types/react-speech-recognition

> TypeScript definitions for react-speech-recognition

Latest version **3.9.6** (published 2025-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/react-speech-recognition
pnpm add @types/react-speech-recognition
yarn add @types/react-speech-recognition
bun add @types/react-speech-recognition
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.9.6 |
| Published | 2025-01-14 |
| First published | 2020-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51436 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/react-speech-recognition
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-speech-recognition
- npm.io page: https://npm.io/package/@types/react-speech-recognition

## Dependencies (1)

- [@types/dom-speech-recognition](https://npm.io/package/@types/dom-speech-recognition.md) *

## Recent versions

- 3.9.6 (latest) — 2025-01-14
- 3.9.5 (ts4.5) — 2023-11-21
- 3.9.2 (ts4.4) — 2023-04-16
- 3.9.0 (ts3.8) — 2021-12-26
- 3.6.1 (ts3.6) — 2021-07-08
- 3.6.0 (ts3.4) — 2021-01-13
- 3.1.0 (ts3.1) — 2020-08-13
- 3.9.4 — 2023-11-07
- 3.9.3 — 2023-10-18
- 3.9.1 — 2023-03-14

## README

# Installation
> `npm install --save @types/react-speech-recognition`

# Summary
This package contains type definitions for react-speech-recognition (https://github.com/JamesBrill/react-speech-recognition#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-speech-recognition.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-speech-recognition/index.d.ts)
````ts
/// <reference types="dom-speech-recognition" />

interface Command {
    command: string | string[] | RegExp;
    callback: (...args: any[]) => unknown;
    isFuzzyMatch?: boolean | undefined;
    matchInterim?: boolean | undefined;
    fuzzyMatchingThreshold?: number | undefined;
    bestMatchOnly?: boolean | undefined;
}

export interface ListeningOptions {
    continuous?: boolean | undefined;
    interimResults?: boolean | undefined;
    language?: string | undefined;
}

interface SpeechRecognition {
    getRecognition(): globalThis.SpeechRecognition | null;
    startListening(options?: ListeningOptions): Promise<void>;
    stopListening(): Promise<void>;
    abortListening(): Promise<void>;
    browserSupportsSpeechRecognition(): boolean;
    applyPolyfill(speechRecognitionPolyfill: any): void;
}

export interface SpeechRecognitionOptions {
    transcribing?: boolean | undefined;
    clearTranscriptOnListen?: boolean | undefined;
    commands?: readonly Command[] | undefined;
}

export function useSpeechRecognition(options?: SpeechRecognitionOptions): {
    transcript: string;
    interimTranscript: string;
    finalTranscript: string;
    listening: boolean;
    resetTranscript: () => void;
    browserSupportsSpeechRecognition: boolean;
    browserSupportsContinuousListening: boolean;
    isMicrophoneAvailable: boolean;
};

declare const SpeechRecognition: SpeechRecognition;

export default SpeechRecognition;

````

### Additional Details
 * Last updated: Tue, 14 Jan 2025 08:35:45 GMT
 * Dependencies: [@types/dom-speech-recognition](https://npmjs.com/package/@types/dom-speech-recognition)

# Credits
These definitions were written by [OleksandrYehorov](https://github.com/OleksandrYehorov).

---
_Source: https://npm.io/package/@types/react-speech-recognition · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
