From d42e26b011784f22bc4ddc14f2a056da93193617 Mon Sep 17 00:00:00 2001 From: rochars Date: Wed, 6 Dec 2017 05:31:02 -0200 Subject: [PATCH] better docs --- dist/riff-chunks.js | 18 +++++++++--------- docs/global.html | 28 ++++++++++++++++++++++++++-- docs/index.html | 2 +- docs/index.js.html | 20 ++++++++++---------- index.js | 18 +++++++++--------- package.json | 2 +- 6 files changed, 56 insertions(+), 32 deletions(-) diff --git a/dist/riff-chunks.js b/dist/riff-chunks.js index dab7b5a..d9a8ff0 100644 --- a/dist/riff-chunks.js +++ b/dist/riff-chunks.js @@ -410,9 +410,9 @@ const chr = byteData.chr; * @param {Object} chunks A structure like the return of riffChunks.read(). * @param {boolean} bigEndian if the bytes should be big endian. * "RIFX" chunkId will always set bigEndian to true. - * @return {Array|Uint8Array} The: - * - file bytes as Uint8Array when chunkId is "RIFF" or "RIFX" or - * - chunk bytes as Array if chunkId is "LIST". + * @return {Array|Uint8Array} The file bytes as Uint8Array when + * chunkId is "RIFF" or "RIFX" or the chunk bytes as Array + * when chunkId is "LIST". */ function write(chunks, bigEndian=false) { if (!bigEndian) { @@ -433,7 +433,7 @@ function write(chunks, bigEndian=false) { /** * Get the chunks of a RIFF/RIFX file. * @param {Uint8Array|!Array} buffer The file bytes. - * @return {Object} + * @return {Object} The chunk. */ function read(buffer) { buffer = [].slice.call(buffer); @@ -451,7 +451,7 @@ function read(buffer) { * Write the sub chunks of a RIFF file. * @param {Array} chunks The chunks. * @param {boolean} bigEndian true if its RIFX. - * @return {Array} + * @return {Array} The chunk bytes. */ function writeSubChunks(chunks, bigEndian) { let subChunks = []; @@ -474,7 +474,7 @@ function writeSubChunks(chunks, bigEndian) { /** * Get the sub chunks of a RIFF file. * @param {Uint8Array|!Array} buffer the RIFF file bytes. - * @return {Object} + * @return {Object} The subchunks of a RIFF/RIFX or LIST chunk. */ function getSubChunks(buffer) { let chunks = []; @@ -490,7 +490,7 @@ function getSubChunks(buffer) { * Get a sub chunk from a RIFF file. * @param {Uint8Array|!Array} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {Object} + * @return {Object} A subchunk of a RIFF/RIFX or LIST chunk. */ function getSubChunk(buffer, index) { let chunk = { @@ -511,7 +511,7 @@ function getSubChunk(buffer, index) { * Return the FourCC of a chunk. * @param {Uint8Array|!Array} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {string} + * @return {string} The id of the chunk. */ function getChunkId(buffer, index) { return byteData.unpackArray(buffer.slice(index, index + 4), chr); @@ -521,7 +521,7 @@ function getChunkId(buffer, index) { * Return the size of a chunk. * @param {Uint8Array|!Array} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {number} + * @return {number} The size of the chunk without the id and size fields. */ function getChunkSize(buffer, index) { return byteData.unpack(buffer.slice(index + 4, index + 8), uInt32); diff --git a/docs/global.html b/docs/global.html index eee9c12..43c5c82 100644 --- a/docs/global.html +++ b/docs/global.html @@ -270,6 +270,10 @@
Parameters:
Returns:
+
+ The id of the chunk. +
+
@@ -447,6 +451,10 @@
Parameters:
Returns:
+
+ The size of the chunk without the id and size fields. +
+
@@ -624,6 +632,10 @@
Parameters:
Returns:
+
+ A subchunk of a RIFF/RIFX or LIST chunk. +
+
@@ -778,6 +790,10 @@
Parameters:
Returns:
+
+ The subchunks of a RIFF/RIFX or LIST chunk. +
+
@@ -932,6 +948,10 @@
Parameters:
Returns:
+
+ The chunk. +
+
@@ -1119,7 +1139,7 @@
Returns:
- The: - file bytes as Uint8Array when chunkId is "RIFF" or "RIFX" or - chunk bytes as Array if chunkId is "LIST". + The file bytes as Uint8Array when chunkId is "RIFF" or "RIFX" or the chunk bytes as Array when chunkId is "LIST".
@@ -1299,6 +1319,10 @@
Parameters:
Returns:
+
+ The chunk bytes. +
+
@@ -1334,7 +1358,7 @@
Returns:

- Documentation generated by JSDoc 3.5.5 on Wed Dec 06 2017 05:02:32 GMT-0200 (Horário brasileiro de verão) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Wed Dec 06 2017 05:29:20 GMT-0200 (Horário brasileiro de verão) using the docdash theme.
diff --git a/docs/index.html b/docs/index.html index 31a2c80..e8a9c4b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -104,7 +104,7 @@

riffChunks.write()


 
 
- Documentation generated by JSDoc 3.5.5 on Wed Dec 06 2017 05:02:32 GMT-0200 (Horário brasileiro de verão) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Wed Dec 06 2017 05:29:20 GMT-0200 (Horário brasileiro de verão) using the docdash theme.
diff --git a/docs/index.js.html b/docs/index.js.html index 1e625fe..13bd99b 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -54,9 +54,9 @@

index.js

* @param {Object} chunks A structure like the return of riffChunks.read(). * @param {boolean} bigEndian if the bytes should be big endian. * "RIFX" chunkId will always set bigEndian to true. - * @return {Array<number>|Uint8Array} The: - * - file bytes as Uint8Array when chunkId is "RIFF" or "RIFX" or - * - chunk bytes as Array<number> if chunkId is "LIST". + * @return {Array<number>|Uint8Array} The file bytes as Uint8Array when + * chunkId is "RIFF" or "RIFX" or the chunk bytes as Array<number> + * when chunkId is "LIST". */ function write(chunks, bigEndian=false) { if (!bigEndian) { @@ -77,7 +77,7 @@

index.js

/** * Get the chunks of a RIFF/RIFX file. * @param {Uint8Array|!Array<number>} buffer The file bytes. - * @return {Object} + * @return {Object} The chunk. */ function read(buffer) { buffer = [].slice.call(buffer); @@ -95,7 +95,7 @@

index.js

* Write the sub chunks of a RIFF file. * @param {Array<Object>} chunks The chunks. * @param {boolean} bigEndian true if its RIFX. - * @return {Array<number>} + * @return {Array<number>} The chunk bytes. */ function writeSubChunks(chunks, bigEndian) { let subChunks = []; @@ -118,7 +118,7 @@

index.js

/** * Get the sub chunks of a RIFF file. * @param {Uint8Array|!Array<number>} buffer the RIFF file bytes. - * @return {Object} + * @return {Object} The subchunks of a RIFF/RIFX or LIST chunk. */ function getSubChunks(buffer) { let chunks = []; @@ -134,7 +134,7 @@

index.js

* Get a sub chunk from a RIFF file. * @param {Uint8Array|!Array<number>} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {Object} + * @return {Object} A subchunk of a RIFF/RIFX or LIST chunk. */ function getSubChunk(buffer, index) { let chunk = { @@ -155,7 +155,7 @@

index.js

* Return the FourCC of a chunk. * @param {Uint8Array|!Array<number>} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {string} + * @return {string} The id of the chunk. */ function getChunkId(buffer, index) { return byteData.unpackArray(buffer.slice(index, index + 4), chr); @@ -165,7 +165,7 @@

index.js

* Return the size of a chunk. * @param {Uint8Array|!Array<number>} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {number} + * @return {number} The size of the chunk without the id and size fields. */ function getChunkSize(buffer, index) { return byteData.unpack(buffer.slice(index + 4, index + 8), uInt32); @@ -185,7 +185,7 @@

index.js


- Documentation generated by JSDoc 3.5.5 on Wed Dec 06 2017 05:02:32 GMT-0200 (Horário brasileiro de verão) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Wed Dec 06 2017 05:29:20 GMT-0200 (Horário brasileiro de verão) using the docdash theme.
diff --git a/index.js b/index.js index 2f7fe73..ddfc584 100644 --- a/index.js +++ b/index.js @@ -15,9 +15,9 @@ const chr = byteData.chr; * @param {Object} chunks A structure like the return of riffChunks.read(). * @param {boolean} bigEndian if the bytes should be big endian. * "RIFX" chunkId will always set bigEndian to true. - * @return {Array|Uint8Array} The: - * - file bytes as Uint8Array when chunkId is "RIFF" or "RIFX" or - * - chunk bytes as Array if chunkId is "LIST". + * @return {Array|Uint8Array} The file bytes as Uint8Array when + * chunkId is "RIFF" or "RIFX" or the chunk bytes as Array + * when chunkId is "LIST". */ function write(chunks, bigEndian=false) { if (!bigEndian) { @@ -38,7 +38,7 @@ function write(chunks, bigEndian=false) { /** * Get the chunks of a RIFF/RIFX file. * @param {Uint8Array|!Array} buffer The file bytes. - * @return {Object} + * @return {Object} The chunk. */ function read(buffer) { buffer = [].slice.call(buffer); @@ -56,7 +56,7 @@ function read(buffer) { * Write the sub chunks of a RIFF file. * @param {Array} chunks The chunks. * @param {boolean} bigEndian true if its RIFX. - * @return {Array} + * @return {Array} The chunk bytes. */ function writeSubChunks(chunks, bigEndian) { let subChunks = []; @@ -79,7 +79,7 @@ function writeSubChunks(chunks, bigEndian) { /** * Get the sub chunks of a RIFF file. * @param {Uint8Array|!Array} buffer the RIFF file bytes. - * @return {Object} + * @return {Object} The subchunks of a RIFF/RIFX or LIST chunk. */ function getSubChunks(buffer) { let chunks = []; @@ -95,7 +95,7 @@ function getSubChunks(buffer) { * Get a sub chunk from a RIFF file. * @param {Uint8Array|!Array} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {Object} + * @return {Object} A subchunk of a RIFF/RIFX or LIST chunk. */ function getSubChunk(buffer, index) { let chunk = { @@ -116,7 +116,7 @@ function getSubChunk(buffer, index) { * Return the FourCC of a chunk. * @param {Uint8Array|!Array} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {string} + * @return {string} The id of the chunk. */ function getChunkId(buffer, index) { return byteData.unpackArray(buffer.slice(index, index + 4), chr); @@ -126,7 +126,7 @@ function getChunkId(buffer, index) { * Return the size of a chunk. * @param {Uint8Array|!Array} buffer the RIFF file bytes. * @param {number} index The start index of the chunk. - * @return {number} + * @return {number} The size of the chunk without the id and size fields. */ function getChunkSize(buffer, index) { return byteData.unpack(buffer.slice(index + 4, index + 8), uInt32); diff --git a/package.json b/package.json index 61eecbe..1179a27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "riff-chunks", - "version": "3.0.4", + "version": "3.0.5", "description": "Get and set the chunks of RIFF and RIFX files.", "homepage": "https://github.com/rochars/riff-chunks", "author": "Rafael da Silva Rocha ",