nucleation 0.2.11 → 0.2.13

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.
@@ -309,6 +309,10 @@ const DefinitionRegionWrapperFinalization = (typeof FinalizationRegistry === 'un
309
309
  ? { register: () => {}, unregister: () => {} }
310
310
  : new FinalizationRegistry(ptr => wasm.__wbg_definitionregionwrapper_free(ptr >>> 0, 1));
311
311
 
312
+ const DiffWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
313
+ ? { register: () => {}, unregister: () => {} }
314
+ : new FinalizationRegistry(ptr => wasm.__wbg_diffwrapper_free(ptr >>> 0, 1));
315
+
312
316
  const ExecutionModeWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
313
317
  ? { register: () => {}, unregister: () => {} }
314
318
  : new FinalizationRegistry(ptr => wasm.__wbg_executionmodewrapper_free(ptr >>> 0, 1));
@@ -397,6 +401,10 @@ const StateModeConstantsFinalization = (typeof FinalizationRegistry === 'undefin
397
401
  ? { register: () => {}, unregister: () => {} }
398
402
  : new FinalizationRegistry(ptr => wasm.__wbg_statemodeconstants_free(ptr >>> 0, 1));
399
403
 
404
+ const StoreWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
405
+ ? { register: () => {}, unregister: () => {} }
406
+ : new FinalizationRegistry(ptr => wasm.__wbg_storewrapper_free(ptr >>> 0, 1));
407
+
400
408
  const TextureAtlasWrapperFinalization = (typeof FinalizationRegistry === 'undefined')
401
409
  ? { register: () => {}, unregister: () => {} }
402
410
  : new FinalizationRegistry(ptr => wasm.__wbg_textureatlaswrapper_free(ptr >>> 0, 1));
@@ -1734,6 +1742,164 @@ export class DefinitionRegionWrapper {
1734
1742
  }
1735
1743
  if (Symbol.dispose) DefinitionRegionWrapper.prototype[Symbol.dispose] = DefinitionRegionWrapper.prototype.free;
1736
1744
 
1745
+ /**
1746
+ * WASM wrapper for a [`Diff`] between two schematics.
1747
+ */
1748
+ export class DiffWrapper {
1749
+ static __wrap(ptr) {
1750
+ ptr = ptr >>> 0;
1751
+ const obj = Object.create(DiffWrapper.prototype);
1752
+ obj.__wbg_ptr = ptr;
1753
+ DiffWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
1754
+ return obj;
1755
+ }
1756
+ __destroy_into_raw() {
1757
+ const ptr = this.__wbg_ptr;
1758
+ this.__wbg_ptr = 0;
1759
+ DiffWrapperFinalization.unregister(this);
1760
+ return ptr;
1761
+ }
1762
+ free() {
1763
+ const ptr = this.__destroy_into_raw();
1764
+ wasm.__wbg_diffwrapper_free(ptr, 0);
1765
+ }
1766
+ /**
1767
+ * Connected change regions as a JSON array.
1768
+ *
1769
+ * Each region: `{min:[x,y,z], max:[x,y,z], kind:"added|removed|changed|mixed", count}`.
1770
+ * @returns {string}
1771
+ */
1772
+ regionsJson() {
1773
+ let deferred1_0;
1774
+ let deferred1_1;
1775
+ try {
1776
+ const ret = wasm.diffwrapper_regionsJson(this.__wbg_ptr);
1777
+ deferred1_0 = ret[0];
1778
+ deferred1_1 = ret[1];
1779
+ return getStringFromWasm0(ret[0], ret[1]);
1780
+ } finally {
1781
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1782
+ }
1783
+ }
1784
+ /**
1785
+ * Serialize a compact summary (counts + transform) to a JSON string.
1786
+ * @returns {string}
1787
+ */
1788
+ summaryJson() {
1789
+ let deferred1_0;
1790
+ let deferred1_1;
1791
+ try {
1792
+ const ret = wasm.diffwrapper_summaryJson(this.__wbg_ptr);
1793
+ deferred1_0 = ret[0];
1794
+ deferred1_1 = ret[1];
1795
+ return getStringFromWasm0(ret[0], ret[1]);
1796
+ } finally {
1797
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1798
+ }
1799
+ }
1800
+ /**
1801
+ * Generate a colored overlay GLB on top of an already-meshed "after" GLB.
1802
+ * @param {Uint8Array} after_glb
1803
+ * @returns {Uint8Array}
1804
+ */
1805
+ toOverlayGlb(after_glb) {
1806
+ const ptr0 = passArray8ToWasm0(after_glb, wasm.__wbindgen_malloc);
1807
+ const len0 = WASM_VECTOR_LEN;
1808
+ const ret = wasm.diffwrapper_toOverlayGlb(this.__wbg_ptr, ptr0, len0);
1809
+ if (ret[2]) {
1810
+ throw takeFromExternrefTable0(ret[1]);
1811
+ }
1812
+ return takeFromExternrefTable0(ret[0]);
1813
+ }
1814
+ /**
1815
+ * Schematic containing only the added blocks.
1816
+ * @returns {SchematicWrapper}
1817
+ */
1818
+ added() {
1819
+ const ret = wasm.diffwrapper_added(this.__wbg_ptr);
1820
+ return SchematicWrapper.__wrap(ret);
1821
+ }
1822
+ /**
1823
+ * Schematic containing only the changed blocks (post-change state).
1824
+ * @returns {SchematicWrapper}
1825
+ */
1826
+ changed() {
1827
+ const ret = wasm.diffwrapper_changed(this.__wbg_ptr);
1828
+ return SchematicWrapper.__wrap(ret);
1829
+ }
1830
+ /**
1831
+ * Schematic of visualization markers for all change classes.
1832
+ * @returns {SchematicWrapper}
1833
+ */
1834
+ markers() {
1835
+ const ret = wasm.diffwrapper_markers(this.__wbg_ptr);
1836
+ return SchematicWrapper.__wrap(ret);
1837
+ }
1838
+ /**
1839
+ * Schematic containing only the removed blocks.
1840
+ * @returns {SchematicWrapper}
1841
+ */
1842
+ removed() {
1843
+ const ret = wasm.diffwrapper_removed(this.__wbg_ptr);
1844
+ return SchematicWrapper.__wrap(ret);
1845
+ }
1846
+ /**
1847
+ * Match support score (fraction of cells explained by the alignment).
1848
+ * @returns {number}
1849
+ */
1850
+ get support() {
1851
+ const ret = wasm.diffwrapper_support(this.__wbg_ptr);
1852
+ return ret;
1853
+ }
1854
+ /**
1855
+ * Schematic containing only the palette-swapped blocks.
1856
+ * @returns {SchematicWrapper}
1857
+ */
1858
+ swapped() {
1859
+ const ret = wasm.diffwrapper_swapped(this.__wbg_ptr);
1860
+ return SchematicWrapper.__wrap(ret);
1861
+ }
1862
+ /**
1863
+ * Serialize the full diff to a JSON string.
1864
+ * @returns {string}
1865
+ */
1866
+ toJson() {
1867
+ let deferred1_0;
1868
+ let deferred1_1;
1869
+ try {
1870
+ const ret = wasm.diffwrapper_toJson(this.__wbg_ptr);
1871
+ deferred1_0 = ret[0];
1872
+ deferred1_1 = ret[1];
1873
+ return getStringFromWasm0(ret[0], ret[1]);
1874
+ } finally {
1875
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1876
+ }
1877
+ }
1878
+ /**
1879
+ * Total edit distance (sum of weighted add/delete/change/swap costs).
1880
+ * @returns {number}
1881
+ */
1882
+ get distance() {
1883
+ const ret = wasm.diffwrapper_distance(this.__wbg_ptr);
1884
+ return ret >>> 0;
1885
+ }
1886
+ /**
1887
+ * Reconstruct a diff from a JSON string produced by `toJson()`.
1888
+ * @param {string} s
1889
+ * @returns {DiffWrapper}
1890
+ */
1891
+ static fromJson(s) {
1892
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1893
+ const len0 = WASM_VECTOR_LEN;
1894
+ const ret = wasm.diffwrapper_fromJson(ptr0, len0);
1895
+ if (ret[2]) {
1896
+ throw takeFromExternrefTable0(ret[1]);
1897
+ }
1898
+ return DiffWrapper.__wrap(ret[0]);
1899
+ }
1900
+ }
1901
+ if (Symbol.dispose) DiffWrapper.prototype[Symbol.dispose] = DiffWrapper.prototype.free;
1902
+
1737
1903
  /**
1738
1904
  * ExecutionMode for circuit execution
1739
1905
  */
@@ -4027,32 +4193,113 @@ export class SchematicWrapper {
4027
4193
  wasm.__wbg_schematicwrapper_free(ptr, 0);
4028
4194
  }
4029
4195
  /**
4030
- * Creates a simulation world for this schematic with default options
4196
+ * Compute the content fingerprint as a hex string.
4031
4197
  *
4032
- * This allows you to simulate redstone circuits and interact with them.
4033
- * @returns {MchprsWorldWrapper}
4198
+ * `preset` defaults to `"exact"`. Unknown preset → Err.
4199
+ * @param {string | null} [preset]
4200
+ * @returns {string}
4034
4201
  */
4035
- create_simulation_world() {
4036
- const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
4202
+ fingerprint(preset) {
4203
+ let deferred3_0;
4204
+ let deferred3_1;
4205
+ try {
4206
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4207
+ var len0 = WASM_VECTOR_LEN;
4208
+ const ret = wasm.schematicwrapper_fingerprint(this.__wbg_ptr, ptr0, len0);
4209
+ var ptr2 = ret[0];
4210
+ var len2 = ret[1];
4211
+ if (ret[3]) {
4212
+ ptr2 = 0; len2 = 0;
4213
+ throw takeFromExternrefTable0(ret[2]);
4214
+ }
4215
+ deferred3_0 = ptr2;
4216
+ deferred3_1 = len2;
4217
+ return getStringFromWasm0(ptr2, len2);
4218
+ } finally {
4219
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4220
+ }
4221
+ }
4222
+ /**
4223
+ * Whether this schematic is a duplicate of `other` under `preset`.
4224
+ *
4225
+ * `preset` defaults to `"exact"`. Unknown preset → Err.
4226
+ * @param {SchematicWrapper} other
4227
+ * @param {string | null} [preset]
4228
+ * @returns {boolean}
4229
+ */
4230
+ isDuplicateOf(other, preset) {
4231
+ _assertClass(other, SchematicWrapper);
4232
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4233
+ var len0 = WASM_VECTOR_LEN;
4234
+ const ret = wasm.schematicwrapper_isDuplicateOf(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0);
4037
4235
  if (ret[2]) {
4038
4236
  throw takeFromExternrefTable0(ret[1]);
4039
4237
  }
4040
- return MchprsWorldWrapper.__wrap(ret[0]);
4238
+ return ret[0] !== 0;
4041
4239
  }
4042
4240
  /**
4043
- * Creates a simulation world for this schematic with custom options
4241
+ * Footprint distance between this schematic and `other` (0.0 = identical).
4044
4242
  *
4045
- * This allows you to configure simulation behavior like wire state tracking.
4046
- * @param {SimulationOptionsWrapper} options
4047
- * @returns {MchprsWorldWrapper}
4243
+ * `preset` defaults to `"exact"`. Unknown preset → Err.
4244
+ * @param {SchematicWrapper} other
4245
+ * @param {string | null} [preset]
4246
+ * @returns {number}
4048
4247
  */
4049
- create_simulation_world_with_options(options) {
4050
- _assertClass(options, SimulationOptionsWrapper);
4051
- const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
4248
+ footprintDistance(other, preset) {
4249
+ _assertClass(other, SchematicWrapper);
4250
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4251
+ var len0 = WASM_VECTOR_LEN;
4252
+ const ret = wasm.schematicwrapper_footprintDistance(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0);
4052
4253
  if (ret[2]) {
4053
4254
  throw takeFromExternrefTable0(ret[1]);
4054
4255
  }
4055
- return MchprsWorldWrapper.__wrap(ret[0]);
4256
+ return ret[0];
4257
+ }
4258
+ /**
4259
+ * The translation/scale-invariant FFT shape footprint as a fixed-length
4260
+ * vector (the raw feature for clustering / nearest-neighbour search).
4261
+ *
4262
+ * `preset` defaults to `"exact"`. Unknown preset → Err.
4263
+ * @param {string | null} [preset]
4264
+ * @returns {Float32Array}
4265
+ */
4266
+ footprint(preset) {
4267
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4268
+ var len0 = WASM_VECTOR_LEN;
4269
+ const ret = wasm.schematicwrapper_footprint(this.__wbg_ptr, ptr0, len0);
4270
+ if (ret[3]) {
4271
+ throw takeFromExternrefTable0(ret[2]);
4272
+ }
4273
+ var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
4274
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
4275
+ return v2;
4276
+ }
4277
+ /**
4278
+ * Compute the structural signature as a JSON string.
4279
+ *
4280
+ * `preset` defaults to `"exact"`. Unknown preset → Err.
4281
+ * @param {string | null} [preset]
4282
+ * @returns {string}
4283
+ */
4284
+ signature(preset) {
4285
+ let deferred3_0;
4286
+ let deferred3_1;
4287
+ try {
4288
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4289
+ var len0 = WASM_VECTOR_LEN;
4290
+ const ret = wasm.schematicwrapper_signature(this.__wbg_ptr, ptr0, len0);
4291
+ var ptr2 = ret[0];
4292
+ var len2 = ret[1];
4293
+ if (ret[3]) {
4294
+ ptr2 = 0; len2 = 0;
4295
+ throw takeFromExternrefTable0(ret[2]);
4296
+ }
4297
+ deferred3_0 = ptr2;
4298
+ deferred3_1 = len2;
4299
+ return getStringFromWasm0(ptr2, len2);
4300
+ } finally {
4301
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4302
+ }
4056
4303
  }
4057
4304
  /**
4058
4305
  * Add a mobile entity to the schematic.
@@ -4384,6 +4631,22 @@ export class SchematicWrapper {
4384
4631
  const ret = wasm.schematicwrapper_remove_entity(this.__wbg_ptr, index);
4385
4632
  return ret !== 0;
4386
4633
  }
4634
+ /**
4635
+ * Save this schematic into a [`StoreWrapper`] at `key`. The export format is
4636
+ * inferred from the `key`'s extension (e.g. `.litematic`, `.schem`). Works
4637
+ * with `mem://` stores and the `Store.fromCallbacks(...)` JS-callback store.
4638
+ * @param {StoreWrapper} store
4639
+ * @param {string} key
4640
+ */
4641
+ saveToStore(store, key) {
4642
+ _assertClass(store, StoreWrapper);
4643
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4644
+ const len0 = WASM_VECTOR_LEN;
4645
+ const ret = wasm.schematicwrapper_saveToStore(this.__wbg_ptr, store.__wbg_ptr, ptr0, len0);
4646
+ if (ret[1]) {
4647
+ throw takeFromExternrefTable0(ret[0]);
4648
+ }
4649
+ }
4387
4650
  /**
4388
4651
  * @param {string} name
4389
4652
  * @param {DefinitionRegionWrapper} region
@@ -4578,6 +4841,25 @@ export class SchematicWrapper {
4578
4841
  }
4579
4842
  return v1;
4580
4843
  }
4844
+ /**
4845
+ * Open a schematic directly from a [`StoreWrapper`] at `key`. The format is
4846
+ * inferred from the stored bytes. This is the meaningful way to load from
4847
+ * host/remote storage on the web: it works with `mem://` stores and with
4848
+ * the JS-callback store created via `Store.fromCallbacks(...)`.
4849
+ * @param {StoreWrapper} store
4850
+ * @param {string} key
4851
+ * @returns {SchematicWrapper}
4852
+ */
4853
+ static openFromStore(store, key) {
4854
+ _assertClass(store, StoreWrapper);
4855
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4856
+ const len0 = WASM_VECTOR_LEN;
4857
+ const ret = wasm.schematicwrapper_openFromStore(store.__wbg_ptr, ptr0, len0);
4858
+ if (ret[2]) {
4859
+ throw takeFromExternrefTable0(ret[1]);
4860
+ }
4861
+ return SchematicWrapper.__wrap(ret[0]);
4862
+ }
4581
4863
  /**
4582
4864
  * @returns {string}
4583
4865
  */
@@ -5388,6 +5670,55 @@ export class SchematicWrapper {
5388
5670
  const len0 = WASM_VECTOR_LEN;
5389
5671
  wasm.schematicwrapper_set_block(this.__wbg_ptr, x, y, z, ptr0, len0);
5390
5672
  }
5673
+ /**
5674
+ * Structurally diff this schematic against `other`.
5675
+ *
5676
+ * `preset` defaults to `"exact"`. `options` is an optional object
5677
+ * `{cost_add?, cost_delete?, cost_change?, cost_swap?, symmetry?}`.
5678
+ * Returns a [`DiffWrapper`]. Unknown preset/symmetry → Err.
5679
+ * @param {SchematicWrapper} other
5680
+ * @param {string | null | undefined} preset
5681
+ * @param {any} options
5682
+ * @returns {DiffWrapper}
5683
+ */
5684
+ diff(other, preset, options) {
5685
+ _assertClass(other, SchematicWrapper);
5686
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5687
+ var len0 = WASM_VECTOR_LEN;
5688
+ const ret = wasm.schematicwrapper_diff(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0, options);
5689
+ if (ret[2]) {
5690
+ throw takeFromExternrefTable0(ret[1]);
5691
+ }
5692
+ return DiffWrapper.__wrap(ret[0]);
5693
+ }
5694
+ /**
5695
+ * Creates a simulation world for this schematic with default options
5696
+ *
5697
+ * This allows you to simulate redstone circuits and interact with them.
5698
+ * @returns {MchprsWorldWrapper}
5699
+ */
5700
+ create_simulation_world() {
5701
+ const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
5702
+ if (ret[2]) {
5703
+ throw takeFromExternrefTable0(ret[1]);
5704
+ }
5705
+ return MchprsWorldWrapper.__wrap(ret[0]);
5706
+ }
5707
+ /**
5708
+ * Creates a simulation world for this schematic with custom options
5709
+ *
5710
+ * This allows you to configure simulation behavior like wire state tracking.
5711
+ * @param {SimulationOptionsWrapper} options
5712
+ * @returns {MchprsWorldWrapper}
5713
+ */
5714
+ create_simulation_world_with_options(options) {
5715
+ _assertClass(options, SimulationOptionsWrapper);
5716
+ const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
5717
+ if (ret[2]) {
5718
+ throw takeFromExternrefTable0(ret[1]);
5719
+ }
5720
+ return MchprsWorldWrapper.__wrap(ret[0]);
5721
+ }
5391
5722
  /**
5392
5723
  * Generate raw mesh data for custom rendering pipelines.
5393
5724
  * @param {ResourcePackWrapper} pack
@@ -6123,6 +6454,201 @@ export class StateModeConstants {
6123
6454
  }
6124
6455
  if (Symbol.dispose) StateModeConstants.prototype[Symbol.dispose] = StateModeConstants.prototype.free;
6125
6456
 
6457
+ /**
6458
+ * A byte store keyed by `/`-delimited paths. Construct with `new Store(url)`.
6459
+ */
6460
+ export class StoreWrapper {
6461
+ static __wrap(ptr) {
6462
+ ptr = ptr >>> 0;
6463
+ const obj = Object.create(StoreWrapper.prototype);
6464
+ obj.__wbg_ptr = ptr;
6465
+ StoreWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
6466
+ return obj;
6467
+ }
6468
+ __destroy_into_raw() {
6469
+ const ptr = this.__wbg_ptr;
6470
+ this.__wbg_ptr = 0;
6471
+ StoreWrapperFinalization.unregister(this);
6472
+ return ptr;
6473
+ }
6474
+ free() {
6475
+ const ptr = this.__destroy_into_raw();
6476
+ wasm.__wbg_storewrapper_free(ptr, 0);
6477
+ }
6478
+ /**
6479
+ * Atomically write `data` at `key` only if it does not already exist.
6480
+ * Returns `true` if written, `false` if the key already existed.
6481
+ * @param {string} key
6482
+ * @param {Uint8Array} data
6483
+ * @returns {boolean}
6484
+ */
6485
+ putIfAbsent(key, data) {
6486
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6487
+ const len0 = WASM_VECTOR_LEN;
6488
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6489
+ const len1 = WASM_VECTOR_LEN;
6490
+ const ret = wasm.storewrapper_putIfAbsent(this.__wbg_ptr, ptr0, len0, ptr1, len1);
6491
+ if (ret[2]) {
6492
+ throw takeFromExternrefTable0(ret[1]);
6493
+ }
6494
+ return ret[0] !== 0;
6495
+ }
6496
+ /**
6497
+ * Build a store backed by host-supplied JS functions ("host owns IO").
6498
+ *
6499
+ * `handlers` is a JS object with **synchronous** methods:
6500
+ * `get(key) -> Uint8Array | null`, `put(key, Uint8Array)`,
6501
+ * `has(key) -> bool`, `delete(key)`, `list(prefix) -> string[]`,
6502
+ * `health()`. Any thrown JS error surfaces as a store error.
6503
+ * @param {any} handlers
6504
+ * @returns {StoreWrapper}
6505
+ */
6506
+ static fromCallbacks(handlers) {
6507
+ const ret = wasm.storewrapper_fromCallbacks(handlers);
6508
+ if (ret[2]) {
6509
+ throw takeFromExternrefTable0(ret[1]);
6510
+ }
6511
+ return StoreWrapper.__wrap(ret[0]);
6512
+ }
6513
+ /**
6514
+ * A keyset page of keys under `prefix`, sorted, starting strictly after
6515
+ * `after` (pass `null`/`undefined` for the first page), at most `limit`.
6516
+ * Returns `{ keys: string[], next: string | null }`; pass `next` back as
6517
+ * `after` to continue, or stop when it is `null`.
6518
+ * @param {string} prefix
6519
+ * @param {string | null | undefined} after
6520
+ * @param {number} limit
6521
+ * @returns {any}
6522
+ */
6523
+ listPaginated(prefix, after, limit) {
6524
+ const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6525
+ const len0 = WASM_VECTOR_LEN;
6526
+ var ptr1 = isLikeNone(after) ? 0 : passStringToWasm0(after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6527
+ var len1 = WASM_VECTOR_LEN;
6528
+ const ret = wasm.storewrapper_listPaginated(this.__wbg_ptr, ptr0, len0, ptr1, len1, limit);
6529
+ if (ret[2]) {
6530
+ throw takeFromExternrefTable0(ret[1]);
6531
+ }
6532
+ return takeFromExternrefTable0(ret[0]);
6533
+ }
6534
+ /**
6535
+ * Fetch `key`, or `undefined` if absent.
6536
+ * @param {string} key
6537
+ * @returns {Uint8Array | undefined}
6538
+ */
6539
+ get(key) {
6540
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6541
+ const len0 = WASM_VECTOR_LEN;
6542
+ const ret = wasm.storewrapper_get(this.__wbg_ptr, ptr0, len0);
6543
+ if (ret[3]) {
6544
+ throw takeFromExternrefTable0(ret[2]);
6545
+ }
6546
+ let v2;
6547
+ if (ret[0] !== 0) {
6548
+ v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
6549
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
6550
+ }
6551
+ return v2;
6552
+ }
6553
+ /**
6554
+ * Open a store from a URL. On the web, use `mem://`.
6555
+ * @param {string} url
6556
+ */
6557
+ constructor(url) {
6558
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6559
+ const len0 = WASM_VECTOR_LEN;
6560
+ const ret = wasm.storewrapper_new(ptr0, len0);
6561
+ if (ret[2]) {
6562
+ throw takeFromExternrefTable0(ret[1]);
6563
+ }
6564
+ this.__wbg_ptr = ret[0] >>> 0;
6565
+ StoreWrapperFinalization.register(this, this.__wbg_ptr, this);
6566
+ return this;
6567
+ }
6568
+ /**
6569
+ * Store `data` at `key`, overwriting.
6570
+ * @param {string} key
6571
+ * @param {Uint8Array} data
6572
+ */
6573
+ put(key, data) {
6574
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6575
+ const len0 = WASM_VECTOR_LEN;
6576
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6577
+ const len1 = WASM_VECTOR_LEN;
6578
+ const ret = wasm.storewrapper_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
6579
+ if (ret[1]) {
6580
+ throw takeFromExternrefTable0(ret[0]);
6581
+ }
6582
+ }
6583
+ /**
6584
+ * Keys under `prefix`.
6585
+ * @param {string} prefix
6586
+ * @returns {string[]}
6587
+ */
6588
+ list(prefix) {
6589
+ const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6590
+ const len0 = WASM_VECTOR_LEN;
6591
+ const ret = wasm.storewrapper_list(this.__wbg_ptr, ptr0, len0);
6592
+ if (ret[3]) {
6593
+ throw takeFromExternrefTable0(ret[2]);
6594
+ }
6595
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6596
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6597
+ return v2;
6598
+ }
6599
+ /**
6600
+ * Open a store from a URL (canonical name, matching Python/FFI `open`).
6601
+ * Equivalent to `new Store(url)`.
6602
+ * @param {string} url
6603
+ * @returns {StoreWrapper}
6604
+ */
6605
+ static open(url) {
6606
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6607
+ const len0 = WASM_VECTOR_LEN;
6608
+ const ret = wasm.storewrapper_open(ptr0, len0);
6609
+ if (ret[2]) {
6610
+ throw takeFromExternrefTable0(ret[1]);
6611
+ }
6612
+ return StoreWrapper.__wrap(ret[0]);
6613
+ }
6614
+ /**
6615
+ * Remove `key` (idempotent).
6616
+ * @param {string} key
6617
+ */
6618
+ delete(key) {
6619
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6620
+ const len0 = WASM_VECTOR_LEN;
6621
+ const ret = wasm.storewrapper_delete(this.__wbg_ptr, ptr0, len0);
6622
+ if (ret[1]) {
6623
+ throw takeFromExternrefTable0(ret[0]);
6624
+ }
6625
+ }
6626
+ /**
6627
+ * Whether `key` exists.
6628
+ * @param {string} key
6629
+ * @returns {boolean}
6630
+ */
6631
+ has(key) {
6632
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6633
+ const len0 = WASM_VECTOR_LEN;
6634
+ const ret = wasm.storewrapper_has(this.__wbg_ptr, ptr0, len0);
6635
+ if (ret[2]) {
6636
+ throw takeFromExternrefTable0(ret[1]);
6637
+ }
6638
+ return ret[0] !== 0;
6639
+ }
6640
+ /**
6641
+ * Reject if the store is not usable.
6642
+ */
6643
+ health() {
6644
+ const ret = wasm.storewrapper_health(this.__wbg_ptr);
6645
+ if (ret[1]) {
6646
+ throw takeFromExternrefTable0(ret[0]);
6647
+ }
6648
+ }
6649
+ }
6650
+ if (Symbol.dispose) StoreWrapper.prototype[Symbol.dispose] = StoreWrapper.prototype.free;
6651
+
6126
6652
  /**
6127
6653
  * Wrapper for a pre-built global texture atlas.
6128
6654
  *
@@ -6753,6 +7279,14 @@ function __wbg_get_imports() {
6753
7279
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
6754
7280
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
6755
7281
  };
7282
+ imports.wbg.__wbg___wbindgen_is_falsy_7b9692021c137978 = function(arg0) {
7283
+ const ret = !arg0;
7284
+ return ret;
7285
+ };
7286
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
7287
+ const ret = typeof(arg0) === 'function';
7288
+ return ret;
7289
+ };
6756
7290
  imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
6757
7291
  const ret = arg0 === null;
6758
7292
  return ret;
@@ -6791,6 +7325,14 @@ function __wbg_get_imports() {
6791
7325
  const ret = arg0.call(arg1, arg2);
6792
7326
  return ret;
6793
7327
  }, arguments) };
7328
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
7329
+ const ret = arg0.call(arg1);
7330
+ return ret;
7331
+ }, arguments) };
7332
+ imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
7333
+ const ret = arg0.call(arg1, arg2, arg3);
7334
+ return ret;
7335
+ }, arguments) };
6794
7336
  imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
6795
7337
  const ret = Object.entries(arg0);
6796
7338
  return ret;
@@ -6831,6 +7373,16 @@ function __wbg_get_imports() {
6831
7373
  const ret = result;
6832
7374
  return ret;
6833
7375
  };
7376
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
7377
+ let result;
7378
+ try {
7379
+ result = arg0 instanceof Uint8Array;
7380
+ } catch (_) {
7381
+ result = false;
7382
+ }
7383
+ const ret = result;
7384
+ return ret;
7385
+ };
6834
7386
  imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
6835
7387
  const ret = Array.isArray(arg0);
6836
7388
  return ret;