@thi.ng/wasm-api 2.5.0 → 2.5.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/api.d.ts CHANGED
@@ -99,7 +99,7 @@ export interface WasmModuleSpec<T extends WasmExports = WasmExports> {
99
99
  /**
100
100
  * Module options to configure advanced WASM features
101
101
  */
102
- opts?: WasmModuleOpts;
102
+ opts?: Partial<WasmModuleOpts>;
103
103
  }
104
104
  export interface WasmModuleOpts {
105
105
  /**
@@ -115,7 +115,7 @@ export interface WasmModuleOpts {
115
115
  * - https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/promising_static
116
116
  * - https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Suspending
117
117
  */
118
- asyncExports?: string[];
118
+ asyncExports: string[];
119
119
  }
120
120
  /**
121
121
  * Base interface of exports declared by the WASM module. At the very least, a
package/bridge.d.ts CHANGED
@@ -59,8 +59,8 @@ export declare class WasmBridge<T extends WasmExports = WasmExports> implements
59
59
  imports: WebAssembly.Imports;
60
60
  exports: T;
61
61
  api: CoreAPI;
62
- moduleSpecs: IObjectOf<WasmModuleSpec<T>>;
63
- modules: IObjectOf<IWasmAPI<T>>;
62
+ moduleSpecs: IObjectOf<WasmModuleSpec>;
63
+ modules: IObjectOf<IWasmAPI>;
64
64
  order: string[];
65
65
  constructor(modules?: WasmModuleSpec<T>[], logger?: ILogger);
66
66
  /**
package/bridge.js CHANGED
@@ -213,7 +213,7 @@ let WasmBridge = class {
213
213
  return true;
214
214
  }
215
215
  _prepareExports(exports) {
216
- for (let modID in this.modules) {
216
+ for (let modID in this.moduleSpecs) {
217
217
  const opts = this.moduleSpecs[modID].opts;
218
218
  if (!opts?.asyncExports) continue;
219
219
  for (let id of opts.asyncExports) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/wasm-api",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -128,5 +128,5 @@
128
128
  "tag": "wasm",
129
129
  "year": 2022
130
130
  },
131
- "gitHead": "6a4e7c564ebc476770d213d98a2aa6257a41ac15"
131
+ "gitHead": "fc5518f2823fb81e712b66ec018c8c819c0a506d"
132
132
  }