@imferno/wasm 3.0.2-fix-working-group-resolutions.c9f13d5 → 3.0.2-fix-napi-typescript-types.ddf740f
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 +16 -10
- package/imferno_wasm.d.ts +2 -484
- package/imferno_wasm.js +2 -7
- package/imferno_wasm_bg.wasm +0 -0
- package/index.d.ts +41 -48
- package/index.js +11 -4
- package/package.json +4 -1
- package/types.d.ts +1337 -0
package/index.js
CHANGED
|
@@ -18,7 +18,7 @@ function ensureInit() {
|
|
|
18
18
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
19
19
|
const wasmPath = path.join(__dirname, 'imferno_wasm_bg.wasm');
|
|
20
20
|
const wasmBuffer = readFileSync(wasmPath);
|
|
21
|
-
initPromise = wasmInit(wasmBuffer);
|
|
21
|
+
initPromise = wasmInit({ module_or_path: wasmBuffer });
|
|
22
22
|
} catch (error) {
|
|
23
23
|
console.error('Failed to load WASM in Node.js:', error);
|
|
24
24
|
throw error;
|
|
@@ -63,6 +63,13 @@ export async function getVersion() {
|
|
|
63
63
|
// Typed validation codes
|
|
64
64
|
export { codes } from './codes.js';
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Initialise the WASM module explicitly (optional — every function does it on
|
|
68
|
+
* first use). Pass the `.wasm` bytes or a compiled module to skip fetching.
|
|
69
|
+
*/
|
|
70
|
+
export function init(wasmBytes) {
|
|
71
|
+
if (!initPromise) {
|
|
72
|
+
initPromise = wasmInit(wasmBytes === undefined ? undefined : { module_or_path: wasmBytes });
|
|
73
|
+
}
|
|
74
|
+
return initPromise.then(() => undefined);
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imferno/wasm",
|
|
3
|
-
"version": "3.0.2-fix-
|
|
3
|
+
"version": "3.0.2-fix-napi-typescript-types.ddf740f",
|
|
4
4
|
"description": "Fast, type-safe SMPTE ST 2067 IMF parser for JavaScript and TypeScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"codes.d.ts",
|
|
15
15
|
"index.js",
|
|
16
16
|
"index.d.ts",
|
|
17
|
+
"types.d.ts",
|
|
17
18
|
"README.md",
|
|
18
19
|
"LICENSE"
|
|
19
20
|
],
|
|
@@ -58,6 +59,8 @@
|
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"ajv": "^8.18.0",
|
|
62
|
+
"ts-json-schema-generator": "2.9.0",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
61
64
|
"vitest": "^4.0.18"
|
|
62
65
|
}
|
|
63
66
|
}
|