From 8db69662531d9b93321a1274ddbbe33cac99dc3c Mon Sep 17 00:00:00 2001 From: Crawl Date: Sat, 25 Apr 2020 19:41:48 +0200 Subject: [PATCH] feat(typings): add typings (#7) --- package.json | 1 + typings/index.d.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 typings/index.d.ts diff --git a/package.json b/package.json index f473d60..9c10fac 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "description": "Opus bindings for Node", "main": "lib/index.js", + "types": "typings/index.d.ts", "author": "iCrawl ", "license": "MIT", "scripts": { diff --git a/typings/index.d.ts b/typings/index.d.ts new file mode 100644 index 0000000..ef8e1b7 --- /dev/null +++ b/typings/index.d.ts @@ -0,0 +1,12 @@ +declare module '@discordjs/opus' { + export class OpusEncoder { + public constructor(rate: number, channels: number); + + public encode(buf: Buffer): Buffer; + public decode(buf: Buffer): Buffer; + public applyEncoderCTL(ctl: number, value: number): void; + public applyDecoderCTL(ctl: number, value: number): void; + public setBirate(bitrate: number): void; + public getBitrate(): number; + } +}