diff options
Diffstat (limited to 'fflate/docs/interfaces')
24 files changed, 1491 insertions, 0 deletions
diff --git a/fflate/docs/interfaces/asyncdeflateoptions.md b/fflate/docs/interfaces/asyncdeflateoptions.md new file mode 100644 index 0000000..47af96e --- /dev/null +++ b/fflate/docs/interfaces/asyncdeflateoptions.md @@ -0,0 +1,70 @@ +# Interface: AsyncDeflateOptions + +Options for compressing data asynchronously into a DEFLATE format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + +* AsyncOptions + + ↳ **AsyncDeflateOptions** + + ↳↳ [AsyncZipOptions](asynczipoptions.md) + +## Index + +### Properties + +* [consume](asyncdeflateoptions.md#consume) +* [level](asyncdeflateoptions.md#level) +* [mem](asyncdeflateoptions.md#mem) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. diff --git a/fflate/docs/interfaces/asyncgunzipoptions.md b/fflate/docs/interfaces/asyncgunzipoptions.md new file mode 100644 index 0000000..0464578 --- /dev/null +++ b/fflate/docs/interfaces/asyncgunzipoptions.md @@ -0,0 +1,26 @@ +# Interface: AsyncGunzipOptions + +Options for decompressing GZIP data asynchronously + +## Hierarchy + +* AsyncOptions + + ↳ **AsyncGunzipOptions** + +## Index + +### Properties + +* [consume](asyncgunzipoptions.md#consume) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. diff --git a/fflate/docs/interfaces/asyncgzipoptions.md b/fflate/docs/interfaces/asyncgzipoptions.md new file mode 100644 index 0000000..15651eb --- /dev/null +++ b/fflate/docs/interfaces/asyncgzipoptions.md @@ -0,0 +1,92 @@ +# Interface: AsyncGzipOptions + +Options for compressing data asynchronously into a GZIP format + +## Hierarchy + +* [GzipOptions](gzipoptions.md) + +* AsyncOptions + + ↳ **AsyncGzipOptions** + +## Index + +### Properties + +* [consume](asyncgzipoptions.md#consume) +* [filename](asyncgzipoptions.md#filename) +* [level](asyncgzipoptions.md#level) +* [mem](asyncgzipoptions.md#mem) +* [mtime](asyncgzipoptions.md#mtime) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### filename + +• `Optional` **filename**: string + +*Inherited from [GzipOptions](gzipoptions.md).[filename](gzipoptions.md#filename)* + +The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file +with this name instead of the name of the compressed file. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: Date \| string \| number + +*Inherited from [GzipOptions](gzipoptions.md).[mtime](gzipoptions.md#mtime)* + +When the file was last modified. Defaults to the current time. +Set this to 0 to avoid revealing a modification date entirely. diff --git a/fflate/docs/interfaces/asyncinflateoptions.md b/fflate/docs/interfaces/asyncinflateoptions.md new file mode 100644 index 0000000..0586a5a --- /dev/null +++ b/fflate/docs/interfaces/asyncinflateoptions.md @@ -0,0 +1,39 @@ +# Interface: AsyncInflateOptions + +Options for decompressing DEFLATE data asynchronously + +## Hierarchy + +* AsyncOptions + + ↳ **AsyncInflateOptions** + + ↳↳ [AsyncUnzlibOptions](asyncunzliboptions.md) + +## Index + +### Properties + +* [consume](asyncinflateoptions.md#consume) +* [size](asyncinflateoptions.md#size) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### size + +• `Optional` **size**: number + +The original size of the data. Currently, the asynchronous API disallows +writing into a buffer you provide; the best you can do is provide the +size in bytes and be given back a new typed array. diff --git a/fflate/docs/interfaces/asyncterminable.md b/fflate/docs/interfaces/asyncterminable.md new file mode 100644 index 0000000..d79d51e --- /dev/null +++ b/fflate/docs/interfaces/asyncterminable.md @@ -0,0 +1,15 @@ +# Interface: AsyncTerminable + +A terminable compression/decompression process + +## Hierarchy + +* **AsyncTerminable** + +## Callable + +▸ (): void + +Terminates the worker thread immediately. The callback will not be called. + +**Returns:** void diff --git a/fflate/docs/interfaces/asyncunzipoptions.md b/fflate/docs/interfaces/asyncunzipoptions.md new file mode 100644 index 0000000..9e015b3 --- /dev/null +++ b/fflate/docs/interfaces/asyncunzipoptions.md @@ -0,0 +1,25 @@ +# Interface: AsyncUnzipOptions + +Options for asynchronously expanding a ZIP archive + +## Hierarchy + +* [UnzipOptions](unzipoptions.md) + + ↳ **AsyncUnzipOptions** + +## Index + +### Properties + +* [filter](asyncunzipoptions.md#filter) + +## Properties + +### filter + +• `Optional` **filter**: [UnzipFileFilter](../README.md#unzipfilefilter) + +*Inherited from [UnzipOptions](unzipoptions.md).[filter](unzipoptions.md#filter)* + +A filter function to extract only certain files from a ZIP archive diff --git a/fflate/docs/interfaces/asyncunzliboptions.md b/fflate/docs/interfaces/asyncunzliboptions.md new file mode 100644 index 0000000..053fedd --- /dev/null +++ b/fflate/docs/interfaces/asyncunzliboptions.md @@ -0,0 +1,39 @@ +# Interface: AsyncUnzlibOptions + +Options for decompressing Zlib data asynchronously + +## Hierarchy + +* [AsyncInflateOptions](asyncinflateoptions.md) + + ↳ **AsyncUnzlibOptions** + +## Index + +### Properties + +* [consume](asyncunzliboptions.md#consume) +* [size](asyncunzliboptions.md#size) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### size + +• `Optional` **size**: number + +*Inherited from [AsyncInflateOptions](asyncinflateoptions.md).[size](asyncinflateoptions.md#size)* + +The original size of the data. Currently, the asynchronous API disallows +writing into a buffer you provide; the best you can do is provide the +size in bytes and be given back a new typed array. diff --git a/fflate/docs/interfaces/asynczipoptions.md b/fflate/docs/interfaces/asynczipoptions.md new file mode 100644 index 0000000..c17a66d --- /dev/null +++ b/fflate/docs/interfaces/asynczipoptions.md @@ -0,0 +1,148 @@ +# Interface: AsyncZipOptions + +Options for asynchronously creating a ZIP archive + +## Hierarchy + +* [AsyncDeflateOptions](asyncdeflateoptions.md) + +* [ZipAttributes](zipattributes.md) + + ↳ **AsyncZipOptions** + +## Index + +### Properties + +* [attrs](asynczipoptions.md#attrs) +* [comment](asynczipoptions.md#comment) +* [consume](asynczipoptions.md#consume) +* [extra](asynczipoptions.md#extra) +* [level](asynczipoptions.md#level) +* [mem](asynczipoptions.md#mem) +* [mtime](asynczipoptions.md#mtime) +* [os](asynczipoptions.md#os) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Inherited from [ZipAttributes](zipattributes.md).[attrs](zipattributes.md#attrs)* + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +*Inherited from [ZipAttributes](zipattributes.md).[comment](zipattributes.md#comment)* + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Inherited from [ZipAttributes](zipattributes.md).[extra](zipattributes.md#extra)* + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Inherited from [ZipAttributes](zipattributes.md).[mtime](zipattributes.md#mtime)* + +When the file was last modified. Defaults to the current time. + +___ + +### os + +• `Optional` **os**: number + +*Inherited from [ZipAttributes](zipattributes.md).[os](zipattributes.md#os)* + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. diff --git a/fflate/docs/interfaces/asynczippable.md b/fflate/docs/interfaces/asynczippable.md new file mode 100644 index 0000000..a90147d --- /dev/null +++ b/fflate/docs/interfaces/asynczippable.md @@ -0,0 +1,13 @@ +# Interface: AsyncZippable + +The complete directory structure of an asynchronously ZIPpable archive + +## Hierarchy + +* **AsyncZippable** + +## Indexable + +▪ [path: string]: [AsyncZippable](asynczippable.md) \| [AsyncZippableFile](../README.md#asynczippablefile) + +The complete directory structure of an asynchronously ZIPpable archive diff --git a/fflate/docs/interfaces/asynczliboptions.md b/fflate/docs/interfaces/asynczliboptions.md new file mode 100644 index 0000000..22f3820 --- /dev/null +++ b/fflate/docs/interfaces/asynczliboptions.md @@ -0,0 +1,68 @@ +# Interface: AsyncZlibOptions + +Options for compressing data asynchronously into a Zlib format + +## Hierarchy + +* [ZlibOptions](zliboptions.md) + +* AsyncOptions + + ↳ **AsyncZlibOptions** + +## Index + +### Properties + +* [consume](asynczliboptions.md#consume) +* [level](asynczliboptions.md#level) +* [mem](asynczliboptions.md#mem) + +## Properties + +### consume + +• `Optional` **consume**: boolean + +*Inherited from [AsyncDeflateOptions](asyncdeflateoptions.md).[consume](asyncdeflateoptions.md#consume)* + +Whether or not to "consume" the source data. This will make the typed array/buffer you pass in +unusable but will increase performance and reduce memory usage. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. diff --git a/fflate/docs/interfaces/deflateoptions.md b/fflate/docs/interfaces/deflateoptions.md new file mode 100644 index 0000000..74fe5d8 --- /dev/null +++ b/fflate/docs/interfaces/deflateoptions.md @@ -0,0 +1,56 @@ +# Interface: DeflateOptions + +Options for compressing data into a DEFLATE format + +## Hierarchy + +* **DeflateOptions** + + ↳ [GzipOptions](gzipoptions.md) + + ↳ [ZlibOptions](zliboptions.md) + + ↳ [AsyncDeflateOptions](asyncdeflateoptions.md) + + ↳ [ZipOptions](zipoptions.md) + +## Index + +### Properties + +* [level](deflateoptions.md#level) +* [mem](deflateoptions.md#mem) + +## Properties + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. diff --git a/fflate/docs/interfaces/flateerror.md b/fflate/docs/interfaces/flateerror.md new file mode 100644 index 0000000..407c707 --- /dev/null +++ b/fflate/docs/interfaces/flateerror.md @@ -0,0 +1,57 @@ +# Interface: FlateError + +An error generated within this library + +## Hierarchy + +* [Error](flateerror.md#error) + + ↳ **FlateError** + +## Index + +### Properties + +* [Error](flateerror.md#error) +* [code](flateerror.md#code) +* [message](flateerror.md#message) +* [name](flateerror.md#name) +* [stack](flateerror.md#stack) + +## Properties + +### Error + +• **Error**: ErrorConstructor + +___ + +### code + +• **code**: number + +The code associated with this error + +___ + +### message + +• **message**: string + +*Inherited from [FlateError](flateerror.md).[message](flateerror.md#message)* + +___ + +### name + +• **name**: string + +*Inherited from [FlateError](flateerror.md).[name](flateerror.md#name)* + +___ + +### stack + +• `Optional` **stack**: string + +*Inherited from [FlateError](flateerror.md).[stack](flateerror.md#stack)* diff --git a/fflate/docs/interfaces/gzipoptions.md b/fflate/docs/interfaces/gzipoptions.md new file mode 100644 index 0000000..c084efc --- /dev/null +++ b/fflate/docs/interfaces/gzipoptions.md @@ -0,0 +1,76 @@ +# Interface: GzipOptions + +Options for compressing data into a GZIP format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + + ↳ **GzipOptions** + + ↳↳ [AsyncGzipOptions](asyncgzipoptions.md) + +## Index + +### Properties + +* [filename](gzipoptions.md#filename) +* [level](gzipoptions.md#level) +* [mem](gzipoptions.md#mem) +* [mtime](gzipoptions.md#mtime) + +## Properties + +### filename + +• `Optional` **filename**: string + +The filename of the data. If the `gunzip` command is used to decompress the data, it will output a file +with this name instead of the name of the compressed file. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: Date \| string \| number + +When the file was last modified. Defaults to the current time. +Set this to 0 to avoid revealing a modification date entirely. diff --git a/fflate/docs/interfaces/unzipdecoder.md b/fflate/docs/interfaces/unzipdecoder.md new file mode 100644 index 0000000..c1be4d1 --- /dev/null +++ b/fflate/docs/interfaces/unzipdecoder.md @@ -0,0 +1,58 @@ +# Interface: UnzipDecoder + +A decoder for files in ZIP streams + +## Hierarchy + +* **UnzipDecoder** + +## Implemented by + +* [AsyncUnzipInflate](../classes/asyncunzipinflate.md) +* [UnzipInflate](../classes/unzipinflate.md) +* [UnzipPassThrough](../classes/unzippassthrough.md) + +## Index + +### Properties + +* [ondata](unzipdecoder.md#ondata) +* [terminate](unzipdecoder.md#terminate) + +### Methods + +* [push](unzipdecoder.md#push) + +## Properties + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### terminate + +• `Optional` **terminate**: [AsyncTerminable](asyncterminable.md) + +A method to terminate any internal workers used by the stream. Subsequent +calls to push() should silently fail. + +## Methods + +### push + +▸ **push**(`data`: Uint8Array, `final`: boolean): void + +Pushes a chunk to be decompressed + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`data` | Uint8Array | The data in this chunk. Do not consume (detach) this data. | +`final` | boolean | Whether this is the last chunk in the data stream | + +**Returns:** void diff --git a/fflate/docs/interfaces/unzipdecoderconstructor.md b/fflate/docs/interfaces/unzipdecoderconstructor.md new file mode 100644 index 0000000..88388c7 --- /dev/null +++ b/fflate/docs/interfaces/unzipdecoderconstructor.md @@ -0,0 +1,45 @@ +# Interface: UnzipDecoderConstructor + +A constructor for a decoder for unzip streams + +## Hierarchy + +* **UnzipDecoderConstructor** + +## Index + +### Constructors + +* [constructor](unzipdecoderconstructor.md#constructor) + +### Properties + +* [compression](unzipdecoderconstructor.md#compression) + +## Constructors + +### constructor + +\+ **new UnzipDecoderConstructor**(`filename`: string, `size?`: number, `originalSize?`: number): [UnzipDecoder](unzipdecoder.md) + +Creates an instance of the decoder + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`filename` | string | The name of the file | +`size?` | number | The compressed size of the file | +`originalSize?` | number | The original size of the file | + +**Returns:** [UnzipDecoder](unzipdecoder.md) + +## Properties + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA diff --git a/fflate/docs/interfaces/unzipfile.md b/fflate/docs/interfaces/unzipfile.md new file mode 100644 index 0000000..41990bc --- /dev/null +++ b/fflate/docs/interfaces/unzipfile.md @@ -0,0 +1,88 @@ +# Interface: UnzipFile + +Streaming file extraction from ZIP archives + +## Hierarchy + +* **UnzipFile** + +## Index + +### Properties + +* [compression](unzipfile.md#compression) +* [name](unzipfile.md#name) +* [ondata](unzipfile.md#ondata) +* [originalSize](unzipfile.md#originalsize) +* [size](unzipfile.md#size) +* [terminate](unzipfile.md#terminate) + +### Methods + +* [start](unzipfile.md#start) + +## Properties + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA. If start() is called but there is no +decompression stream available for this method, start() will throw. + +___ + +### name + +• **name**: string + +The name of the file + +___ + +### ondata + +• **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to call whenever data is available + +___ + +### originalSize + +• `Optional` **originalSize**: number + +The original size of the file. Will not be present for archives created +in a streaming fashion. + +___ + +### size + +• `Optional` **size**: number + +The compressed size of the file. Will not be present for archives created +in a streaming fashion. + +___ + +### terminate + +• **terminate**: [AsyncTerminable](asyncterminable.md) + +A method to terminate any internal workers used by the stream. ondata +will not be called any further. + +## Methods + +### start + +▸ **start**(): void + +Starts reading from the stream. Calling this function will always enable +this stream, but ocassionally the stream will be enabled even without +this being called. + +**Returns:** void diff --git a/fflate/docs/interfaces/unzipfileinfo.md b/fflate/docs/interfaces/unzipfileinfo.md new file mode 100644 index 0000000..d1d8853 --- /dev/null +++ b/fflate/docs/interfaces/unzipfileinfo.md @@ -0,0 +1,51 @@ +# Interface: UnzipFileInfo + +Information about a file to be extracted from a ZIP archive + +## Hierarchy + +* **UnzipFileInfo** + +## Index + +### Properties + +* [compression](unzipfileinfo.md#compression) +* [name](unzipfileinfo.md#name) +* [originalSize](unzipfileinfo.md#originalsize) +* [size](unzipfileinfo.md#size) + +## Properties + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA. If the filter function returns true +but this value is not 8, the unzip function will throw. + +___ + +### name + +• **name**: string + +The name of the file + +___ + +### originalSize + +• **originalSize**: number + +The original size of the file + +___ + +### size + +• **size**: number + +The compressed size of the file diff --git a/fflate/docs/interfaces/unzipoptions.md b/fflate/docs/interfaces/unzipoptions.md new file mode 100644 index 0000000..2b5e98b --- /dev/null +++ b/fflate/docs/interfaces/unzipoptions.md @@ -0,0 +1,23 @@ +# Interface: UnzipOptions + +Options for expanding a ZIP archive + +## Hierarchy + +* **UnzipOptions** + + ↳ [AsyncUnzipOptions](asyncunzipoptions.md) + +## Index + +### Properties + +* [filter](unzipoptions.md#filter) + +## Properties + +### filter + +• `Optional` **filter**: [UnzipFileFilter](../README.md#unzipfilefilter) + +A filter function to extract only certain files from a ZIP archive diff --git a/fflate/docs/interfaces/unzipped.md b/fflate/docs/interfaces/unzipped.md new file mode 100644 index 0000000..349bd9e --- /dev/null +++ b/fflate/docs/interfaces/unzipped.md @@ -0,0 +1,15 @@ +# Interface: Unzipped + +An unzipped archive. The full path of each file is used as the key, +and the file is the value + +## Hierarchy + +* **Unzipped** + +## Indexable + +▪ [path: string]: Uint8Array + +An unzipped archive. The full path of each file is used as the key, +and the file is the value diff --git a/fflate/docs/interfaces/zipattributes.md b/fflate/docs/interfaces/zipattributes.md new file mode 100644 index 0000000..adf55bc --- /dev/null +++ b/fflate/docs/interfaces/zipattributes.md @@ -0,0 +1,88 @@ +# Interface: ZipAttributes + +Attributes for files added to a ZIP archive object + +## Hierarchy + +* **ZipAttributes** + + ↳ [ZipOptions](zipoptions.md) + + ↳ [AsyncZipOptions](asynczipoptions.md) + + ↳ [ZipInputFile](zipinputfile.md) + +## Index + +### Properties + +* [attrs](zipattributes.md#attrs) +* [comment](zipattributes.md#comment) +* [extra](zipattributes.md#extra) +* [mtime](zipattributes.md#mtime) +* [os](zipattributes.md#os) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +When the file was last modified. Defaults to the current time. + +___ + +### os + +• `Optional` **os**: number + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. diff --git a/fflate/docs/interfaces/zipinputfile.md b/fflate/docs/interfaces/zipinputfile.md new file mode 100644 index 0000000..44bf3a9 --- /dev/null +++ b/fflate/docs/interfaces/zipinputfile.md @@ -0,0 +1,194 @@ +# Interface: ZipInputFile + +A stream that can be used to create a file in a ZIP archive + +## Hierarchy + +* [ZipAttributes](zipattributes.md) + + ↳ **ZipInputFile** + +## Implemented by + +* [AsyncZipDeflate](../classes/asynczipdeflate.md) +* [ZipDeflate](../classes/zipdeflate.md) +* [ZipPassThrough](../classes/zippassthrough.md) + +## Index + +### Properties + +* [attrs](zipinputfile.md#attrs) +* [comment](zipinputfile.md#comment) +* [compression](zipinputfile.md#compression) +* [crc](zipinputfile.md#crc) +* [extra](zipinputfile.md#extra) +* [filename](zipinputfile.md#filename) +* [flag](zipinputfile.md#flag) +* [mtime](zipinputfile.md#mtime) +* [ondata](zipinputfile.md#ondata) +* [os](zipinputfile.md#os) +* [size](zipinputfile.md#size) +* [terminate](zipinputfile.md#terminate) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Inherited from [ZipAttributes](zipattributes.md).[attrs](zipattributes.md#attrs)* + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +*Inherited from [ZipAttributes](zipattributes.md).[comment](zipattributes.md#comment)* + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### compression + +• **compression**: number + +The compression format for the data stream. This number is determined by +the spec in PKZIP's APPNOTE.txt, section 4.4.5. For example, 0 = no +compression, 8 = deflate, 14 = LZMA + +___ + +### crc + +• **crc**: number + +A CRC of the original file contents. This attribute may be invalid after +the file is added to the ZIP archive; it must be correct only before the +stream completes. + +If you don't want to have to generate this yourself, consider extending the +ZipPassThrough class and overriding its process() method, or using one of +ZipDeflate or AsyncZipDeflate. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Inherited from [ZipAttributes](zipattributes.md).[extra](zipattributes.md#extra)* + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### filename + +• **filename**: string + +The filename to associate with the data provided to this stream. If you +want a file in a subdirectory, use forward slashes as a separator (e.g. +`directory/filename.ext`). This will still work on Windows. + +___ + +### flag + +• `Optional` **flag**: number + +Bits 1 and 2 of the general purpose bit flag, specified in PKZIP's +APPNOTE.txt, section 4.4.4. Should be between 0 and 3. This is unlikely +to be necessary. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Inherited from [ZipAttributes](zipattributes.md).[mtime](zipattributes.md#mtime)* + +When the file was last modified. Defaults to the current time. + +___ + +### ondata + +• `Optional` **ondata**: [AsyncFlateStreamHandler](../README.md#asyncflatestreamhandler) + +The handler to be called when data is added. After passing this stream to +the ZIP file object, this handler will always be defined. To call it: + +`stream.ondata(error, chunk, final)` + +error = any error that occurred (null if there was no error) + +chunk = a Uint8Array of the data that was added (null if there was an +error) + +final = boolean, whether this is the final chunk in the stream + +___ + +### os + +• `Optional` **os**: number + +*Inherited from [ZipAttributes](zipattributes.md).[os](zipattributes.md#os)* + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. + +___ + +### size + +• **size**: number + +The size of the file in bytes. This attribute may be invalid after +the file is added to the ZIP archive; it must be correct only before the +stream completes. + +If you don't want to have to compute this yourself, consider extending the +ZipPassThrough class and overriding its process() method, or using one of +ZipDeflate or AsyncZipDeflate. + +___ + +### terminate + +• `Optional` **terminate**: [AsyncTerminable](asyncterminable.md) + +A method called when the stream is no longer needed, for clean-up +purposes. This will not always be called after the stream completes, +so you may wish to call this.terminate() after the final chunk is +processed if you have clean-up logic. diff --git a/fflate/docs/interfaces/zipoptions.md b/fflate/docs/interfaces/zipoptions.md new file mode 100644 index 0000000..4f7aceb --- /dev/null +++ b/fflate/docs/interfaces/zipoptions.md @@ -0,0 +1,136 @@ +# Interface: ZipOptions + +Options for creating a ZIP archive + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + +* [ZipAttributes](zipattributes.md) + + ↳ **ZipOptions** + +## Index + +### Properties + +* [attrs](zipoptions.md#attrs) +* [comment](zipoptions.md#comment) +* [extra](zipoptions.md#extra) +* [level](zipoptions.md#level) +* [mem](zipoptions.md#mem) +* [mtime](zipoptions.md#mtime) +* [os](zipoptions.md#os) + +## Properties + +### attrs + +• `Optional` **attrs**: number + +*Inherited from [ZipAttributes](zipattributes.md).[attrs](zipattributes.md#attrs)* + +The file's attributes. These are traditionally somewhat complicated +and platform-dependent, so using them is scarcely necessary. However, +here is a representation of what this is, bit by bit: + +`TTTTugtrwxrwxrwx0000000000ADVSHR` + +TTTT = file type (rarely useful) + +u = setuid, g = setgid, t = sticky + +rwx = user permissions, rwx = group permissions, rwx = other permissions + +0000000000 = unused + +A = archive, D = directory, V = volume label, S = system file, H = hidden, R = read-only + +If you want to set the Unix permissions, for instance, just bit shift by 16, e.g. 0644 << 16 + +___ + +### comment + +• `Optional` **comment**: string + +*Inherited from [ZipAttributes](zipattributes.md).[comment](zipattributes.md#comment)* + +The comment to attach to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.26. The comment must be at most 65,535 bytes long UTF-8 encoded. This +field is not read by consumer software. + +___ + +### extra + +• `Optional` **extra**: Record\<number, Uint8Array> + +*Inherited from [ZipAttributes](zipattributes.md).[extra](zipattributes.md#extra)* + +Extra metadata to add to the file. This field is defined by PKZIP's APPNOTE.txt, +section 4.4.28. At most 65,535 bytes may be used in each ID. The ID must be an +integer between 0 and 65,535, inclusive. + +This field is incredibly rare and almost never needed except for compliance with +proprietary standards and software. + +___ + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. + +___ + +### mtime + +• `Optional` **mtime**: GzipOptions[\"mtime\"] + +*Inherited from [ZipAttributes](zipattributes.md).[mtime](zipattributes.md#mtime)* + +When the file was last modified. Defaults to the current time. + +___ + +### os + +• `Optional` **os**: number + +*Inherited from [ZipAttributes](zipattributes.md).[os](zipattributes.md#os)* + +The operating system of origin for this file. The value is defined +by PKZIP's APPNOTE.txt, section 4.4.2.2. For example, 0 (the default) +is MS/DOS, 3 is UNIX, 19 is macOS. diff --git a/fflate/docs/interfaces/zippable.md b/fflate/docs/interfaces/zippable.md new file mode 100644 index 0000000..feecac1 --- /dev/null +++ b/fflate/docs/interfaces/zippable.md @@ -0,0 +1,13 @@ +# Interface: Zippable + +The complete directory structure of a ZIPpable archive + +## Hierarchy + +* **Zippable** + +## Indexable + +▪ [path: string]: [Zippable](zippable.md) \| [ZippableFile](../README.md#zippablefile) + +The complete directory structure of a ZIPpable archive diff --git a/fflate/docs/interfaces/zliboptions.md b/fflate/docs/interfaces/zliboptions.md new file mode 100644 index 0000000..338b1a0 --- /dev/null +++ b/fflate/docs/interfaces/zliboptions.md @@ -0,0 +1,56 @@ +# Interface: ZlibOptions + +Options for compressing data into a Zlib format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + + ↳ **ZlibOptions** + + ↳↳ [AsyncZlibOptions](asynczliboptions.md) + +## Index + +### Properties + +* [level](zliboptions.md#level) +* [mem](zliboptions.md#mem) + +## Properties + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. |