@hpcc-js/wasm-zstd 1.9.0 → 1.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/wasm-zstd",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "hpcc-js - WASM zstd",
5
5
  "type": "module",
6
6
  "exports": {
@@ -38,7 +38,7 @@
38
38
  "update-major": "npx -y npm-check-updates -u"
39
39
  },
40
40
  "devDependencies": {
41
- "@hpcc-js/esbuild-plugins": "1.7.0",
41
+ "@hpcc-js/esbuild-plugins": "1.8.0",
42
42
  "@hpcc-js/wasm-util": "1.0.0"
43
43
  },
44
44
  "keywords": [
@@ -57,5 +57,5 @@
57
57
  },
58
58
  "homepage": "https://hpcc-systems.github.io/hpcc-js-wasm/",
59
59
  "license": "Apache-2.0",
60
- "gitHead": "6799e024fc9186c4a4f87294862142f00628e597"
60
+ "gitHead": "e34abaa76d55e43967e9da38228c28d75dd4d43a"
61
61
  }
package/src/zstd.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // @ts-expect-error importing from a wasm file is resolved via a custom esbuild plugin
2
2
  import load, { reset } from "../../../build/packages/zstd/zstdlib.wasm";
3
- import type { MainModule, zstd } from "../../../build/packages/zstd/zstdlib.js";
3
+ import type { MainModule, zstd } from "../types/zstdlib.js";
4
4
  import { MainModuleEx } from "@hpcc-js/wasm-util";
5
5
  type ZstdExports = MainModule["zstd"];
6
6
 
package/types/zstd.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MainModule } from "../../../build/packages/zstd/zstdlib.js";
1
+ import type { MainModule } from "../types/zstdlib.js";
2
2
  import { MainModuleEx } from "@hpcc-js/wasm-util";
3
3
  /**
4
4
  * The Zstandard WASM library, provides a simplified wrapper around the Zstandard c++ library.
@@ -0,0 +1,64 @@
1
+ // TypeScript bindings for emscripten-generated code. Automatically generated at compile time.
2
+ declare namespace RuntimeExports {
3
+ /**
4
+ * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
5
+ * emscripten HEAP, returns a copy of that string as a Javascript String object.
6
+ *
7
+ * @param {number} ptr
8
+ * @param {number=} maxBytesToRead - An optional length that specifies the
9
+ * maximum number of bytes to read. You can omit this parameter to scan the
10
+ * string until the first 0 byte. If maxBytesToRead is passed, and the string
11
+ * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
12
+ * string will cut short at that byte index.
13
+ * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
14
+ * @return {string}
15
+ */
16
+ function UTF8ToString(ptr: number, maxBytesToRead?: number | undefined, ignoreNul?: boolean | undefined): string;
17
+ function lengthBytesUTF8(str: any): number;
18
+ function stringToUTF8(str: any, outPtr: any, maxBytesToWrite: any): any;
19
+ let HEAPU8: any;
20
+ }
21
+ interface WasmModule {
22
+ _malloc(_0: number): number;
23
+ _free(_0: number): void;
24
+ }
25
+
26
+ export interface ClassHandle {
27
+ isAliasOf(other: ClassHandle): boolean;
28
+ delete(): void;
29
+ deleteLater(): this;
30
+ isDeleted(): boolean;
31
+ // @ts-ignore - If targeting lower than ESNext, this symbol might not exist.
32
+ [Symbol.dispose](): void;
33
+ clone(): this;
34
+ }
35
+ export interface zstd extends ClassHandle {
36
+ reset(): void;
37
+ setCompressionLevel(_0: number): void;
38
+ compressChunk(_0: number, _1: number, _2: number, _3: number): number;
39
+ compressEnd(_0: number, _1: number): number;
40
+ decompressChunk(_0: number, _1: number, _2: number, _3: number): number;
41
+ }
42
+
43
+ interface EmbindModule {
44
+ zstd: {
45
+ new(): zstd;
46
+ minCLevel(): number;
47
+ maxCLevel(): number;
48
+ defaultCLevel(): number;
49
+ malloc(_0: number): number;
50
+ free(_0: number): void;
51
+ compress(_0: number, _1: number, _2: number, _3: number, _4: number): number;
52
+ decompress(_0: number, _1: number, _2: number, _3: number): number;
53
+ findFrameCompressedSize(_0: number, _1: number): number;
54
+ compressBound(_0: number): number;
55
+ CStreamOutSize(): number;
56
+ isError(_0: number): number;
57
+ getFrameContentSize(_0: number, _1: number): number;
58
+ version(): string;
59
+ getErrorName(_0: number): string;
60
+ };
61
+ }
62
+
63
+ export type MainModule = WasmModule & typeof RuntimeExports & EmbindModule;
64
+ export default function MainModuleFactory (options?: unknown): Promise<MainModule>;