@thi.ng/wasm-api 1.4.56 → 1.4.58
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/CHANGELOG.md +1 -1
- package/README.md +3 -4
- package/bridge.d.ts +2 -0
- package/bridge.js +2 -0
- package/package.json +11 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -128,11 +128,8 @@ export class CustomAPI implements IWasmAPI {
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Now we can supply this custom API when creating the main WASM bridge:
|
|
134
131
|
|
|
135
|
-
|
|
132
|
+
// now we can supply this custom API when creating the main WASM bridge:
|
|
136
133
|
export const bridge = new WasmBridge([new CustomAPI()]);
|
|
137
134
|
```
|
|
138
135
|
|
|
@@ -223,6 +220,8 @@ file and
|
|
|
223
220
|
for more details...
|
|
224
221
|
|
|
225
222
|
```ts
|
|
223
|
+
// (see sections further below for bridge initialization...)
|
|
224
|
+
|
|
226
225
|
try {
|
|
227
226
|
// allocate 256 bytes of memory for passing a string to WASM side
|
|
228
227
|
// the function returns a tuple of `[address, len]`
|
package/bridge.d.ts
CHANGED
|
@@ -112,6 +112,8 @@ export declare class WasmBridge<T extends WasmExports = WasmExports> implements
|
|
|
112
112
|
* The following creates a bridge with a fictional `custom` API module:
|
|
113
113
|
*
|
|
114
114
|
* ```ts
|
|
115
|
+
* import { WasmBridge } from "@thi.ng/wasm-api";
|
|
116
|
+
*
|
|
115
117
|
* const bridge = new WasmBridge([new CustomAPI()]);
|
|
116
118
|
*
|
|
117
119
|
* // get combined imports object
|
package/bridge.js
CHANGED
|
@@ -187,6 +187,8 @@ let WasmBridge = class {
|
|
|
187
187
|
* The following creates a bridge with a fictional `custom` API module:
|
|
188
188
|
*
|
|
189
189
|
* ```ts
|
|
190
|
+
* import { WasmBridge } from "@thi.ng/wasm-api";
|
|
191
|
+
*
|
|
190
192
|
* const bridge = new WasmBridge([new CustomAPI()]);
|
|
191
193
|
*
|
|
192
194
|
* // get combined imports object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/wasm-api",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.58",
|
|
4
4
|
"description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -33,16 +33,17 @@
|
|
|
33
33
|
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
34
34
|
"pub": "yarn npm publish --access public",
|
|
35
35
|
"test": "bun test",
|
|
36
|
-
"test:build-zig": "zig build-lib -O ReleaseSmall -target wasm32-freestanding -dynamic --strip --pkg-begin wasmapi zig/lib.zig --pkg-end test/custom.zig && wasm-dis -o custom.wast custom.wasm && cp custom.wasm test"
|
|
36
|
+
"test:build-zig": "zig build-lib -O ReleaseSmall -target wasm32-freestanding -dynamic --strip --pkg-begin wasmapi zig/lib.zig --pkg-end test/custom.zig && wasm-dis -o custom.wast custom.wasm && cp custom.wasm test",
|
|
37
|
+
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.9.
|
|
40
|
-
"@thi.ng/arrays": "^2.8.
|
|
41
|
-
"@thi.ng/checks": "^3.5.
|
|
42
|
-
"@thi.ng/errors": "^2.4.
|
|
43
|
-
"@thi.ng/hex": "^2.3.
|
|
44
|
-
"@thi.ng/idgen": "^2.2.
|
|
45
|
-
"@thi.ng/logger": "^3.0.
|
|
40
|
+
"@thi.ng/api": "^8.9.28",
|
|
41
|
+
"@thi.ng/arrays": "^2.8.6",
|
|
42
|
+
"@thi.ng/checks": "^3.5.2",
|
|
43
|
+
"@thi.ng/errors": "^2.4.20",
|
|
44
|
+
"@thi.ng/hex": "^2.3.39",
|
|
45
|
+
"@thi.ng/idgen": "^2.2.32",
|
|
46
|
+
"@thi.ng/logger": "^3.0.5"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -115,5 +116,5 @@
|
|
|
115
116
|
"status": "alpha",
|
|
116
117
|
"year": 2022
|
|
117
118
|
},
|
|
118
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
|
|
119
120
|
}
|