@nirs4all/formats-wasm 0.2.16 → 0.2.17
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.
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
export function _start(): void;
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Decode an explicitly declared non-spectral PNG/VCF profile through the Rust owner.
|
|
8
|
+
*/
|
|
9
|
+
export function decodeMultimodalBytes(profile: string, bytes: Uint8Array | number[], max_decoded_bytes: number): any;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Feature flags the WASM build was compiled with. Useful for runtime checks
|
|
8
13
|
* from JS ("does this WASM bundle have HDF5 support?").
|
|
@@ -12,6 +17,8 @@ export function _start(): void;
|
|
|
12
17
|
*/
|
|
13
18
|
export function features(): any;
|
|
14
19
|
|
|
20
|
+
export function multimodalReaderCatalog(): any;
|
|
21
|
+
|
|
15
22
|
/**
|
|
16
23
|
* Decode a file by name + bytes. Returns the spectral records as a JS array
|
|
17
24
|
* matching the JSON shape produced by `nirs4all-formats read-json`.
|
package/nirs4all_formats_wasm.js
CHANGED
|
@@ -5,6 +5,34 @@ function _start() {
|
|
|
5
5
|
}
|
|
6
6
|
exports._start = _start;
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Decode an explicitly declared non-spectral PNG/VCF profile through the Rust owner.
|
|
10
|
+
* @param {string} profile
|
|
11
|
+
* @param {Uint8Array | number[]} bytes
|
|
12
|
+
* @param {number} max_decoded_bytes
|
|
13
|
+
* @returns {any}
|
|
14
|
+
*/
|
|
15
|
+
function decodeMultimodalBytes(profile, bytes, max_decoded_bytes) {
|
|
16
|
+
const val3 = +max_decoded_bytes;
|
|
17
|
+
let ptr0, len0, ptr1, len1;
|
|
18
|
+
try {
|
|
19
|
+
ptr0 = passStringToWasm0(profile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
20
|
+
len0 = WASM_VECTOR_LEN;
|
|
21
|
+
ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
22
|
+
len1 = WASM_VECTOR_LEN;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
|
|
25
|
+
if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
28
|
+
const ret = wasm.decodeMultimodalBytes(ptr0, len0, ptr1, len1, val3);
|
|
29
|
+
if (ret[2]) {
|
|
30
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
31
|
+
}
|
|
32
|
+
return takeFromExternrefTable0(ret[0]);
|
|
33
|
+
}
|
|
34
|
+
exports.decodeMultimodalBytes = decodeMultimodalBytes;
|
|
35
|
+
|
|
8
36
|
/**
|
|
9
37
|
* Feature flags the WASM build was compiled with. Useful for runtime checks
|
|
10
38
|
* from JS ("does this WASM bundle have HDF5 support?").
|
|
@@ -22,6 +50,18 @@ function features() {
|
|
|
22
50
|
}
|
|
23
51
|
exports.features = features;
|
|
24
52
|
|
|
53
|
+
/**
|
|
54
|
+
* @returns {any}
|
|
55
|
+
*/
|
|
56
|
+
function multimodalReaderCatalog() {
|
|
57
|
+
const ret = wasm.multimodalReaderCatalog();
|
|
58
|
+
if (ret[2]) {
|
|
59
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
60
|
+
}
|
|
61
|
+
return takeFromExternrefTable0(ret[0]);
|
|
62
|
+
}
|
|
63
|
+
exports.multimodalReaderCatalog = multimodalReaderCatalog;
|
|
64
|
+
|
|
25
65
|
/**
|
|
26
66
|
* Decode a file by name + bytes. Returns the spectral records as a JS array
|
|
27
67
|
* matching the JSON shape produced by `nirs4all-formats read-json`.
|
|
Binary file
|
package/package.json
CHANGED