@imferno/wasm 3.0.2-fix-working-group-resolutions.9aee1e2 → 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/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
- // For users who want manual control
67
- export { wasmInit as init };
68
- export { wasm };
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-working-group-resolutions.9aee1e2",
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
  }