Skip to content

Added missing device attribute to the TypeScript Options interface #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { Writable, WritableOptions } from 'stream';

namespace Speaker {
declare namespace Speaker {
interface Options extends WritableOptions {
readonly channels?: number;
readonly bitDepth?: number;
readonly sampleRate?: number;
readonly lowWaterMark?: number;
readonly highWaterMark?: number;
readonly device?: string;
readonly samplesPerFrame?: number;
readonly float?: boolean;
readonly signed?: boolean;
}

interface Format {
Expand All @@ -25,8 +29,8 @@ namespace Speaker {
*
* @param opts options.
*/
class Speaker extends Writable {
constructor(opts?: Speaker.Options);
export default class Speaker extends Writable {
constructor (opts?: Speaker.Options);

/**
* Closes the audio backend. Normally this function will be called automatically
Expand Down Expand Up @@ -54,6 +58,4 @@ class Speaker extends Writable {
* @return whether or not is playable
*/
public isSupported(format: number): boolean;
}

export = Speaker
}