@types/hark
TypeScript icon, indicating that this package has built-in type declarations

1.2.5 • Public • Published

Installation

npm install --save @types/hark

Summary

This package contains type definitions for hark (https://github.com/otalk/hark).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hark.

index.d.ts

export = hark;

declare function hark(stream: HTMLAudioElement | HTMLVideoElement | MediaStream, option?: hark.Option): hark.Harker;

declare namespace hark {
    interface Option {
        smoothing?: number | undefined;
        interval?: number | undefined;
        threshold?: number | undefined;
        play?: boolean | undefined;
        history?: number | undefined;
        audioContext?: AudioContext | undefined;
    }

    interface Harker {
        speaking: boolean;
        suspend(): Promise<void>;
        resume(): Promise<void>;
        readonly state: AudioContextState;
        setThreshold(t: number): void;
        setInterval(i: number): void;
        stop(): void;
        speakingHistory: number[];

        on(event: "speaking" | "stopped_speaking", listener: () => void): void;
        on(event: "volume_change", listener: (currentVolume: number, threshold: number) => void): void;
        on(event: "state_change", listener: (state: AudioContextState) => void): void;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by baiyufei.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/hark

Weekly Downloads

10,497

Version

1.2.5

License

MIT

Unpacked Size

4.49 kB

Total Files

5

Last publish

Collaborators

  • types