kbumsik / opus-media-recorder

MediaRecorder polyfill for Opus recording using WebAssembly
http://kbumsik.io/opus-media-recorder/
Other
308 stars 39 forks source link

Typescript definitions file #30

Open stefanfuchs opened 3 years ago

stefanfuchs commented 3 years ago

I've made a simple typescript definitions file, I tested with the basic examples and it is working fine. It might be worth adding it to the lib as the index.d.ts file:

declare module 'opus-media-recorder' {

  declare class OpusMediaRecorder extends MediaRecorder {
    constructor(stream: MediaStream, options?: MediaRecorderOptions, workerOptions?: OpusMediaRecorderWorkerOptions)
  }

  export interface OpusMediaRecorderWorkerOptions {
    encoderWorkerFactory: () => Worker,
    OggOpusEncoderWasmPath: string,
    WebMOpusEncoderWasmPath: string,
  }

  export = OpusMediaRecorder
}