From 979a72706c7128f4ae90b43f5091fff3ad273c6b Mon Sep 17 00:00:00 2001 From: Rafael Rocha Date: Wed, 27 Jun 2018 21:29:13 -0300 Subject: [PATCH] Add TypeScript declaration file --- CHANGELOG.md | 3 ++ docs/index.html | 2 +- docs/index.js.html | 2 +- docs/module-wavefile.html | 2 +- index.d.ts | 59 +++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 6 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 index.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4daa6a0..ce8aa3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## version 7.0.1 (2018-06-27) +- Add TypeScript declaration file. + ## version 7.0.0 (2018-06-27) - ES6 module. - Better memory use. diff --git a/docs/index.html b/docs/index.html index 573a229..76252d4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -774,7 +774,7 @@


- Documentation generated by JSDoc 3.5.5 on Wed Jun 27 2018 13:24:46 GMT-0300 (Hora oficial do Brasil) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Wed Jun 27 2018 21:27:51 GMT-0300 (Hora oficial do Brasil) using the docdash theme.
diff --git a/docs/index.js.html b/docs/index.js.html index 900c442..3c0d572 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -2173,7 +2173,7 @@

index.js


diff --git a/docs/module-wavefile.html b/docs/module-wavefile.html index 69eceb2..147a9b3 100644 --- a/docs/module-wavefile.html +++ b/docs/module-wavefile.html @@ -4812,7 +4812,7 @@
Parameters:

diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..5b1be7d --- /dev/null +++ b/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for wavefile 7.0 +// Project: https://github.com/rochars/wavefile +// Definitions by: Rafael S. Rocha +// Definitions: https://github.com/rochars/wavefile + +export default WaveFile; + +declare class WaveFile { + + constructor(bytes?: Uint8Array); + + fromScratch(numChannels: number, sampleRate: number, bitDepth: string, samples: Array, options?: object): void; + + fromBuffer(bytes: Uint8Array): void; + + toBuffer(): Uint8Array; + + fromBase64(base64String: string): void; + + toBase64(): string; + + toDataURI(): string; + + fromDataURI(dataURI: string): void; + + toRIFF(): void; + + toRIFX(): void; + + toBitDepth(bitDepth: string, changeResolution?: boolean): void; + + interleave(): void; + + deInterleave(): void; + + toIMAADPCM(): void; + + fromIMAADPCM(bitDepth?: string): void; + + toALaw(): void; + + fromALaw(bitDepth?: string): void; + + toMuLaw(): void; + + fromMuLaw(bitDepth?: string): void; + + setTag(tag: string, value: string): void; + + getTag(tag: string): string|null; + + deleteTag(tag: string): boolean; + + setCuePoint(position: number, labl?: string): void; + + deleteCuePoint(index: number): void; + + updateLabel(pointIndex: number, label: string): void; +} diff --git a/package.json b/package.json index 6fd9f59..41e4331 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wavefile", - "version": "7.0.0", + "version": "7.0.1", "description": "Read and write wave files.", "homepage": "https://github.com/rochars/wavefile", "author": "Rafael S. Rocha ", @@ -11,6 +11,7 @@ "browser": "./dist/wavefile.umd.js", "jsdelivr": "./dist/wavefile.min.js", "unpkg": "./dist/wavefile.min.js", + "types": "./index.d.ts", "engines": { "node": ">=8" },