motely-wasm 17.2.1 → 17.2.3

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 +50 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,6 +1,56 @@
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 PACKAGE_VERSION = "17.2.3";
7
+
8
+ const MotelyWasm = {
9
+ getVersion: () => {
10
+ try {
11
+ return Motely.getVersion();
12
+ } catch {
13
+ return PACKAGE_VERSION;
14
+ }
15
+ },
16
+ validateJaml: Motely.validateJaml,
17
+ explainJaml: Motely.explainJaml,
18
+ getTallyLabels: Motely.getTallyLabels,
19
+ analyzeJamlSeeds: Motely.analyzeJamlSeeds,
20
+ startRandomSearch: Motely.startRandomSearch,
21
+ startAestheticSearch: Motely.startAestheticSearch,
22
+ startSequentialSearch: Motely.startSequentialSearch,
23
+ runSequentialSearchBatch: Motely.runSequentialSearchBatch,
24
+ startSeedListSearch: Motely.startSeedListSearch,
25
+ startKeywordSearch: Motely.startKeywordSearch
26
+ };
27
+
28
+ let notifyProgress;
29
+ let notifyResult;
30
+ let notifyComplete;
31
+ Motely.onSearchProgress.subscribe((searched, matched) => notifyProgress?.(searched, matched));
32
+ Motely.onSearchResult.subscribe((seed, score, tallyColumns) => notifyResult?.(seed, score, tallyColumns));
33
+ Motely.onSearchComplete.subscribe((status, totalSearched, matching) => notifyComplete?.(status, totalSearched, matching));
34
+
35
+ const MotelyWasmEvents = {};
36
+ Object.defineProperties(MotelyWasmEvents, {
37
+ notifyProgress: {
38
+ get: () => notifyProgress,
39
+ set: (fn) => { notifyProgress = typeof fn === "function" ? fn : undefined; }
40
+ },
41
+ notifyResult: {
42
+ get: () => notifyResult,
43
+ set: (fn) => { notifyResult = typeof fn === "function" ? fn : undefined; }
44
+ },
45
+ notifyComplete: {
46
+ get: () => notifyComplete,
47
+ set: (fn) => { notifyComplete = typeof fn === "function" ? fn : undefined; }
48
+ }
49
+ });
50
+
51
+ Motely.MotelyWasm ??= MotelyWasm;
52
+ Motely.MotelyWasmEvents ??= MotelyWasmEvents;
53
+
4
54
  export default {
5
55
  boot,
6
56
  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.3",
23
23
  "types": "./index.d.mts"
24
24
  }