compress-utils 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +114 -80
  2. package/dist/algorithms/brotli/brotli.wasm +0 -0
  3. package/dist/algorithms/brotli/compress/brotli.wasm +0 -0
  4. package/dist/algorithms/brotli/compress/index.d.ts +2 -2
  5. package/dist/algorithms/brotli/compress/index.d.ts.map +1 -1
  6. package/dist/algorithms/brotli/decompress/brotli.wasm +0 -0
  7. package/dist/algorithms/brotli/index.d.ts +2 -2
  8. package/dist/algorithms/brotli/index.d.ts.map +1 -1
  9. package/dist/algorithms/bz2/bz2.wasm +0 -0
  10. package/dist/algorithms/bz2/compress/bz2.wasm +0 -0
  11. package/dist/algorithms/bz2/compress/index.d.ts +2 -2
  12. package/dist/algorithms/bz2/compress/index.d.ts.map +1 -1
  13. package/dist/algorithms/bz2/decompress/bz2.wasm +0 -0
  14. package/dist/algorithms/bz2/index.d.ts +2 -2
  15. package/dist/algorithms/bz2/index.d.ts.map +1 -1
  16. package/dist/algorithms/deflate/compress/index.d.ts +2 -2
  17. package/dist/algorithms/deflate/compress/index.d.ts.map +1 -1
  18. package/dist/algorithms/deflate/index.d.ts +2 -2
  19. package/dist/algorithms/deflate/index.d.ts.map +1 -1
  20. package/dist/algorithms/gzip/compress/gzip.wasm +0 -0
  21. package/dist/algorithms/gzip/compress/index.d.ts +2 -2
  22. package/dist/algorithms/gzip/compress/index.d.ts.map +1 -1
  23. package/dist/algorithms/gzip/decompress/gzip.wasm +0 -0
  24. package/dist/algorithms/gzip/gzip.wasm +0 -0
  25. package/dist/algorithms/gzip/index.d.ts +2 -2
  26. package/dist/algorithms/gzip/index.d.ts.map +1 -1
  27. package/dist/algorithms/lz4/compress/index.d.ts +2 -2
  28. package/dist/algorithms/lz4/compress/index.d.ts.map +1 -1
  29. package/dist/algorithms/lz4/compress/lz4.wasm +0 -0
  30. package/dist/algorithms/lz4/decompress/lz4.wasm +0 -0
  31. package/dist/algorithms/lz4/index.d.ts +2 -2
  32. package/dist/algorithms/lz4/index.d.ts.map +1 -1
  33. package/dist/algorithms/lz4/lz4.wasm +0 -0
  34. package/dist/algorithms/lz4_raw/decompress/index.d.ts +11 -1
  35. package/dist/algorithms/lz4_raw/decompress/index.d.ts.map +1 -1
  36. package/dist/algorithms/lz4_raw/decompress/index.js +10 -1
  37. package/dist/algorithms/lz4_raw/decompress/index.js.map +1 -1
  38. package/dist/algorithms/lz4_raw/index.d.ts +11 -1
  39. package/dist/algorithms/lz4_raw/index.d.ts.map +1 -1
  40. package/dist/algorithms/lz4_raw/index.js +10 -1
  41. package/dist/algorithms/lz4_raw/index.js.map +1 -1
  42. package/dist/algorithms/lzo/decompress/index.d.ts +13 -7
  43. package/dist/algorithms/lzo/decompress/index.d.ts.map +1 -1
  44. package/dist/algorithms/lzo/decompress/index.js +13 -4
  45. package/dist/algorithms/lzo/decompress/index.js.map +1 -1
  46. package/dist/algorithms/lzo/decompress/lzo.wasm +0 -0
  47. package/dist/algorithms/snappy/compress/index.d.ts +2 -2
  48. package/dist/algorithms/snappy/compress/index.d.ts.map +1 -1
  49. package/dist/algorithms/snappy/compress/snappy.wasm +0 -0
  50. package/dist/algorithms/snappy/decompress/snappy.wasm +0 -0
  51. package/dist/algorithms/snappy/index.d.ts +2 -2
  52. package/dist/algorithms/snappy/index.d.ts.map +1 -1
  53. package/dist/algorithms/snappy/snappy.wasm +0 -0
  54. package/dist/algorithms/xz/compress/index.d.ts +2 -2
  55. package/dist/algorithms/xz/compress/index.d.ts.map +1 -1
  56. package/dist/algorithms/xz/compress/xz.wasm +0 -0
  57. package/dist/algorithms/xz/decompress/xz.wasm +0 -0
  58. package/dist/algorithms/xz/index.d.ts +2 -2
  59. package/dist/algorithms/xz/index.d.ts.map +1 -1
  60. package/dist/algorithms/xz/xz.wasm +0 -0
  61. package/dist/algorithms/zlib/compress/index.d.ts +2 -2
  62. package/dist/algorithms/zlib/compress/index.d.ts.map +1 -1
  63. package/dist/algorithms/zlib/compress/zlib.wasm +0 -0
  64. package/dist/algorithms/zlib/decompress/zlib.wasm +0 -0
  65. package/dist/algorithms/zlib/index.d.ts +2 -2
  66. package/dist/algorithms/zlib/index.d.ts.map +1 -1
  67. package/dist/algorithms/zlib/zlib.wasm +0 -0
  68. package/dist/algorithms/zstd/compress/index.d.ts +2 -2
  69. package/dist/algorithms/zstd/compress/index.d.ts.map +1 -1
  70. package/dist/algorithms/zstd/compress/zstd.wasm +0 -0
  71. package/dist/algorithms/zstd/decompress/zstd.wasm +0 -0
  72. package/dist/algorithms/zstd/index.d.ts +2 -2
  73. package/dist/algorithms/zstd/index.d.ts.map +1 -1
  74. package/dist/algorithms/zstd/zstd.wasm +0 -0
  75. package/dist/core/capacity.d.ts +1 -1
  76. package/dist/core/capacity.d.ts.map +1 -1
  77. package/dist/core/capacity.js +5 -6
  78. package/dist/core/capacity.js.map +1 -1
  79. package/dist/core/dispatch.d.ts +15 -4
  80. package/dist/core/dispatch.d.ts.map +1 -1
  81. package/dist/core/dispatch.js +22 -1
  82. package/dist/core/dispatch.js.map +1 -1
  83. package/dist/core/loader.d.ts +1 -0
  84. package/dist/core/loader.d.ts.map +1 -1
  85. package/dist/core/loader.js.map +1 -1
  86. package/dist/core/types.d.ts +9 -0
  87. package/dist/core/types.d.ts.map +1 -1
  88. package/package.json +1 -1
package/README.md CHANGED
@@ -3,9 +3,10 @@
3
3
  [![npm version](https://img.shields.io/npm/v/compress-utils.svg)](https://www.npmjs.com/package/compress-utils)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/compress-utils.svg)](https://www.npmjs.com/package/compress-utils)
5
5
  [![types: built-in](https://img.shields.io/badge/types-built--in-blue.svg)](https://www.npmjs.com/package/compress-utils)
6
+ [![WASM build](https://img.shields.io/github/actions/workflow/status/dupontcyborg/compress-utils/build_and_test_wasm.yml?label=wasm)](https://github.com/dupontcyborg/compress-utils/actions/workflows/build_and_test_wasm.yml)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
8
 
8
- Unified WebAssembly bindings for eight compression algorithms: Brotli, bzip2, LZ4, XZ/LZMA, zlib, Zstandard, Snappy, and gzip. Same API for every algorithm, in every JavaScript runtime, with tree-shakeable imports so bundlers ship only what you use.
9
+ Unified WebAssembly bindings for eight compression algorithms — Zstandard, Brotli, zlib, gzip, bzip2, LZ4, XZ/LZMA, and Snappy — over a single high-performance C core. Same API for every algorithm, in every JavaScript runtime, with tree-shakeable imports so bundlers ship only what you use.
9
10
 
10
11
  ## Installation
11
12
 
@@ -16,39 +17,38 @@ npm install compress-utils
16
17
 
17
18
  ### CDN (no bundler)
18
19
 
19
- The package is published as ESM. You can pull it straight from a CDN — no install step, no build step.
20
+ The package is published as ESM. You can pull it straight from a CDN, with no install step and no build step.
20
21
 
21
22
  ```html
22
23
  <script type="module">
23
- import { compress, decompress } from
24
- "https://esm.sh/compress-utils/zstd";
24
+ import { compress, decompress } from "https://esm.sh/compress-utils/zstd";
25
25
 
26
- const out = await compress(
27
- new TextEncoder().encode("hello")
28
- );
26
+ const out = await compress(new TextEncoder().encode("hello"));
29
27
  </script>
30
28
  ```
31
29
 
32
- | CDN | Per-algo URL |
33
- |------------|-----------------------------------------------------------------------|
34
- | esm.sh | `https://esm.sh/compress-utils/<algo>` |
35
- | jsDelivr | `https://cdn.jsdelivr.net/npm/compress-utils/dist/algorithms/<algo>/index.js` |
36
- | unpkg | `https://unpkg.com/compress-utils/dist/algorithms/<algo>/index.js` |
30
+ | CDN | Per-algo URL |
31
+ |----------|-------------------------------------------------------------------------------|
32
+ | esm.sh | `https://esm.sh/compress-utils/<algo>` |
33
+ | jsDelivr | `https://cdn.jsdelivr.net/npm/compress-utils/dist/algorithms/<algo>/index.js` |
34
+ | unpkg | `https://unpkg.com/compress-utils/dist/algorithms/<algo>/index.js` |
37
35
 
38
36
  ## Quick start
39
37
 
40
- Each algorithm is its own subpath import. Pick the one you need; the rest stay out of your bundle.
38
+ Each algorithm is its own subpath import. Pick the one you need, and the rest stay out of your bundle.
41
39
 
42
40
  ```ts
43
41
  import { compress, decompress } from "compress-utils/zstd";
44
42
 
45
- const input = new TextEncoder().encode("the quick brown fox " .repeat(50));
43
+ const input = new TextEncoder().encode("the quick brown fox ".repeat(50));
46
44
 
47
45
  const compressed = await compress(input, { level: 9 });
48
46
  const restored = await decompress(compressed);
49
47
  ```
50
48
 
51
- Available subpaths: `compress-utils/zstd`, `/brotli`, `/zlib`, `/bz2`, `/lz4`, `/xz`, `/snappy`, `/gzip`. Identical surface across all eight. Each also has `/<algo>/decompress` and `/<algo>/compress` variants that ship only one direction for a much smaller `.wasm` — see [Bundle size](#bundle-size).
49
+ Available subpaths: `compress-utils/zstd`, `/brotli`, `/zlib`, `/bz2`, `/lz4`, `/xz`, `/snappy`, `/gzip`, plus the raw block formats `/deflate`, `/lz4_raw` and `/lzo/decompress`. The surface is identical across all of them. Each also has `/<algo>/decompress` and `/<algo>/compress` variants that ship only one direction for a much smaller `.wasm`; see [Bundle size](#bundle-size).
50
+
51
+ ## Streaming
52
52
 
53
53
  ### Web Streams
54
54
 
@@ -72,91 +72,70 @@ chunks.push(cs.finish());
72
72
  // cs is destroyed automatically on scope exit (TS 5.2+ / Node 22+).
73
73
  ```
74
74
 
75
- If `using` isn't available in your toolchain, call `cs.destroy()` explicitly — or rely on the GC backstop (a `FinalizationRegistry` frees the C-side handle eventually).
75
+ If `using` isn't available in your toolchain, call `cs.destroy()` explicitly, or rely on the GC backstop: a `FinalizationRegistry` frees the C-side handle eventually.
76
76
 
77
77
  ## Supported algorithms
78
78
 
79
- | Algorithm | Subpath | Wire format produced |
80
- |-----------|--------------------------|--------------------------------------------|
81
- | zlib | `compress-utils/zlib` | zlib wrapper (RFC 1950) |
82
- | bzip2 | `compress-utils/bz2` | bzip2 stream |
83
- | XZ/LZMA | `compress-utils/xz` | XZ stream with CRC64 |
84
- | LZ4 | `compress-utils/lz4` | LZ4 frame (compatible with `.lz4` files) |
85
- | Zstandard | `compress-utils/zstd` | ZSTD frame with content size |
86
- | Brotli | `compress-utils/brotli` | raw Brotli stream |
87
- | Snappy | `compress-utils/snappy` | Raw Snappy block |
88
- | gzip | `compress-utils/gzip` | gzip stream (RFC 1952) |
89
- | LZO | `compress-utils/lzo/decompress` | Raw LZO1X block (decompress only; pass `{expectedSize}` as output capacity) |
79
+ <!-- BEGIN:algorithms -->
80
+ <!-- Generated by tools/check-readmes.py from docs/readme/manifest.json. Edit the manifest and run `tools/check-readmes.py --fix`, not this block. -->
90
81
 
91
- Imports are independent — `import "compress-utils/zstd"` and `import "compress-utils/brotli"` pull in two separate `.wasm` modules, not a combined bundle. Files marked `"sideEffects": false` so unused exports are tree-shaken aggressively. For per-module `.wasm` sizes (and the smaller decode-only / encode-only builds), see **[Bundle size](#bundle-size)**.
82
+ | Algorithm | Subpath | Wire format |
83
+ |-----------|---------------------------------|------------------------------------------------------------------------------------------|
84
+ | Zstandard | `compress-utils/zstd` | ZSTD frame with content size |
85
+ | Brotli | `compress-utils/brotli` | Raw Brotli stream |
86
+ | zlib | `compress-utils/zlib` | zlib wrapper (RFC 1950) |
87
+ | gzip | `compress-utils/gzip` | gzip stream (RFC 1952) |
88
+ | bzip2 | `compress-utils/bz2` | bzip2 stream |
89
+ | LZ4 | `compress-utils/lz4` | LZ4 frame (interoperable with the `lz4` CLI and `.lz4` files) |
90
+ | XZ / LZMA | `compress-utils/xz` | XZ stream with CRC64 |
91
+ | Snappy | `compress-utils/snappy` | Raw Snappy block (interoperable with reference snappy and python-snappy) |
92
+ | DEFLATE | `compress-utils/deflate` | Raw DEFLATE (RFC 1951), no wrapper |
93
+ | LZ4 block | `compress-utils/lz4_raw` | Raw LZ4 block, no frame or size prefix (one-shot compression, incremental decompression) |
94
+ | LZO1X | `compress-utils/lzo/decompress` | Raw LZO1X block (decompression only) |
95
+ <!-- END:algorithms -->
92
96
 
93
- ## Bundle size
97
+ Imports are independent: `import "compress-utils/zstd"` and `import "compress-utils/brotli"` pull in two separate `.wasm` modules, not a combined bundle. Files are marked `"sideEffects": false` so unused exports are tree-shaken aggressively. For per-module `.wasm` sizes, and the smaller decode-only and encode-only builds, see [Bundle size](#bundle-size).
98
+
99
+ ### Raw blocks and output capacity
94
100
 
95
- Importing `compress-utils/<algo>` gives you the **full** codec — compress *and* decompress. If you only need one direction (a browser that just *decompresses* fetched assets is the common case), import a directional subpath and the other half is dead-stripped from the `.wasm` entirely:
101
+ Raw block formats such as those inside Parquet and ORC pages don't record their decompressed size. Pass `expectedSize`, an upper bound on the output, and the result holds only the bytes actually decoded:
96
102
 
97
103
  ```ts
98
- // decoder only, 90 KB
99
- import { decompress } from "compress-utils/zstd/decompress";
104
+ import { decompress } from "compress-utils/lz4_raw";
100
105
 
101
- // or, encoder only:
102
- import { compress } from "compress-utils/zstd/compress";
106
+ const page = await decompress(block, { expectedSize: uncompressedPageSize });
103
107
  ```
104
108
 
105
- - **`/decompress`** exposes `decompress`, `createDecompressStream`, `decompressionStream`, `setMaxDecompressedSize`, `version`.
106
- - **`/compress`** exposes `compress`, `createCompressStream`, `compressionStream`, `version`.
107
- - The default subpath keeps **both**
108
-
109
- Comparison of the gzipped sizes:
110
-
111
- | algo | full | decompress-only | compress-only |
112
- |--------|--------------:|----------------------:|----------------------:|
113
- | zstd | 128K | 36K | 106K |
114
- | brotli | 169K | 84K | 154K |
115
- | lz4 | 39K | 15K | 35K |
116
- | bz2 | 33K | 22K | 25K |
117
- | xz | 62K | 43K | 51K |
118
- | zlib | 33K | 25K | 26K |
119
- | snappy | 36K | 32K | 28K |
120
- | gzip | 80K | 52K | 60K |
121
-
122
- The `.wasm` is the bulk of what ships; the JS glue is a few KB, shared, and tree-shaken to the methods you import.
109
+ Without `expectedSize`, `lz4_raw` blocks are decoded with the incremental stream decoder, which is much slower, so pass it when you know the size. Every other algorithm accepts it too, which skips a sizing pass and decodes straight into a buffer of that size.
123
110
 
124
111
  ## Compression levels
125
112
 
126
- Every algorithm accepts a `level` from **1 (fastest) to 10 (smallest)**. The binding maps that to each algorithm's native range internally — you don't need to know that Zstandard goes 1–22 or zlib goes 1–9. Defaults to `5`.
113
+ Every algorithm accepts a `level` from **1 (fastest) to 10 (smallest)**. The binding maps that to each algorithm's native range internally, so you don't need to know that Zstandard goes 1–22 and zlib goes 1–9. The default is `5`.
127
114
 
128
115
  ```ts
129
116
  await compress(input, { level: 1 }); // fastest
130
117
  await compress(input, { level: 10 }); // smallest
131
118
  ```
132
119
 
133
- ## Runtime support
134
-
135
- Tested in CI on every release:
136
-
137
- | Runtime | Status |
138
- |----------------------|--------|
139
- | Node 20, 22, 24 | ✅ |
140
- | Bun | ✅ |
141
- | Deno 2.x | ✅ |
142
- | Chromium / Firefox / WebKit (Playwright) | ✅ |
143
-
144
- ## TypeScript
120
+ ## Errors and limits
145
121
 
146
- The package is TypeScript-first. `.d.ts` files ship alongside the JS for every subpath; no `@types/` package needed.
122
+ Every failure throws a `CompressError`, which carries the underlying C status code and the algorithm name:
147
123
 
148
124
  ```ts
149
- import { compress, type CompressOptions, type CompressError } from "compress-utils/zstd";
125
+ import { compress, decompress, CompressError } from "compress-utils/zstd";
150
126
 
151
- const opts: CompressOptions = { level: 7 };
152
- const compressed: Uint8Array = await compress(input, opts);
127
+ try {
128
+ await decompress(garbage);
129
+ } catch (e) {
130
+ if (e instanceof CompressError) console.error(e.algorithm, e.code, e.message);
131
+ }
153
132
  ```
154
133
 
134
+ `await version()` returns the library version (for example `"0.9.0"`), and `await setMaxDecompressedSize(bytes)` bounds one-shot decompression (default 1 GiB; `0` = unbounded). Both are exported from every subpath that includes decompression.
135
+
155
136
  ## Preloading and synchronous calls
156
137
 
157
- Each algorithm and direction-specific subpath exports `preload()`. It loads and
158
- initializes that subpath's WASM module once; concurrent calls share initialization.
159
- A failed initialization can be retried. No codec work is performed by preload.
138
+ Each algorithm and direction-specific subpath exports `preload()`. It loads and initializes that subpath's WASM module once, and concurrent calls share initialization. A failed initialization can be retried. No codec work is performed by preload.
160
139
 
161
140
  ```ts
162
141
  import { preload, compressSync, decompressSync } from "compress-utils/zlib";
@@ -165,13 +144,68 @@ const compressed = compressSync(new TextEncoder().encode("hello"));
165
144
  const restored = decompressSync(compressed);
166
145
  ```
167
146
 
168
- `compressSync`, `decompressSync`, `createCompressStreamSync`, and
169
- `createDecompressStreamSync` are available for the directions exposed by the
170
- subpath. They throw with a `preload()` instruction before initialization completes.
171
- Existing asynchronous APIs initialize automatically and also enable subsequent
172
- synchronous calls. Initializing one subpath does not initialize another: encoder
173
- and decoder subpaths use different WASM modules. Sync calls block the calling
174
- thread; use a worker for expensive operations.
147
+ `compressSync`, `decompressSync`, `createCompressStreamSync`, and `createDecompressStreamSync` are available for the directions exposed by the subpath. They throw with a `preload()` instruction before initialization completes. Existing asynchronous APIs initialize automatically and also enable subsequent synchronous calls. Initializing one subpath does not initialize another, because encoder and decoder subpaths use different WASM modules.
148
+
149
+ ## Concurrency
150
+
151
+ Each WASM module instance runs on the thread that loaded it, so nothing is shared between workers: every Worker initializes its own instance and keeps its own streams. Synchronous calls block the calling thread, so run expensive ones in a Worker. A stream handle holds state inside its module instance, so feed each stream from one logical flow rather than from interleaved callers.
152
+
153
+ ## Bundle size
154
+
155
+ Importing `compress-utils/<algo>` gives you the **full** codec, compress *and* decompress. If you only need one direction (a browser that just *decompresses* fetched assets is the common case), import a directional subpath and the other half is dead-stripped from the `.wasm` entirely:
156
+
157
+ ```ts
158
+ // decoder only, 36 KB gzipped for zstd
159
+ import { decompress } from "compress-utils/zstd/decompress";
160
+
161
+ // or, encoder only:
162
+ import { compress } from "compress-utils/zstd/compress";
163
+ ```
164
+
165
+ - **`/decompress`** exposes `decompress`, `createDecompressStream`, `decompressionStream`, `setMaxDecompressedSize` and `version`.
166
+ - **`/compress`** exposes `compress`, `createCompressStream`, `compressionStream` and `version`.
167
+ - The default subpath keeps **both**.
168
+
169
+ Gzipped `.wasm` sizes:
170
+
171
+ | algo | full | decompress-only | compress-only |
172
+ |--------|-----:|----------------:|--------------:|
173
+ | zstd | 128K | 36K | 106K |
174
+ | brotli | 169K | 84K | 154K |
175
+ | lz4 | 39K | 15K | 35K |
176
+ | bz2 | 33K | 22K | 25K |
177
+ | xz | 62K | 43K | 51K |
178
+ | zlib | 33K | 25K | 26K |
179
+ | snappy | 36K | 32K | 28K |
180
+ | gzip | 80K | 52K | 60K |
181
+
182
+ The `.wasm` is the bulk of what ships. The JS glue is a few KB, shared, and tree-shaken to the methods you import.
183
+
184
+ ## Runtime support
185
+
186
+ Tested in CI on every release:
187
+
188
+ | Runtime | Status |
189
+ |------------------------------------------|--------|
190
+ | Node 20, 22, 24 | ✅ |
191
+ | Bun | ✅ |
192
+ | Deno 2.x | ✅ |
193
+ | Chromium / Firefox / WebKit (Playwright) | ✅ |
194
+
195
+ ## TypeScript
196
+
197
+ The package is TypeScript-first. `.d.ts` files ship alongside the JS for every subpath, so no `@types/` package is needed.
198
+
199
+ ```ts
200
+ import { compress, type CompressOptions, type CompressError } from "compress-utils/zstd";
201
+
202
+ const opts: CompressOptions = { level: 7 };
203
+ const compressed: Uint8Array = await compress(input, opts);
204
+ ```
205
+
206
+ ## Performance
207
+
208
+ Overhead versus native C is **0.60–0.84× on compress and 0.50–1.00× on decompress**. WASM is the slowest binding across the board: zstd and brotli decode are the worst cases because they lean on native SIMD, while lz4 decode is memory-bound and costs nothing extra in the sandbox. The reasons to choose this binding are portability, one API in every runtime, and the small per-codec bundles above, rather than beating native `node:zlib`. Compression ratio is byte-identical to every other binding. See the [language comparison](https://github.com/dupontcyborg/compress-utils/blob/main/benchmarks/README.md#language-comparison) for methodology and the full chart.
175
209
 
176
210
  ## License
177
211
 
@@ -179,4 +213,4 @@ MIT. See [LICENSE](https://github.com/dupontcyborg/compress-utils/blob/main/LICE
179
213
 
180
214
  ---
181
215
 
182
- Built by [Nico Dupont](https://nico.codes).
216
+ Part of [compress-utils](https://github.com/dupontcyborg/compress-utils). Built by [Nico Dupont](https://nico.codes).
Binary file
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
4
4
  export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
5
5
  /** Synchronous counterpart; requires completed preload(). */
6
6
  export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
7
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
7
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
8
8
  /** Initializes this independently loaded WASM subpath. */
9
9
  export declare const preload: () => Promise<void>;
10
10
  export declare const version: () => Promise<string>;
11
11
  export { CompressError } from "../../../core/types.js";
12
- export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
12
+ export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
13
13
  export type { CompressStream } from "../../../core/dispatch.js";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/brotli/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/brotli/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
10
10
  export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
11
11
  /** Synchronous counterpart; requires completed preload(). */
12
12
  export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
13
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
13
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
14
14
  export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
15
15
  /** Initializes this independently loaded WASM subpath. */
16
16
  export declare const preload: () => Promise<void>;
17
17
  export declare const version: () => Promise<string>;
18
18
  export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
19
19
  export { CompressError } from "../../core/types.js";
20
- export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
20
+ export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
21
21
  export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/brotli/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC7F,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/brotli/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
Binary file
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
4
4
  export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
5
5
  /** Synchronous counterpart; requires completed preload(). */
6
6
  export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
7
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
7
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
8
8
  /** Initializes this independently loaded WASM subpath. */
9
9
  export declare const preload: () => Promise<void>;
10
10
  export declare const version: () => Promise<string>;
11
11
  export { CompressError } from "../../../core/types.js";
12
- export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
12
+ export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
13
13
  export type { CompressStream } from "../../../core/dispatch.js";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/bz2/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/bz2/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
10
10
  export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
11
11
  /** Synchronous counterpart; requires completed preload(). */
12
12
  export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
13
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
13
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
14
14
  export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
15
15
  /** Initializes this independently loaded WASM subpath. */
16
16
  export declare const preload: () => Promise<void>;
17
17
  export declare const version: () => Promise<string>;
18
18
  export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
19
19
  export { CompressError } from "../../core/types.js";
20
- export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
20
+ export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
21
21
  export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/bz2/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0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 export declare const compress: (input: Uint8Array, opts?: import("./index.js").C
2
2
  export declare const compressSync: (input: Uint8Array, opts?: import("./index.js").CompressOptions) => Uint8Array;
3
3
  export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
4
4
  export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
5
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
5
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
6
6
  export declare const preload: () => Promise<void>;
7
7
  export declare const version: () => Promise<string>;
8
8
  export { CompressError } from "../../../core/types.js";
9
- export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
9
+ export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
10
10
  export type { CompressStream } from "../../../core/dispatch.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/deflate/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/deflate/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
@@ -6,12 +6,12 @@ export declare const createCompressStream: (opts?: import("./index.js").Compress
6
6
  export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
7
7
  export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
8
8
  export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
9
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
9
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
10
10
  export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
11
11
  export declare const preload: () => Promise<void>;
12
12
  export declare const version: () => Promise<string>;
13
13
  export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
14
14
  export { CompressError } from "../../core/types.js";
15
- export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
15
+ export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
16
16
  export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/de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AChE,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
4
4
  export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
5
5
  /** Synchronous counterpart; requires completed preload(). */
6
6
  export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
7
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
7
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
8
8
  /** Initializes this independently loaded WASM subpath. */
9
9
  export declare const preload: () => Promise<void>;
10
10
  export declare const version: () => Promise<string>;
11
11
  export { CompressError } from "../../../core/types.js";
12
- export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
12
+ export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
13
13
  export type { CompressStream } from "../../../core/dispatch.js";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/gzip/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/gzip/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
Binary file
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
10
10
  export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
11
11
  /** Synchronous counterpart; requires completed preload(). */
12
12
  export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
13
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
13
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
14
14
  export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
15
15
  /** Initializes this independently loaded WASM subpath. */
16
16
  export declare const preload: () => Promise<void>;
17
17
  export declare const version: () => Promise<string>;
18
18
  export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
19
19
  export { CompressError } from "../../core/types.js";
20
- export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
20
+ export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
21
21
  export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/gzip/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC7F,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/gzip/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
4
4
  export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
5
5
  /** Synchronous counterpart; requires completed preload(). */
6
6
  export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
7
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
7
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
8
8
  /** Initializes this independently loaded WASM subpath. */
9
9
  export declare const preload: () => Promise<void>;
10
10
  export declare const version: () => Promise<string>;
11
11
  export { CompressError } from "../../../core/types.js";
12
- export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
12
+ export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
13
13
  export type { CompressStream } from "../../../core/dispatch.js";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,0FAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
10
10
  export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
11
11
  /** Synchronous counterpart; requires completed preload(). */
12
12
  export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
13
- export declare const compressionStream: (opts?: import("./index.js").CompressOptions) => TransformStream<Uint8Array, Uint8Array>;
13
+ export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
14
14
  export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
15
15
  /** Initializes this independently loaded WASM subpath. */
16
16
  export declare const preload: () => Promise<void>;
17
17
  export declare const version: () => Promise<string>;
18
18
  export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
19
19
  export { CompressError } from "../../core/types.js";
20
- export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
20
+ export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
21
21
  export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/lz4/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,e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AAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
Binary file
@@ -1,5 +1,8 @@
1
1
  import type { DecompressOptions } from "../../../core/types.js";
2
- /** Decodes a raw block into the required output capacity. */
2
+ /**
3
+ * Decodes a raw block. Pass `expectedSize` (an output capacity) when known: without it
4
+ * the block is decoded by the incremental stream decoder, which is much slower.
5
+ */
3
6
  export declare function decompress(input: Uint8Array, options?: DecompressOptions): Promise<Uint8Array>;
4
7
  /** Decodes a raw block synchronously after preload(). */
5
8
  export declare function decompressSync(input: Uint8Array, options?: DecompressOptions): Uint8Array;
@@ -8,4 +11,11 @@ export declare const version: () => Promise<string>;
8
11
  export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
9
12
  export { CompressError } from "../../../core/types.js";
10
13
  export type { DecompressOptions, AlgorithmName } from "../../../core/types.js";
14
+ /** Creates an incremental raw-block decoder; write() emits output as input arrives. */
15
+ export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
16
+ /** Requires completed preload(), like other synchronous stream factories. */
17
+ export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
18
+ /** Incrementally decodes one raw block through Web Streams. */
19
+ export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
20
+ export type { DecompressStream } from "../../../core/dispatch.js";
11
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4_raw/decompress/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wB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,mBAAmB,+CAA+B,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -8,7 +8,10 @@ import { defineAlgorithm } from "../../../core/algorithm.js";
8
8
  import { Algorithm } from "../../../core/types.js";
9
9
  import { validateCapacity } from "../../../core/capacity.js";
10
10
  const bindings = /*#__PURE__*/ defineAlgorithm(Algorithm.Lz4Raw, "lz4_raw", new URL("../../lz4/decompress/lz4.wasm", import.meta.url));
11
- /** Decodes a raw block into the required output capacity. */
11
+ /**
12
+ * Decodes a raw block. Pass `expectedSize` (an output capacity) when known: without it
13
+ * the block is decoded by the incremental stream decoder, which is much slower.
14
+ */
12
15
  export async function decompress(input, options = {}) {
13
16
  validateCapacity("lz4_raw", "raw LZ4", options);
14
17
  return bindings.decompress(input, options);
@@ -22,4 +25,10 @@ export const preload = bindings.preload;
22
25
  export const version = bindings.version;
23
26
  export const setMaxDecompressedSize = bindings.setMaxDecompressedSize;
24
27
  export { CompressError } from "../../../core/types.js";
28
+ /** Creates an incremental raw-block decoder; write() emits output as input arrives. */
29
+ export const createDecompressStream = bindings.createDecompressStream;
30
+ /** Requires completed preload(), like other synchronous stream factories. */
31
+ export const createDecompressStreamSync = bindings.createDecompressStreamSync;
32
+ /** Incrementally decodes one raw block through Web Streams. */
33
+ export const decompressionStream = bindings.decompressionStream;
25
34
  //# sourceMappingURL=index.js.map