motely-wasm 17.2.1 → 17.2.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.
Files changed (2) hide show
  1. package/index.mjs +42 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,6 +1,48 @@
1
1
  import { boot, exit, getStatus, BootStatus } from "./boot.mjs";
2
2
  import { manifest } from "./resources.mjs";
3
3
  import { app } from "./dotnet/index.mjs";
4
+ import { Motely } from "./generated/index.g.mjs";
5
+
6
+ const MotelyWasm = {
7
+ getVersion: Motely.getVersion,
8
+ validateJaml: Motely.validateJaml,
9
+ explainJaml: Motely.explainJaml,
10
+ getTallyLabels: Motely.getTallyLabels,
11
+ analyzeJamlSeeds: Motely.analyzeJamlSeeds,
12
+ startRandomSearch: Motely.startRandomSearch,
13
+ startAestheticSearch: Motely.startAestheticSearch,
14
+ startSequentialSearch: Motely.startSequentialSearch,
15
+ runSequentialSearchBatch: Motely.runSequentialSearchBatch,
16
+ startSeedListSearch: Motely.startSeedListSearch,
17
+ startKeywordSearch: Motely.startKeywordSearch
18
+ };
19
+
20
+ let notifyProgress;
21
+ let notifyResult;
22
+ let notifyComplete;
23
+ Motely.onSearchProgress.subscribe((searched, matched) => notifyProgress?.(searched, matched));
24
+ Motely.onSearchResult.subscribe((seed, score, tallyColumns) => notifyResult?.(seed, score, tallyColumns));
25
+ Motely.onSearchComplete.subscribe((status, totalSearched, matching) => notifyComplete?.(status, totalSearched, matching));
26
+
27
+ const MotelyWasmEvents = {};
28
+ Object.defineProperties(MotelyWasmEvents, {
29
+ notifyProgress: {
30
+ get: () => notifyProgress,
31
+ set: (fn) => { notifyProgress = typeof fn === "function" ? fn : undefined; }
32
+ },
33
+ notifyResult: {
34
+ get: () => notifyResult,
35
+ set: (fn) => { notifyResult = typeof fn === "function" ? fn : undefined; }
36
+ },
37
+ notifyComplete: {
38
+ get: () => notifyComplete,
39
+ set: (fn) => { notifyComplete = typeof fn === "function" ? fn : undefined; }
40
+ }
41
+ });
42
+
43
+ Motely.MotelyWasm ??= MotelyWasm;
44
+ Motely.MotelyWasmEvents ??= MotelyWasmEvents;
45
+
4
46
  export default {
5
47
  boot,
6
48
  exit,
package/package.json CHANGED
@@ -19,6 +19,6 @@
19
19
  "node:crypto": false,
20
20
  "node:process": false
21
21
  },
22
- "version": "17.2.1",
22
+ "version": "17.2.2",
23
23
  "types": "./index.d.mts"
24
24
  }