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.
- package/README.md +114 -80
- package/dist/algorithms/brotli/brotli.wasm +0 -0
- package/dist/algorithms/brotli/compress/brotli.wasm +0 -0
- package/dist/algorithms/brotli/compress/index.d.ts +2 -2
- package/dist/algorithms/brotli/compress/index.d.ts.map +1 -1
- package/dist/algorithms/brotli/decompress/brotli.wasm +0 -0
- package/dist/algorithms/brotli/index.d.ts +2 -2
- package/dist/algorithms/brotli/index.d.ts.map +1 -1
- package/dist/algorithms/bz2/bz2.wasm +0 -0
- package/dist/algorithms/bz2/compress/bz2.wasm +0 -0
- package/dist/algorithms/bz2/compress/index.d.ts +2 -2
- package/dist/algorithms/bz2/compress/index.d.ts.map +1 -1
- package/dist/algorithms/bz2/decompress/bz2.wasm +0 -0
- package/dist/algorithms/bz2/index.d.ts +2 -2
- package/dist/algorithms/bz2/index.d.ts.map +1 -1
- package/dist/algorithms/deflate/compress/index.d.ts +2 -2
- package/dist/algorithms/deflate/compress/index.d.ts.map +1 -1
- package/dist/algorithms/deflate/index.d.ts +2 -2
- package/dist/algorithms/deflate/index.d.ts.map +1 -1
- package/dist/algorithms/gzip/compress/gzip.wasm +0 -0
- package/dist/algorithms/gzip/compress/index.d.ts +2 -2
- package/dist/algorithms/gzip/compress/index.d.ts.map +1 -1
- package/dist/algorithms/gzip/decompress/gzip.wasm +0 -0
- package/dist/algorithms/gzip/gzip.wasm +0 -0
- package/dist/algorithms/gzip/index.d.ts +2 -2
- package/dist/algorithms/gzip/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/compress/index.d.ts +2 -2
- package/dist/algorithms/lz4/compress/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/compress/lz4.wasm +0 -0
- package/dist/algorithms/lz4/decompress/lz4.wasm +0 -0
- package/dist/algorithms/lz4/index.d.ts +2 -2
- package/dist/algorithms/lz4/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/lz4.wasm +0 -0
- package/dist/algorithms/lz4_raw/decompress/index.d.ts +11 -1
- package/dist/algorithms/lz4_raw/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/lz4_raw/decompress/index.js +10 -1
- package/dist/algorithms/lz4_raw/decompress/index.js.map +1 -1
- package/dist/algorithms/lz4_raw/index.d.ts +11 -1
- package/dist/algorithms/lz4_raw/index.d.ts.map +1 -1
- package/dist/algorithms/lz4_raw/index.js +10 -1
- package/dist/algorithms/lz4_raw/index.js.map +1 -1
- package/dist/algorithms/lzo/decompress/index.d.ts +13 -7
- package/dist/algorithms/lzo/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/lzo/decompress/index.js +13 -4
- package/dist/algorithms/lzo/decompress/index.js.map +1 -1
- package/dist/algorithms/lzo/decompress/lzo.wasm +0 -0
- package/dist/algorithms/snappy/compress/index.d.ts +2 -2
- package/dist/algorithms/snappy/compress/index.d.ts.map +1 -1
- package/dist/algorithms/snappy/compress/snappy.wasm +0 -0
- package/dist/algorithms/snappy/decompress/snappy.wasm +0 -0
- package/dist/algorithms/snappy/index.d.ts +2 -2
- package/dist/algorithms/snappy/index.d.ts.map +1 -1
- package/dist/algorithms/snappy/snappy.wasm +0 -0
- package/dist/algorithms/xz/compress/index.d.ts +2 -2
- package/dist/algorithms/xz/compress/index.d.ts.map +1 -1
- package/dist/algorithms/xz/compress/xz.wasm +0 -0
- package/dist/algorithms/xz/decompress/xz.wasm +0 -0
- package/dist/algorithms/xz/index.d.ts +2 -2
- package/dist/algorithms/xz/index.d.ts.map +1 -1
- package/dist/algorithms/xz/xz.wasm +0 -0
- package/dist/algorithms/zlib/compress/index.d.ts +2 -2
- package/dist/algorithms/zlib/compress/index.d.ts.map +1 -1
- package/dist/algorithms/zlib/compress/zlib.wasm +0 -0
- package/dist/algorithms/zlib/decompress/zlib.wasm +0 -0
- package/dist/algorithms/zlib/index.d.ts +2 -2
- package/dist/algorithms/zlib/index.d.ts.map +1 -1
- package/dist/algorithms/zlib/zlib.wasm +0 -0
- package/dist/algorithms/zstd/compress/index.d.ts +2 -2
- package/dist/algorithms/zstd/compress/index.d.ts.map +1 -1
- package/dist/algorithms/zstd/compress/zstd.wasm +0 -0
- package/dist/algorithms/zstd/decompress/zstd.wasm +0 -0
- package/dist/algorithms/zstd/index.d.ts +2 -2
- package/dist/algorithms/zstd/index.d.ts.map +1 -1
- package/dist/algorithms/zstd/zstd.wasm +0 -0
- package/dist/core/capacity.d.ts +1 -1
- package/dist/core/capacity.d.ts.map +1 -1
- package/dist/core/capacity.js +5 -6
- package/dist/core/capacity.js.map +1 -1
- package/dist/core/dispatch.d.ts +15 -4
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +22 -1
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/loader.d.ts +1 -0
- package/dist/core/loader.d.ts.map +1 -1
- package/dist/core/loader.js.map +1 -1
- package/dist/core/types.d.ts +9 -0
- package/dist/core/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/algorithms/lz4_raw/decompress/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,MAAM,QAAQ,GAAG,aAAa,CAAC,eAAe,CAC1C,SAAS,CAAC,MAAM,EAChB,SAAS,EACT,IAAI,GAAG,CAAC,+BAA+B,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAC5D,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/algorithms/lz4_raw/decompress/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,MA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@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { DecompressOptions } from "../../core/types.js";
|
|
2
2
|
export declare const compress: (input: Uint8Array, opts?: import("./index.js").CompressOptions) => Promise<Uint8Array>;
|
|
3
3
|
export declare const compressSync: (input: Uint8Array, opts?: import("./index.js").CompressOptions) => Uint8Array;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Decodes a raw block. Pass `expectedSize` (an output capacity) when known: without it
|
|
6
|
+
* the block is decoded by the incremental stream decoder, which is much slower.
|
|
7
|
+
*/
|
|
5
8
|
export declare function decompress(input: Uint8Array, options?: DecompressOptions): Promise<Uint8Array>;
|
|
6
9
|
/** Decodes a raw block synchronously after preload(). */
|
|
7
10
|
export declare function decompressSync(input: Uint8Array, options?: DecompressOptions): Uint8Array;
|
|
@@ -10,4 +13,11 @@ export declare const version: () => Promise<string>;
|
|
|
10
13
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
11
14
|
export { CompressError } from "../../core/types.js";
|
|
12
15
|
export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
|
|
16
|
+
/** Creates an incremental raw-block decoder; write() emits output as input arrives. */
|
|
17
|
+
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
18
|
+
/** Requires completed preload(), like other synchronous stream factories. */
|
|
19
|
+
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
20
|
+
/** Incrementally decodes one raw block through Web Streams. */
|
|
21
|
+
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
22
|
+
export type { DecompressStream } from "../../core/dispatch.js";
|
|
13
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/lz4_raw/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQ7D,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/lz4_raw/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQ7D,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD;;;GAGG;AACH,wBAAsB,UAAU,CAC5B,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,UAAU,CAAC,CAGrB;AACD,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAG7F;AACD,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;AAE7F,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -8,7 +8,10 @@ import { validateCapacity } from "../../core/capacity.js";
|
|
|
8
8
|
const bindings = /*#__PURE__*/ defineAlgorithm(Algorithm.Lz4Raw, "lz4_raw", new URL("../lz4/lz4.wasm", import.meta.url));
|
|
9
9
|
export const compress = bindings.compress;
|
|
10
10
|
export const compressSync = bindings.compressSync;
|
|
11
|
-
/**
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/algorithms/lz4_raw/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,MAAM,QAAQ,GAAG,aAAa,CAAC,eAAe,CAC1C,SAAS,CAAC,MAAM,EAChB,SAAS,EACT,IAAI,GAAG,CAAC,iBAAiB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;AAClD
|
|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AAGpD,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;AACtE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAAC,0BAA0B,CAAC;AAC9E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,CAAC"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { type DecompressOptions } from "../../../core/types.js";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Decode one block; return actual bytes. Pass `expectedSize` (an output capacity) when
|
|
4
|
+
* known: without it the block is decoded twice, once to measure its size.
|
|
5
|
+
*/
|
|
6
|
+
export declare function decompress(input: Uint8Array, options?: DecompressOptions): Promise<Uint8Array>;
|
|
6
7
|
/** Decode synchronously after preload(), returning only the actual decoded bytes. */
|
|
7
|
-
export declare function decompressSync(input: Uint8Array, options
|
|
8
|
-
expectedSize: number;
|
|
9
|
-
}): Uint8Array;
|
|
8
|
+
export declare function decompressSync(input: Uint8Array, options?: DecompressOptions): Uint8Array;
|
|
10
9
|
/** Load and initialize the decoder once, sharing concurrent initialization. */
|
|
11
10
|
export declare const preload: () => Promise<void>;
|
|
12
11
|
export declare const version: () => Promise<string>;
|
|
13
12
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
14
13
|
export { CompressError } 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";
|
|
15
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lzo/decompress/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM3E
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lzo/decompress/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM3E;;;GAGG;AACH,wBAAsB,UAAU,CAC5B,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,UAAU,CAAC,CAGrB;AACD,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAG7F;AACD,+EAA+E;AAC/E,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
/** Raw LZO1X block decoder. No encoder
|
|
1
|
+
/** Raw LZO1X block decoder. No encoder or container framing; incremental block decoding is supported. */
|
|
2
2
|
import { defineAlgorithm } from "../../../core/algorithm.js";
|
|
3
3
|
import { validateCapacity } from "../../../core/capacity.js";
|
|
4
4
|
import { Algorithm } from "../../../core/types.js";
|
|
5
5
|
const bindings = /*#__PURE__*/ defineAlgorithm(Algorithm.Lzo, "lzo", new URL("./lzo.wasm", import.meta.url));
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Decode one block; return actual bytes. Pass `expectedSize` (an output capacity) when
|
|
8
|
+
* known: without it the block is decoded twice, once to measure its size.
|
|
9
|
+
*/
|
|
10
|
+
export async function decompress(input, options = {}) {
|
|
8
11
|
validateCapacity("lzo", "raw LZO1X", options);
|
|
9
12
|
return bindings.decompress(input, options);
|
|
10
13
|
}
|
|
11
14
|
/** Decode synchronously after preload(), returning only the actual decoded bytes. */
|
|
12
|
-
export function decompressSync(input, options) {
|
|
15
|
+
export function decompressSync(input, options = {}) {
|
|
13
16
|
validateCapacity("lzo", "raw LZO1X", options);
|
|
14
17
|
return bindings.decompressSync(input, options);
|
|
15
18
|
}
|
|
@@ -18,4 +21,10 @@ export const preload = bindings.preload;
|
|
|
18
21
|
export const version = bindings.version;
|
|
19
22
|
export const setMaxDecompressedSize = bindings.setMaxDecompressedSize;
|
|
20
23
|
export { CompressError } from "../../../core/types.js";
|
|
24
|
+
/** Creates an incremental raw-block decoder; write() emits output as input arrives. */
|
|
25
|
+
export const createDecompressStream = bindings.createDecompressStream;
|
|
26
|
+
/** Requires completed preload(), like other synchronous stream factories. */
|
|
27
|
+
export const createDecompressStreamSync = bindings.createDecompressStreamSync;
|
|
28
|
+
/** Incrementally decodes one raw block through Web Streams. */
|
|
29
|
+
export const decompressionStream = bindings.decompressionStream;
|
|
21
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/algorithms/lzo/decompress/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/algorithms/lzo/decompress/index.ts"],"names":[],"mappings":"AAAA,yGA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mBAAmB,GAAG,QAAQ,CAAC,mBAAmB,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").
|
|
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/snappy/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/snappy/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
|
|
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").
|
|
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/snappy/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/snappy/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").
|
|
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/xz/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/xz/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
|
|
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").
|
|
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/xz/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/xz/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").
|
|
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/zlib/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/zlib/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
|
|
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").
|
|
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/zlib/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/zlib/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").
|
|
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/zstd/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/zstd/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
|
|
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").
|
|
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/zstd/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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/zstd/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
|
package/dist/core/capacity.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Validates
|
|
1
|
+
/** Validates an optional caller-supplied output capacity for raw block formats. */
|
|
2
2
|
import { type AlgorithmName, type DecompressOptions } from "./types.js";
|
|
3
3
|
export declare function validateCapacity(name: AlgorithmName, format: string, options: DecompressOptions | undefined): void;
|
|
4
4
|
//# sourceMappingURL=capacity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capacity.d.ts","sourceRoot":"","sources":["../../src/core/capacity.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"capacity.d.ts","sourceRoot":"","sources":["../../src/core/capacity.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,EAAyB,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/F,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACvC,IAAI,CAUN"}
|
package/dist/core/capacity.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/** Validates
|
|
1
|
+
/** Validates an optional caller-supplied output capacity for raw block formats. */
|
|
2
2
|
import { CompressError, Status } from "./types.js";
|
|
3
3
|
export function validateCapacity(name, format, options) {
|
|
4
4
|
const capacity = options?.expectedSize;
|
|
5
|
-
if (capacity === undefined
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
throw new CompressError(Status.InvalidArg, name, `${format} decompression requires expectedSize (output capacity, integer 0..2147483647)`);
|
|
5
|
+
if (capacity === undefined)
|
|
6
|
+
return;
|
|
7
|
+
if (!Number.isSafeInteger(capacity) || capacity < 0 || capacity > 0x7fffffff) {
|
|
8
|
+
throw new CompressError(Status.InvalidArg, name, `${format} expectedSize must be an integer 0..2147483647 (output capacity)`);
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=capacity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../../src/core/capacity.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"capacity.js","sourceRoot":"","sources":["../../src/core/capacity.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,EAA8C,MAAM,YAAY,CAAC;AAE/F,MAAM,UAAU,gBAAgB,CAC5B,IAAmB,EACnB,MAAc,EACd,OAAsC;IAEtC,MAAM,QAAQ,GAAG,OAAO,EAAE,YAAY,CAAC;IACvC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO;IACnC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,UAAU,EAAE,CAAC;QAC3E,MAAM,IAAI,aAAa,CACnB,MAAM,CAAC,UAAU,EACjB,IAAI,EACJ,GAAG,MAAM,kEAAkE,CAC9E,CAAC;IACN,CAAC;AACL,CAAC"}
|
package/dist/core/dispatch.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* tree-shaking.
|
|
10
10
|
*/
|
|
11
11
|
import { type WasmExports } from "./loader.js";
|
|
12
|
-
import { type Algorithm, type AlgorithmName, type CompressOptions, type DecompressOptions } from "./types.js";
|
|
12
|
+
import { type Algorithm, type AlgorithmName, type CompressOptions, type CompressionStreamOptions, type DecompressOptions } from "./types.js";
|
|
13
13
|
/** Tracks allocations so a single try/finally can free them all. */
|
|
14
14
|
declare class Arena {
|
|
15
15
|
private readonly exports;
|
|
@@ -51,6 +51,13 @@ declare abstract class StreamBase {
|
|
|
51
51
|
export declare class CompressStream extends StreamBase {
|
|
52
52
|
constructor(dispatcher: Dispatcher, handle: number);
|
|
53
53
|
write(chunk: Uint8Array): Uint8Array;
|
|
54
|
+
/**
|
|
55
|
+
* Nonterminal flush: returns the bytes a decoder needs to recover
|
|
56
|
+
* everything written so far, and keeps the stream open for more writes.
|
|
57
|
+
* Each flush costs a few bytes. Throws CompressError for snappy and bz2,
|
|
58
|
+
* which can't flush mid-stream.
|
|
59
|
+
*/
|
|
60
|
+
flush(): Uint8Array;
|
|
54
61
|
finish(): Uint8Array;
|
|
55
62
|
}
|
|
56
63
|
export declare class DecompressStream extends StreamBase {
|
|
@@ -73,8 +80,11 @@ export interface AlgorithmBindings {
|
|
|
73
80
|
decompress(input: Uint8Array, opts?: DecompressOptions): Promise<Uint8Array>;
|
|
74
81
|
createCompressStream(opts?: CompressOptions): Promise<CompressStream>;
|
|
75
82
|
createDecompressStream(): Promise<DecompressStream>;
|
|
76
|
-
/**
|
|
77
|
-
|
|
83
|
+
/**
|
|
84
|
+
* TransformStream that compresses bytes as they flow through. With
|
|
85
|
+
* `flushEachChunk`, each output chunk is decodable on arrival.
|
|
86
|
+
*/
|
|
87
|
+
compressionStream(opts?: CompressionStreamOptions): TransformStream<Uint8Array, Uint8Array>;
|
|
78
88
|
/** TransformStream that decompresses bytes as they flow through. */
|
|
79
89
|
decompressionStream(): TransformStream<Uint8Array, Uint8Array>;
|
|
80
90
|
/** Library version, e.g. "0.6.0". */
|
|
@@ -82,7 +92,8 @@ export interface AlgorithmBindings {
|
|
|
82
92
|
/**
|
|
83
93
|
* Cap on decompressed size (bytes) for the one-shot decompress path.
|
|
84
94
|
* Defaults to 1 GiB. Set 0 to disable. Streaming decompress is not
|
|
85
|
-
* affected
|
|
95
|
+
* affected except raw LZ4/LZO, which capture the cap at creation. Bound
|
|
96
|
+
* buffers for other streams yourself. Thread-local in C; in WASM
|
|
86
97
|
* it's effectively global to this module instance.
|
|
87
98
|
*/
|
|
88
99
|
setMaxDecompressedSize(bytes: number): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/core/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA0C,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EACH,KAAK,SAAS,EAGd,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACzB,MAAM,YAAY,CAAC;AAUpB,oEAAoE;AACpE,cAAM,KAAK;IACP,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;IAErC,YAAY,OAAO,EAAE,WAAW,EAE/B;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,MAAM,CAapD;IAED,OAAO,IAAI,IAAI,CAGd;CACJ;AAED,qBAAa,UAAU;IACnB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,WAAW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,GAAG,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;AAyBlG,wBAAgB,cAAc,CAC1B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,YAAY,GAC1B,iBAAiB,CA4GnB"}
|
package/dist/core/dispatch.js
CHANGED
|
@@ -223,6 +223,19 @@ export class CompressStream extends StreamBase {
|
|
|
223
223
|
}
|
|
224
224
|
return drain(this.dispatcher, chunk, (inPtr, inLen, outPtr, outLenPtr) => this.dispatcher.exports.cu_compress_stream_write(this.handle, inPtr, inLen, outPtr, outLenPtr));
|
|
225
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Nonterminal flush: returns the bytes a decoder needs to recover
|
|
228
|
+
* everything written so far, and keeps the stream open for more writes.
|
|
229
|
+
* Each flush costs a few bytes. Throws CompressError for snappy and bz2,
|
|
230
|
+
* which can't flush mid-stream.
|
|
231
|
+
*/
|
|
232
|
+
flush() {
|
|
233
|
+
this.ensureLive();
|
|
234
|
+
if (this.finished) {
|
|
235
|
+
throw new CompressError(Status.StreamFinished, this.dispatcher.algorithmName, "flush after finish");
|
|
236
|
+
}
|
|
237
|
+
return drain(this.dispatcher, null, (_in, _len, outPtr, outLenPtr) => this.dispatcher.exports.cu_compress_stream_flush(this.handle, outPtr, outLenPtr));
|
|
238
|
+
}
|
|
226
239
|
finish() {
|
|
227
240
|
this.ensureLive();
|
|
228
241
|
this.finished = true;
|
|
@@ -372,7 +385,15 @@ export function createBindings(algorithm, name, wasmUrl, resolveWasm) {
|
|
|
372
385
|
stream = (await getDispatcher()).createCompressStream(opts);
|
|
373
386
|
},
|
|
374
387
|
transform(chunk, controller) {
|
|
375
|
-
|
|
388
|
+
let out = stream.write(chunk);
|
|
389
|
+
if (opts?.flushEachChunk) {
|
|
390
|
+
// One output chunk per input chunk, decodable on its own.
|
|
391
|
+
const flushed = stream.flush();
|
|
392
|
+
const joined = new Uint8Array(out.byteLength + flushed.byteLength);
|
|
393
|
+
joined.set(out, 0);
|
|
394
|
+
joined.set(flushed, out.byteLength);
|
|
395
|
+
out = joined;
|
|
396
|
+
}
|
|
376
397
|
if (out.byteLength > 0)
|
|
377
398
|
controller.enqueue(out);
|
|
378
399
|
},
|