Skip to content

Commit

Permalink
Add TypeScript declaration file
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Jun 28, 2018
1 parent 0fe2c5f commit 979a727
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ <h2>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jun 27 2018 13:24:46 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jun 27 2018 21:27:51 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jun 27 2018 13:24:46 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jun 27 2018 21:27:51 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-wavefile.html
Original file line number Diff line number Diff line change
Expand Up @@ -4812,7 +4812,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jun 27 2018 13:24:46 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Jun 27 2018 21:27:51 GMT-0300 (Hora oficial do Brasil) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
59 changes: 59 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Type definitions for wavefile 7.0
// Project: https://github.com/rochars/wavefile
// Definitions by: Rafael S. Rocha <https://github.com/rochars>
// Definitions: https://github.com/rochars/wavefile

export default WaveFile;

declare class WaveFile {

constructor(bytes?: Uint8Array);

fromScratch(numChannels: number, sampleRate: number, bitDepth: string, samples: Array<number>, 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;
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand All @@ -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"
},
Expand Down

0 comments on commit 979a727

Please sign in to comment.