1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-06 02:39:55 +02:00

For Issue #44, introduce a @typedef for UnarchiverOptions

This commit is contained in:
Jeff Schiller 2023-12-11 00:29:50 -08:00
parent df5c5cfa0f
commit ac6807edec
6 changed files with 73 additions and 46 deletions

View file

@ -38,6 +38,10 @@ export {
* @property {Uint8Array} fileData
*/
/**
* @typedef {import('./decompress-internal.js').DecompressorOptions} DecompressorOptions
*/
/**
* Creates a WebWorker with the given decompressor implementation (i.e. unzip.js)
* and transfers a MessagePort for communication. Returns a Promise to the Worker.
@ -78,9 +82,10 @@ export class Untarrer extends UntarrerInternal {
* in the ArrayBuffer.
* @param {ArrayBuffer} ab The ArrayBuffer to unarchive. Note that this ArrayBuffer
* must not be referenced after calling this method, as the ArrayBuffer may be
* tranferred to a different JS context once start() is called.
* @param {Object|string} options An optional object of options, or a string
* representing where the path to the unarchiver script files.
* transferred to a different JS context once start() is called.
* @param {DecompressorOptions|string} options An optional object of options, or a
* string representing where the path to the unarchiver script files. The latter
* is now deprecated (use DecompressorOptions).
* @returns {Unarchiver}
*/
export function getUnarchiver(ab, options = {}) {