npm.io
1.1.2 • Published 2 years ago

@types/play-sound

Licence
MIT
Version
1.1.2
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/play-sound

Summary

This package contains type definitions for play-sound (https://github.com/shime/play-sound).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/play-sound.

index.d.ts

/// <reference types="node" />

import { ChildProcess, ExecException } from "child_process";

type Players = "mplayer" | "afplay" | "mpg123" | "mpg321" | "play" | "omxplayer" | "aplay" | "cmdmp3";

interface PlayOpts {
    players: Players[];
    player: Players;
}

type PlayMethodOptions = Partial<
    {
        [key in Players]: Array<string | number>;
    } & {
        timeout: number;
    }
>;

declare class Play {
    constructor(opts?: Partial<PlayOpts>);

    player: unknown;
    players: Players[];
    urlRegex: RegExp;

    play(what: string, options?: PlayMethodOptions, next?: (err: ExecException) => void): ChildProcess;
    play(what: string, next?: (err: ExecException) => void): ChildProcess;

    test(next?: (err: ExecException) => void): ChildProcess;
}

declare function defaultExport(opts?: Partial<PlayOpts>): Play;

export = defaultExport;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Corbin Crutchley.