@thi.ng/wasm-api 2.5.0 → 2.5.2
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 +2 -2
- package/api.d.ts +2 -2
- package/bridge.d.ts +2 -2
- package/bridge.js +4 -4
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
10
|
|
|
11
|
-
> This is one of
|
|
11
|
+
> This is one of 217 standalone projects. LLM-free, human-made and
|
|
12
12
|
> cared for software, maintained as part of the
|
|
13
13
|
> [@thi.ng/umbrella](https://codeberg.org/thi.ng/umbrella/) ecosystem and
|
|
14
14
|
> anti-framework.
|
|
@@ -499,7 +499,7 @@ Browser ESM import:
|
|
|
499
499
|
|
|
500
500
|
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
501
501
|
|
|
502
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 3.
|
|
502
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 3.38 KB
|
|
503
503
|
|
|
504
504
|
## Dependencies
|
|
505
505
|
|
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
|
|
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
|
|
63
|
-
modules: IObjectOf<IWasmAPI
|
|
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
|
@@ -179,7 +179,7 @@ let WasmBridge = class {
|
|
|
179
179
|
if (isAsyncFunction(moduleImports[id])) {
|
|
180
180
|
if (!("Suspending" in WebAssembly))
|
|
181
181
|
unsupportedFeature(
|
|
182
|
-
|
|
182
|
+
`async function in WASM module imports: ${id}`
|
|
183
183
|
);
|
|
184
184
|
moduleImports[id] = new WebAssembly["Suspending"](
|
|
185
185
|
moduleImports[id]
|
|
@@ -213,7 +213,7 @@ let WasmBridge = class {
|
|
|
213
213
|
return true;
|
|
214
214
|
}
|
|
215
215
|
_prepareExports(exports) {
|
|
216
|
-
for (let modID in this.
|
|
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) {
|
|
@@ -221,7 +221,7 @@ let WasmBridge = class {
|
|
|
221
221
|
if (item != null) {
|
|
222
222
|
if (!("promising" in WebAssembly))
|
|
223
223
|
unsupportedFeature(
|
|
224
|
-
|
|
224
|
+
`async function in WASM module exports: ${id}`
|
|
225
225
|
);
|
|
226
226
|
exports = {
|
|
227
227
|
...exports,
|
|
@@ -229,7 +229,7 @@ let WasmBridge = class {
|
|
|
229
229
|
};
|
|
230
230
|
} else {
|
|
231
231
|
this.logger.warn(
|
|
232
|
-
`WASM export ${id} declared as async, but missing...`
|
|
232
|
+
`WASM export '${id}' declared as async, but missing...`
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@thi.ng/api": "^8.12.
|
|
47
|
-
"@thi.ng/arrays": "^2.14.
|
|
48
|
-
"@thi.ng/checks": "^3.11.
|
|
49
|
-
"@thi.ng/errors": "^2.6.
|
|
50
|
-
"@thi.ng/hex": "^2.4.
|
|
51
|
-
"@thi.ng/idgen": "^2.2.
|
|
52
|
-
"@thi.ng/logger": "^3.3.
|
|
46
|
+
"@thi.ng/api": "^8.12.28",
|
|
47
|
+
"@thi.ng/arrays": "^2.14.26",
|
|
48
|
+
"@thi.ng/checks": "^3.11.1",
|
|
49
|
+
"@thi.ng/errors": "^2.6.17",
|
|
50
|
+
"@thi.ng/hex": "^2.4.20",
|
|
51
|
+
"@thi.ng/idgen": "^2.2.102",
|
|
52
|
+
"@thi.ng/logger": "^3.3.11"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"esbuild": "^0.28.
|
|
56
|
-
"typedoc": "^0.28.
|
|
55
|
+
"esbuild": "^0.28.2",
|
|
56
|
+
"typedoc": "^0.28.20",
|
|
57
57
|
"typescript": "^6.0.3"
|
|
58
58
|
},
|
|
59
59
|
"keywords": [
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"tag": "wasm",
|
|
129
129
|
"year": 2022
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "57ce96457ee0b8de5b17f9d371e6707780c64bd7"
|
|
132
132
|
}
|