nucleation 0.2.10 → 0.2.12

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,94 @@ 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
+ * Compute the structural signature as a JSON string.
4260
+ *
4261
+ * `preset` defaults to `"exact"`. Unknown preset → Err.
4262
+ * @param {string | null} [preset]
4263
+ * @returns {string}
4264
+ */
4265
+ signature(preset) {
4266
+ let deferred3_0;
4267
+ let deferred3_1;
4268
+ try {
4269
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4270
+ var len0 = WASM_VECTOR_LEN;
4271
+ const ret = wasm.schematicwrapper_signature(this.__wbg_ptr, ptr0, len0);
4272
+ var ptr2 = ret[0];
4273
+ var len2 = ret[1];
4274
+ if (ret[3]) {
4275
+ ptr2 = 0; len2 = 0;
4276
+ throw takeFromExternrefTable0(ret[2]);
4277
+ }
4278
+ deferred3_0 = ptr2;
4279
+ deferred3_1 = len2;
4280
+ return getStringFromWasm0(ptr2, len2);
4281
+ } finally {
4282
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4283
+ }
4056
4284
  }
4057
4285
  /**
4058
4286
  * Add a mobile entity to the schematic.
@@ -4384,6 +4612,22 @@ export class SchematicWrapper {
4384
4612
  const ret = wasm.schematicwrapper_remove_entity(this.__wbg_ptr, index);
4385
4613
  return ret !== 0;
4386
4614
  }
4615
+ /**
4616
+ * Save this schematic into a [`StoreWrapper`] at `key`. The export format is
4617
+ * inferred from the `key`'s extension (e.g. `.litematic`, `.schem`). Works
4618
+ * with `mem://` stores and the `Store.fromCallbacks(...)` JS-callback store.
4619
+ * @param {StoreWrapper} store
4620
+ * @param {string} key
4621
+ */
4622
+ saveToStore(store, key) {
4623
+ _assertClass(store, StoreWrapper);
4624
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4625
+ const len0 = WASM_VECTOR_LEN;
4626
+ const ret = wasm.schematicwrapper_saveToStore(this.__wbg_ptr, store.__wbg_ptr, ptr0, len0);
4627
+ if (ret[1]) {
4628
+ throw takeFromExternrefTable0(ret[0]);
4629
+ }
4630
+ }
4387
4631
  /**
4388
4632
  * @param {string} name
4389
4633
  * @param {DefinitionRegionWrapper} region
@@ -4578,6 +4822,25 @@ export class SchematicWrapper {
4578
4822
  }
4579
4823
  return v1;
4580
4824
  }
4825
+ /**
4826
+ * Open a schematic directly from a [`StoreWrapper`] at `key`. The format is
4827
+ * inferred from the stored bytes. This is the meaningful way to load from
4828
+ * host/remote storage on the web: it works with `mem://` stores and with
4829
+ * the JS-callback store created via `Store.fromCallbacks(...)`.
4830
+ * @param {StoreWrapper} store
4831
+ * @param {string} key
4832
+ * @returns {SchematicWrapper}
4833
+ */
4834
+ static openFromStore(store, key) {
4835
+ _assertClass(store, StoreWrapper);
4836
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4837
+ const len0 = WASM_VECTOR_LEN;
4838
+ const ret = wasm.schematicwrapper_openFromStore(store.__wbg_ptr, ptr0, len0);
4839
+ if (ret[2]) {
4840
+ throw takeFromExternrefTable0(ret[1]);
4841
+ }
4842
+ return SchematicWrapper.__wrap(ret[0]);
4843
+ }
4581
4844
  /**
4582
4845
  * @returns {string}
4583
4846
  */
@@ -4892,7 +5155,7 @@ export class SchematicWrapper {
4892
5155
  * @returns {CircuitBuilderWrapper}
4893
5156
  */
4894
5157
  createCircuitBuilder() {
4895
- const ret = wasm.circuitbuilderwrapper_new(this.__wbg_ptr);
5158
+ const ret = wasm.schematicwrapper_createCircuitBuilder(this.__wbg_ptr);
4896
5159
  return CircuitBuilderWrapper.__wrap(ret);
4897
5160
  }
4898
5161
  /**
@@ -5388,6 +5651,55 @@ export class SchematicWrapper {
5388
5651
  const len0 = WASM_VECTOR_LEN;
5389
5652
  wasm.schematicwrapper_set_block(this.__wbg_ptr, x, y, z, ptr0, len0);
5390
5653
  }
5654
+ /**
5655
+ * Creates a simulation world for this schematic with default options
5656
+ *
5657
+ * This allows you to simulate redstone circuits and interact with them.
5658
+ * @returns {MchprsWorldWrapper}
5659
+ */
5660
+ create_simulation_world() {
5661
+ const ret = wasm.schematicwrapper_create_simulation_world(this.__wbg_ptr);
5662
+ if (ret[2]) {
5663
+ throw takeFromExternrefTable0(ret[1]);
5664
+ }
5665
+ return MchprsWorldWrapper.__wrap(ret[0]);
5666
+ }
5667
+ /**
5668
+ * Creates a simulation world for this schematic with custom options
5669
+ *
5670
+ * This allows you to configure simulation behavior like wire state tracking.
5671
+ * @param {SimulationOptionsWrapper} options
5672
+ * @returns {MchprsWorldWrapper}
5673
+ */
5674
+ create_simulation_world_with_options(options) {
5675
+ _assertClass(options, SimulationOptionsWrapper);
5676
+ const ret = wasm.schematicwrapper_create_simulation_world_with_options(this.__wbg_ptr, options.__wbg_ptr);
5677
+ if (ret[2]) {
5678
+ throw takeFromExternrefTable0(ret[1]);
5679
+ }
5680
+ return MchprsWorldWrapper.__wrap(ret[0]);
5681
+ }
5682
+ /**
5683
+ * Structurally diff this schematic against `other`.
5684
+ *
5685
+ * `preset` defaults to `"exact"`. `options` is an optional object
5686
+ * `{cost_add?, cost_delete?, cost_change?, cost_swap?, symmetry?}`.
5687
+ * Returns a [`DiffWrapper`]. Unknown preset/symmetry → Err.
5688
+ * @param {SchematicWrapper} other
5689
+ * @param {string | null | undefined} preset
5690
+ * @param {any} options
5691
+ * @returns {DiffWrapper}
5692
+ */
5693
+ diff(other, preset, options) {
5694
+ _assertClass(other, SchematicWrapper);
5695
+ var ptr0 = isLikeNone(preset) ? 0 : passStringToWasm0(preset, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5696
+ var len0 = WASM_VECTOR_LEN;
5697
+ const ret = wasm.schematicwrapper_diff(this.__wbg_ptr, other.__wbg_ptr, ptr0, len0, options);
5698
+ if (ret[2]) {
5699
+ throw takeFromExternrefTable0(ret[1]);
5700
+ }
5701
+ return DiffWrapper.__wrap(ret[0]);
5702
+ }
5391
5703
  /**
5392
5704
  * Generate raw mesh data for custom rendering pipelines.
5393
5705
  * @param {ResourcePackWrapper} pack
@@ -6123,6 +6435,201 @@ export class StateModeConstants {
6123
6435
  }
6124
6436
  if (Symbol.dispose) StateModeConstants.prototype[Symbol.dispose] = StateModeConstants.prototype.free;
6125
6437
 
6438
+ /**
6439
+ * A byte store keyed by `/`-delimited paths. Construct with `new Store(url)`.
6440
+ */
6441
+ export class StoreWrapper {
6442
+ static __wrap(ptr) {
6443
+ ptr = ptr >>> 0;
6444
+ const obj = Object.create(StoreWrapper.prototype);
6445
+ obj.__wbg_ptr = ptr;
6446
+ StoreWrapperFinalization.register(obj, obj.__wbg_ptr, obj);
6447
+ return obj;
6448
+ }
6449
+ __destroy_into_raw() {
6450
+ const ptr = this.__wbg_ptr;
6451
+ this.__wbg_ptr = 0;
6452
+ StoreWrapperFinalization.unregister(this);
6453
+ return ptr;
6454
+ }
6455
+ free() {
6456
+ const ptr = this.__destroy_into_raw();
6457
+ wasm.__wbg_storewrapper_free(ptr, 0);
6458
+ }
6459
+ /**
6460
+ * Atomically write `data` at `key` only if it does not already exist.
6461
+ * Returns `true` if written, `false` if the key already existed.
6462
+ * @param {string} key
6463
+ * @param {Uint8Array} data
6464
+ * @returns {boolean}
6465
+ */
6466
+ putIfAbsent(key, data) {
6467
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6468
+ const len0 = WASM_VECTOR_LEN;
6469
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6470
+ const len1 = WASM_VECTOR_LEN;
6471
+ const ret = wasm.storewrapper_putIfAbsent(this.__wbg_ptr, ptr0, len0, ptr1, len1);
6472
+ if (ret[2]) {
6473
+ throw takeFromExternrefTable0(ret[1]);
6474
+ }
6475
+ return ret[0] !== 0;
6476
+ }
6477
+ /**
6478
+ * Build a store backed by host-supplied JS functions ("host owns IO").
6479
+ *
6480
+ * `handlers` is a JS object with **synchronous** methods:
6481
+ * `get(key) -> Uint8Array | null`, `put(key, Uint8Array)`,
6482
+ * `has(key) -> bool`, `delete(key)`, `list(prefix) -> string[]`,
6483
+ * `health()`. Any thrown JS error surfaces as a store error.
6484
+ * @param {any} handlers
6485
+ * @returns {StoreWrapper}
6486
+ */
6487
+ static fromCallbacks(handlers) {
6488
+ const ret = wasm.storewrapper_fromCallbacks(handlers);
6489
+ if (ret[2]) {
6490
+ throw takeFromExternrefTable0(ret[1]);
6491
+ }
6492
+ return StoreWrapper.__wrap(ret[0]);
6493
+ }
6494
+ /**
6495
+ * A keyset page of keys under `prefix`, sorted, starting strictly after
6496
+ * `after` (pass `null`/`undefined` for the first page), at most `limit`.
6497
+ * Returns `{ keys: string[], next: string | null }`; pass `next` back as
6498
+ * `after` to continue, or stop when it is `null`.
6499
+ * @param {string} prefix
6500
+ * @param {string | null | undefined} after
6501
+ * @param {number} limit
6502
+ * @returns {any}
6503
+ */
6504
+ listPaginated(prefix, after, limit) {
6505
+ const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6506
+ const len0 = WASM_VECTOR_LEN;
6507
+ var ptr1 = isLikeNone(after) ? 0 : passStringToWasm0(after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6508
+ var len1 = WASM_VECTOR_LEN;
6509
+ const ret = wasm.storewrapper_listPaginated(this.__wbg_ptr, ptr0, len0, ptr1, len1, limit);
6510
+ if (ret[2]) {
6511
+ throw takeFromExternrefTable0(ret[1]);
6512
+ }
6513
+ return takeFromExternrefTable0(ret[0]);
6514
+ }
6515
+ /**
6516
+ * Fetch `key`, or `undefined` if absent.
6517
+ * @param {string} key
6518
+ * @returns {Uint8Array | undefined}
6519
+ */
6520
+ get(key) {
6521
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6522
+ const len0 = WASM_VECTOR_LEN;
6523
+ const ret = wasm.storewrapper_get(this.__wbg_ptr, ptr0, len0);
6524
+ if (ret[3]) {
6525
+ throw takeFromExternrefTable0(ret[2]);
6526
+ }
6527
+ let v2;
6528
+ if (ret[0] !== 0) {
6529
+ v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
6530
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
6531
+ }
6532
+ return v2;
6533
+ }
6534
+ /**
6535
+ * Open a store from a URL. On the web, use `mem://`.
6536
+ * @param {string} url
6537
+ */
6538
+ constructor(url) {
6539
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6540
+ const len0 = WASM_VECTOR_LEN;
6541
+ const ret = wasm.storewrapper_new(ptr0, len0);
6542
+ if (ret[2]) {
6543
+ throw takeFromExternrefTable0(ret[1]);
6544
+ }
6545
+ this.__wbg_ptr = ret[0] >>> 0;
6546
+ StoreWrapperFinalization.register(this, this.__wbg_ptr, this);
6547
+ return this;
6548
+ }
6549
+ /**
6550
+ * Store `data` at `key`, overwriting.
6551
+ * @param {string} key
6552
+ * @param {Uint8Array} data
6553
+ */
6554
+ put(key, data) {
6555
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6556
+ const len0 = WASM_VECTOR_LEN;
6557
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
6558
+ const len1 = WASM_VECTOR_LEN;
6559
+ const ret = wasm.storewrapper_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
6560
+ if (ret[1]) {
6561
+ throw takeFromExternrefTable0(ret[0]);
6562
+ }
6563
+ }
6564
+ /**
6565
+ * Keys under `prefix`.
6566
+ * @param {string} prefix
6567
+ * @returns {string[]}
6568
+ */
6569
+ list(prefix) {
6570
+ const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6571
+ const len0 = WASM_VECTOR_LEN;
6572
+ const ret = wasm.storewrapper_list(this.__wbg_ptr, ptr0, len0);
6573
+ if (ret[3]) {
6574
+ throw takeFromExternrefTable0(ret[2]);
6575
+ }
6576
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6577
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6578
+ return v2;
6579
+ }
6580
+ /**
6581
+ * Open a store from a URL (canonical name, matching Python/FFI `open`).
6582
+ * Equivalent to `new Store(url)`.
6583
+ * @param {string} url
6584
+ * @returns {StoreWrapper}
6585
+ */
6586
+ static open(url) {
6587
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6588
+ const len0 = WASM_VECTOR_LEN;
6589
+ const ret = wasm.storewrapper_open(ptr0, len0);
6590
+ if (ret[2]) {
6591
+ throw takeFromExternrefTable0(ret[1]);
6592
+ }
6593
+ return StoreWrapper.__wrap(ret[0]);
6594
+ }
6595
+ /**
6596
+ * Remove `key` (idempotent).
6597
+ * @param {string} key
6598
+ */
6599
+ delete(key) {
6600
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6601
+ const len0 = WASM_VECTOR_LEN;
6602
+ const ret = wasm.storewrapper_delete(this.__wbg_ptr, ptr0, len0);
6603
+ if (ret[1]) {
6604
+ throw takeFromExternrefTable0(ret[0]);
6605
+ }
6606
+ }
6607
+ /**
6608
+ * Whether `key` exists.
6609
+ * @param {string} key
6610
+ * @returns {boolean}
6611
+ */
6612
+ has(key) {
6613
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6614
+ const len0 = WASM_VECTOR_LEN;
6615
+ const ret = wasm.storewrapper_has(this.__wbg_ptr, ptr0, len0);
6616
+ if (ret[2]) {
6617
+ throw takeFromExternrefTable0(ret[1]);
6618
+ }
6619
+ return ret[0] !== 0;
6620
+ }
6621
+ /**
6622
+ * Reject if the store is not usable.
6623
+ */
6624
+ health() {
6625
+ const ret = wasm.storewrapper_health(this.__wbg_ptr);
6626
+ if (ret[1]) {
6627
+ throw takeFromExternrefTable0(ret[0]);
6628
+ }
6629
+ }
6630
+ }
6631
+ if (Symbol.dispose) StoreWrapper.prototype[Symbol.dispose] = StoreWrapper.prototype.free;
6632
+
6126
6633
  /**
6127
6634
  * Wrapper for a pre-built global texture atlas.
6128
6635
  *
@@ -6753,6 +7260,14 @@ function __wbg_get_imports() {
6753
7260
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
6754
7261
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
6755
7262
  };
7263
+ imports.wbg.__wbg___wbindgen_is_falsy_7b9692021c137978 = function(arg0) {
7264
+ const ret = !arg0;
7265
+ return ret;
7266
+ };
7267
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
7268
+ const ret = typeof(arg0) === 'function';
7269
+ return ret;
7270
+ };
6756
7271
  imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
6757
7272
  const ret = arg0 === null;
6758
7273
  return ret;
@@ -6791,6 +7306,14 @@ function __wbg_get_imports() {
6791
7306
  const ret = arg0.call(arg1, arg2);
6792
7307
  return ret;
6793
7308
  }, arguments) };
7309
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
7310
+ const ret = arg0.call(arg1);
7311
+ return ret;
7312
+ }, arguments) };
7313
+ imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
7314
+ const ret = arg0.call(arg1, arg2, arg3);
7315
+ return ret;
7316
+ }, arguments) };
6794
7317
  imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
6795
7318
  const ret = Object.entries(arg0);
6796
7319
  return ret;
@@ -6831,6 +7354,16 @@ function __wbg_get_imports() {
6831
7354
  const ret = result;
6832
7355
  return ret;
6833
7356
  };
7357
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
7358
+ let result;
7359
+ try {
7360
+ result = arg0 instanceof Uint8Array;
7361
+ } catch (_) {
7362
+ result = false;
7363
+ }
7364
+ const ret = result;
7365
+ return ret;
7366
+ };
6834
7367
  imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
6835
7368
  const ret = Array.isArray(arg0);
6836
7369
  return ret;