@thi.ng/wasm-api 1.2.2 → 1.2.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-12-06T17:16:38Z
3
+ - **Last updated**: 2022-12-16T12:52:25Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![wasm-api](https://media.thi.ng/umbrella/banners-20220914/thing-wasm-api.svg?be328da7)
3
+ # ![@thi.ng/wasm-api](https://media.thi.ng/umbrella/banners-20220914/thing-wasm-api.svg?be328da7)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/wasm-api.svg)](https://www.npmjs.com/package/@thi.ng/wasm-api)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/wasm-api.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -31,7 +31,7 @@ This project is part of the
31
31
 
32
32
  ## About
33
33
 
34
- Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects.
34
+ Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects
35
35
 
36
36
  This package provides the following:
37
37
 
@@ -313,8 +313,8 @@ built-in build system is as simple as:
313
313
  const std = @import("std");
314
314
 
315
315
  pub fn build(b: *std.build.Builder) void {
316
- // obtain a standard std.build.LibExeObjStep, pre-configured w/ given options
317
- // see source comments in imported build.zig for further details...
316
+ // obtain a standard std.build.LibExeObjStep, pre-configured w/ given options
317
+ // see source comments in imported build.zig for further details...
318
318
  var lib = @import("node_modules/@thi.ng/wasm-api/zig/build.zig").wasmLib(b, .{
319
319
  // Declare extra WASM API packages to use
320
320
  // Each package can also declare dependencies to other such packages
@@ -324,14 +324,14 @@ pub fn build(b: *std.build.Builder) void {
324
324
  .{ .id = "wasm-api-schedule", .path = "@thi.ng/wasm-api-schedule/zig/lib.zig" },
325
325
  },
326
326
  // (optional) build mode override
327
- // if commented out, we can pass CLI args to choose build mode (default: .Debug)
327
+ // if commented out, we can pass CLI args to choose build mode (default: .Debug)
328
328
  .mode = .ReleaseSmall,
329
329
  });
330
- // optionally, add further custom configuration
331
- // ...
330
+ // optionally, add further custom configuration
331
+ // ...
332
332
 
333
- // finally trigger build
334
- lib.install();
333
+ // finally trigger build
334
+ lib.install();
335
335
  }
336
336
  ```
337
337
 
@@ -374,11 +374,8 @@ ES module import:
374
374
 
375
375
  For Node.js REPL:
376
376
 
377
- ```text
378
- # with flag only for < v16
379
- node --experimental-repl-await
380
-
381
- > const wasmApi = await import("@thi.ng/wasm-api");
377
+ ```js
378
+ const wasmApi = await import("@thi.ng/wasm-api");
382
379
  ```
383
380
 
384
381
  Package sizes (brotli'd, pre-treeshake): ESM: 2.47 KB
@@ -521,7 +518,7 @@ emcc -Os -Inode_modules/@thi.ng/wasm-api/include \
521
518
 
522
519
  ## Authors
523
520
 
524
- Karsten Schmidt
521
+ - [Karsten Schmidt](https://thi.ng)
525
522
 
526
523
  If this project contributes to an academic publication, please cite it as:
527
524
 
@@ -536,4 +533,4 @@ If this project contributes to an academic publication, please cite it as:
536
533
 
537
534
  ## License
538
535
 
539
- &copy; 2022 Karsten Schmidt // Apache Software License 2.0
536
+ &copy; 2022 Karsten Schmidt // Apache License 2.0
package/api.d.ts CHANGED
@@ -2,8 +2,8 @@ import type { Fn, IDeref, ILength } from "@thi.ng/api";
2
2
  import type { WasmBridge } from "./bridge.js";
3
3
  export declare const EVENT_MEMORY_CHANGED = "memory-changed";
4
4
  export declare const EVENT_PANIC = "panic";
5
- export declare type BigIntArray = bigint[] | BigInt64Array | BigUint64Array;
6
- export declare type ReadonlyWasmString = IDeref<string> & ILength & {
5
+ export type BigIntArray = bigint[] | BigInt64Array | BigUint64Array;
6
+ export type ReadonlyWasmString = IDeref<string> & ILength & {
7
7
  readonly addr: number;
8
8
  };
9
9
  export interface WasmTypeBase {
@@ -21,7 +21,7 @@ export interface WasmType<T> {
21
21
  readonly size: number;
22
22
  instance: Fn<number, T>;
23
23
  }
24
- export declare type WasmTypeConstructor<T> = Fn<IWasmMemoryAccess, WasmType<T>>;
24
+ export type WasmTypeConstructor<T> = Fn<IWasmMemoryAccess, WasmType<T>>;
25
25
  /**
26
26
  * Common interface for WASM/JS child APIs which will be used in combination
27
27
  * with a parent {@link WasmBridge}.
@@ -111,7 +111,7 @@ export interface WasmExports {
111
111
  */
112
112
  _wasm_free(addr: number, numBytes: number): void;
113
113
  }
114
- export declare type MemorySlice = [addr: number, len: number];
114
+ export type MemorySlice = [addr: number, len: number];
115
115
  export interface IWasmMemoryAccess {
116
116
  i8: Int8Array;
117
117
  u8: Uint8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/wasm-api",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Generic, modular, extensible API bridge and infrastructure for hybrid JS & WebAssembly projects",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
12
12
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/master/packages/wasm-api#readme",
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/wasm-api#readme",
14
14
  "funding": [
15
15
  {
16
16
  "type": "github",
@@ -21,7 +21,7 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
27
  "build": "yarn clean && tsc --declaration",
@@ -35,21 +35,21 @@
35
35
  "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
36
  },
37
37
  "dependencies": {
38
- "@thi.ng/api": "^8.5.1",
39
- "@thi.ng/arrays": "^2.4.4",
40
- "@thi.ng/checks": "^3.3.4",
41
- "@thi.ng/errors": "^2.2.5",
42
- "@thi.ng/hex": "^2.3.1",
43
- "@thi.ng/idgen": "^2.1.20",
44
- "@thi.ng/logger": "^1.4.4"
38
+ "@thi.ng/api": "^8.6.1",
39
+ "@thi.ng/arrays": "^2.4.6",
40
+ "@thi.ng/checks": "^3.3.5",
41
+ "@thi.ng/errors": "^2.2.6",
42
+ "@thi.ng/hex": "^2.3.2",
43
+ "@thi.ng/idgen": "^2.1.22",
44
+ "@thi.ng/logger": "^1.4.5"
45
45
  },
46
46
  "devDependencies": {
47
- "@microsoft/api-extractor": "^7.33.5",
48
- "@thi.ng/testament": "^0.3.6",
47
+ "@microsoft/api-extractor": "^7.33.7",
48
+ "@thi.ng/testament": "^0.3.7",
49
49
  "rimraf": "^3.0.2",
50
50
  "tools": "^0.0.1",
51
- "typedoc": "^0.23.20",
52
- "typescript": "^4.8.4"
51
+ "typedoc": "^0.23.22",
52
+ "typescript": "^4.9.4"
53
53
  },
54
54
  "keywords": [
55
55
  "allocator",
@@ -115,5 +115,5 @@
115
115
  "status": "alpha",
116
116
  "year": 2022
117
117
  },
118
- "gitHead": "54c5f22520162bac0d58426a3f86ca636e797f71\n"
118
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
119
119
  }