@automerge/sedimentree 0.8.3 → 0.10.0
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/package.json +30 -3
- package/dist/cjs/node.cjs +0 -5
- package/dist/cjs/slim.cjs +0 -1
- package/dist/cjs/wasm-base64.cjs +0 -1
- package/dist/cjs/web-bindings.cjs +0 -1636
- package/dist/cjs/web.cjs +0 -1589
- package/dist/esm/bundler.js +0 -7
- package/dist/esm/node.js +0 -7
- package/dist/esm/slim.js +0 -2
- package/dist/esm/wasm-base64.js +0 -1
- package/dist/esm/web.js +0 -5
- package/dist/esm/workerd.js +0 -5
- package/dist/iife/index.js +0 -1572
- package/dist/index.d.ts +0 -452
- package/dist/sedimentree.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm.d.ts +0 -452
- package/dist/wasm_bindgen/bundler/sedimentree_wasm.js +0 -9
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.js +0 -1583
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/bundler/sedimentree_wasm_bg.wasm.d.ts +0 -95
- package/dist/wasm_bindgen/bundler/snippets/sedimentree_wasm-c507f5285f2927a0/inline0.js +0 -2
- package/dist/wasm_bindgen/bundler/snippets/sedimentree_wasm-c507f5285f2927a0/inline1.js +0 -2
- package/dist/wasm_bindgen/bundler/snippets/sedimentree_wasm-c507f5285f2927a0/inline2.js +0 -2
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.cjs +0 -1602
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm.d.ts +0 -452
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/nodejs/sedimentree_wasm_bg.wasm.d.ts +0 -95
- package/dist/wasm_bindgen/nodejs/snippets/sedimentree_wasm-c507f5285f2927a0/inline0.js +0 -2
- package/dist/wasm_bindgen/nodejs/snippets/sedimentree_wasm-c507f5285f2927a0/inline1.js +0 -2
- package/dist/wasm_bindgen/nodejs/snippets/sedimentree_wasm-c507f5285f2927a0/inline2.js +0 -2
- package/dist/wasm_bindgen/web/sedimentree_wasm.d.ts +0 -572
- package/dist/wasm_bindgen/web/sedimentree_wasm.js +0 -1685
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm +0 -0
- package/dist/wasm_bindgen/web/sedimentree_wasm_bg.wasm.d.ts +0 -95
- package/dist/wasm_bindgen/web/snippets/sedimentree_wasm-c507f5285f2927a0/inline0.js +0 -2
- package/dist/wasm_bindgen/web/snippets/sedimentree_wasm-c507f5285f2927a0/inline1.js +0 -2
- package/dist/wasm_bindgen/web/snippets/sedimentree_wasm-c507f5285f2927a0/inline2.js +0 -2
|
@@ -1,1685 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./sedimentree_wasm.d.ts" */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A Wasm wrapper around the [`BlobMeta`] type.
|
|
5
|
-
*/
|
|
6
|
-
export class BlobMeta {
|
|
7
|
-
static __wrap(ptr) {
|
|
8
|
-
ptr = ptr >>> 0;
|
|
9
|
-
const obj = Object.create(BlobMeta.prototype);
|
|
10
|
-
obj.__wbg_ptr = ptr;
|
|
11
|
-
BlobMetaFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
__destroy_into_raw() {
|
|
15
|
-
const ptr = this.__wbg_ptr;
|
|
16
|
-
this.__wbg_ptr = 0;
|
|
17
|
-
BlobMetaFinalization.unregister(this);
|
|
18
|
-
return ptr;
|
|
19
|
-
}
|
|
20
|
-
free() {
|
|
21
|
-
const ptr = this.__destroy_into_raw();
|
|
22
|
-
wasm.__wbg_blobmeta_free(ptr, 0);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Get the digest of the blob.
|
|
26
|
-
* @returns {Digest}
|
|
27
|
-
*/
|
|
28
|
-
digest() {
|
|
29
|
-
const ret = wasm.blobmeta_digest(this.__wbg_ptr);
|
|
30
|
-
return Digest.__wrap(ret);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Create a `BlobMeta` from a digest and size.
|
|
34
|
-
*
|
|
35
|
-
* This is useful for deserialization when the original blob is not available.
|
|
36
|
-
* Since this is manual, the caller must ensure the digest and size are correct.
|
|
37
|
-
* @param {Digest} digest
|
|
38
|
-
* @param {bigint} size_bytes
|
|
39
|
-
* @returns {BlobMeta}
|
|
40
|
-
*/
|
|
41
|
-
static fromDigestSize(digest, size_bytes) {
|
|
42
|
-
_assertClass(digest, Digest);
|
|
43
|
-
const ret = wasm.blobmeta_fromDigestSize(digest.__wbg_ptr, size_bytes);
|
|
44
|
-
return BlobMeta.__wrap(ret);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Create a new `BlobMeta` from the given blob contents.
|
|
48
|
-
* @param {Uint8Array} blob
|
|
49
|
-
*/
|
|
50
|
-
constructor(blob) {
|
|
51
|
-
const ptr0 = passArray8ToWasm0(blob, wasm.__wbindgen_export);
|
|
52
|
-
const len0 = WASM_VECTOR_LEN;
|
|
53
|
-
const ret = wasm.blobmeta_new(ptr0, len0);
|
|
54
|
-
this.__wbg_ptr = ret >>> 0;
|
|
55
|
-
BlobMetaFinalization.register(this, this.__wbg_ptr, this);
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Get the size of the blob in bytes.
|
|
60
|
-
* @returns {bigint}
|
|
61
|
-
*/
|
|
62
|
-
get sizeBytes() {
|
|
63
|
-
const ret = wasm.blobmeta_sizeBytes(this.__wbg_ptr);
|
|
64
|
-
return BigInt.asUintN(64, ret);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (Symbol.dispose) BlobMeta.prototype[Symbol.dispose] = BlobMeta.prototype.free;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* A commit stored with its associated blob.
|
|
71
|
-
*/
|
|
72
|
-
export class CommitWithBlob {
|
|
73
|
-
static __wrap(ptr) {
|
|
74
|
-
ptr = ptr >>> 0;
|
|
75
|
-
const obj = Object.create(CommitWithBlob.prototype);
|
|
76
|
-
obj.__wbg_ptr = ptr;
|
|
77
|
-
CommitWithBlobFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
78
|
-
return obj;
|
|
79
|
-
}
|
|
80
|
-
__destroy_into_raw() {
|
|
81
|
-
const ptr = this.__wbg_ptr;
|
|
82
|
-
this.__wbg_ptr = 0;
|
|
83
|
-
CommitWithBlobFinalization.unregister(this);
|
|
84
|
-
return ptr;
|
|
85
|
-
}
|
|
86
|
-
free() {
|
|
87
|
-
const ptr = this.__destroy_into_raw();
|
|
88
|
-
wasm.__wbg_commitwithblob_free(ptr, 0);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Upcasts; to the JS-import type for [`WasmCommitWithBlob`].
|
|
92
|
-
* @returns {CommitWithBlob}
|
|
93
|
-
*/
|
|
94
|
-
__wasm_refgen_toWasmCommitWithBlob() {
|
|
95
|
-
const ret = wasm.commitwithblob___wasm_refgen_toWasmCommitWithBlob(this.__wbg_ptr);
|
|
96
|
-
return CommitWithBlob.__wrap(ret);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Get the blob.
|
|
100
|
-
* @returns {Uint8Array}
|
|
101
|
-
*/
|
|
102
|
-
get blob() {
|
|
103
|
-
const ret = wasm.commitwithblob_blob(this.__wbg_ptr);
|
|
104
|
-
return ret;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Create a new commit with blob.
|
|
108
|
-
* @param {SignedLooseCommit} signed
|
|
109
|
-
* @param {Uint8Array} blob
|
|
110
|
-
*/
|
|
111
|
-
constructor(signed, blob) {
|
|
112
|
-
_assertClass(signed, SignedLooseCommit);
|
|
113
|
-
var ptr0 = signed.__destroy_into_raw();
|
|
114
|
-
const ret = wasm.commitwithblob_new(ptr0, blob);
|
|
115
|
-
this.__wbg_ptr = ret >>> 0;
|
|
116
|
-
CommitWithBlobFinalization.register(this, this.__wbg_ptr, this);
|
|
117
|
-
return this;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Get the signed commit.
|
|
121
|
-
* @returns {SignedLooseCommit}
|
|
122
|
-
*/
|
|
123
|
-
get signed() {
|
|
124
|
-
const ret = wasm.commitwithblob_signed(this.__wbg_ptr);
|
|
125
|
-
return SignedLooseCommit.__wrap(ret);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (Symbol.dispose) CommitWithBlob.prototype[Symbol.dispose] = CommitWithBlob.prototype.free;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* A JavaScript wrapper around `Depth`.
|
|
132
|
-
*/
|
|
133
|
-
export class Depth {
|
|
134
|
-
static __wrap(ptr) {
|
|
135
|
-
ptr = ptr >>> 0;
|
|
136
|
-
const obj = Object.create(Depth.prototype);
|
|
137
|
-
obj.__wbg_ptr = ptr;
|
|
138
|
-
DepthFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
139
|
-
return obj;
|
|
140
|
-
}
|
|
141
|
-
__destroy_into_raw() {
|
|
142
|
-
const ptr = this.__wbg_ptr;
|
|
143
|
-
this.__wbg_ptr = 0;
|
|
144
|
-
DepthFinalization.unregister(this);
|
|
145
|
-
return ptr;
|
|
146
|
-
}
|
|
147
|
-
free() {
|
|
148
|
-
const ptr = this.__destroy_into_raw();
|
|
149
|
-
wasm.__wbg_depth_free(ptr, 0);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Internal method for a hack crossing the JS boundary.
|
|
153
|
-
* @returns {Depth}
|
|
154
|
-
*/
|
|
155
|
-
__subduction_castToDepth() {
|
|
156
|
-
const ret = wasm.depth___subduction_castToDepth(this.__wbg_ptr);
|
|
157
|
-
return Depth.__wrap(ret);
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Upcasts; to the JS-import type for [`WasmDepth`].
|
|
161
|
-
* @returns {Depth}
|
|
162
|
-
*/
|
|
163
|
-
__wasm_refgen_toWasmDepth() {
|
|
164
|
-
const ret = wasm.depth___wasm_refgen_toWasmDepth(this.__wbg_ptr);
|
|
165
|
-
return Depth.__wrap(ret);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Creates a new `WasmDepth` from a JavaScript value.
|
|
169
|
-
*
|
|
170
|
-
* # Errors
|
|
171
|
-
*
|
|
172
|
-
* Returns a `NotU32Error` if the JS value is not safely coercible to `u32`.
|
|
173
|
-
* @param {any} js_value
|
|
174
|
-
*/
|
|
175
|
-
constructor(js_value) {
|
|
176
|
-
const ret = wasm.depth_new(js_value);
|
|
177
|
-
if (ret[2]) {
|
|
178
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
179
|
-
}
|
|
180
|
-
this.__wbg_ptr = ret[0] >>> 0;
|
|
181
|
-
DepthFinalization.register(this, this.__wbg_ptr, this);
|
|
182
|
-
return this;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* The depth value as an integer.
|
|
186
|
-
* @returns {number}
|
|
187
|
-
*/
|
|
188
|
-
get value() {
|
|
189
|
-
const ret = wasm.depth_value(this.__wbg_ptr);
|
|
190
|
-
return ret >>> 0;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (Symbol.dispose) Depth.prototype[Symbol.dispose] = Depth.prototype.free;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* A wrapper around digest bytes for use in JavaScript via wasm-bindgen.
|
|
197
|
-
*
|
|
198
|
-
* Since JavaScript doesn't have Rust's type system, this stores raw bytes
|
|
199
|
-
* and converts to/from typed `Digest<T>` at the Rust boundary.
|
|
200
|
-
*/
|
|
201
|
-
export class Digest {
|
|
202
|
-
static __wrap(ptr) {
|
|
203
|
-
ptr = ptr >>> 0;
|
|
204
|
-
const obj = Object.create(Digest.prototype);
|
|
205
|
-
obj.__wbg_ptr = ptr;
|
|
206
|
-
DigestFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
207
|
-
return obj;
|
|
208
|
-
}
|
|
209
|
-
__destroy_into_raw() {
|
|
210
|
-
const ptr = this.__wbg_ptr;
|
|
211
|
-
this.__wbg_ptr = 0;
|
|
212
|
-
DigestFinalization.unregister(this);
|
|
213
|
-
return ptr;
|
|
214
|
-
}
|
|
215
|
-
free() {
|
|
216
|
-
const ptr = this.__destroy_into_raw();
|
|
217
|
-
wasm.__wbg_digest_free(ptr, 0);
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Upcasts; to the JS-import type for [`WasmDigest`].
|
|
221
|
-
* @returns {Digest}
|
|
222
|
-
*/
|
|
223
|
-
__wasm_refgen_toWasmDigest() {
|
|
224
|
-
const ret = wasm.digest___wasm_refgen_toWasmDigest(this.__wbg_ptr);
|
|
225
|
-
return Digest.__wrap(ret);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Creates a new digest from its Base58 string representation.
|
|
229
|
-
*
|
|
230
|
-
* # Errors
|
|
231
|
-
*
|
|
232
|
-
* Returns a `WasmInvalidDigest` error if the string cannot be decoded or is not a valid digest.
|
|
233
|
-
* @param {string} s
|
|
234
|
-
* @returns {Digest}
|
|
235
|
-
*/
|
|
236
|
-
static fromBase58(s) {
|
|
237
|
-
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
238
|
-
const len0 = WASM_VECTOR_LEN;
|
|
239
|
-
const ret = wasm.digest_fromBase58(ptr0, len0);
|
|
240
|
-
if (ret[2]) {
|
|
241
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
242
|
-
}
|
|
243
|
-
return Digest.__wrap(ret[0]);
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Creates a new digest from its byte representation.
|
|
247
|
-
*
|
|
248
|
-
* # Errors
|
|
249
|
-
*
|
|
250
|
-
* Returns a `WasmValue` error if the byte slice is not a valid digest.
|
|
251
|
-
* @param {Uint8Array} bytes
|
|
252
|
-
* @returns {Digest}
|
|
253
|
-
*/
|
|
254
|
-
static fromBytes(bytes) {
|
|
255
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
256
|
-
const len0 = WASM_VECTOR_LEN;
|
|
257
|
-
const ret = wasm.digest_fromBytes(ptr0, len0);
|
|
258
|
-
if (ret[2]) {
|
|
259
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
260
|
-
}
|
|
261
|
-
return Digest.__wrap(ret[0]);
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Creates a new digest from its hexadecimal string representation.
|
|
265
|
-
*
|
|
266
|
-
* # Errors
|
|
267
|
-
*
|
|
268
|
-
* Returns a [`WasmInvalidDigest`] if the string is not a valid digest.
|
|
269
|
-
* @param {string} s
|
|
270
|
-
* @returns {Digest}
|
|
271
|
-
*/
|
|
272
|
-
static fromHexString(s) {
|
|
273
|
-
const ptr0 = passStringToWasm0(s, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
274
|
-
const len0 = WASM_VECTOR_LEN;
|
|
275
|
-
const ret = wasm.digest_fromHexString(ptr0, len0);
|
|
276
|
-
if (ret[2]) {
|
|
277
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
278
|
-
}
|
|
279
|
-
return Digest.__wrap(ret[0]);
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Creates a new digest from its byte representation.
|
|
283
|
-
*
|
|
284
|
-
* # Errors
|
|
285
|
-
*
|
|
286
|
-
* Returns a `WasmValue` error if the byte slice is not a valid digest.
|
|
287
|
-
* @param {Uint8Array} bytes
|
|
288
|
-
*/
|
|
289
|
-
constructor(bytes) {
|
|
290
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
291
|
-
const len0 = WASM_VECTOR_LEN;
|
|
292
|
-
const ret = wasm.digest_new(ptr0, len0);
|
|
293
|
-
if (ret[2]) {
|
|
294
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
295
|
-
}
|
|
296
|
-
this.__wbg_ptr = ret[0] >>> 0;
|
|
297
|
-
DigestFinalization.register(this, this.__wbg_ptr, this);
|
|
298
|
-
return this;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Returns the byte representation of the digest.
|
|
302
|
-
* @returns {Uint8Array}
|
|
303
|
-
*/
|
|
304
|
-
toBytes() {
|
|
305
|
-
const ret = wasm.digest_toBytes(this.__wbg_ptr);
|
|
306
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
307
|
-
wasm.__wbindgen_export6(ret[0], ret[1] * 1, 1);
|
|
308
|
-
return v1;
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Returns the hexadecimal string representation of the digest.
|
|
312
|
-
* @returns {string}
|
|
313
|
-
*/
|
|
314
|
-
toHexString() {
|
|
315
|
-
let deferred1_0;
|
|
316
|
-
let deferred1_1;
|
|
317
|
-
try {
|
|
318
|
-
const ret = wasm.digest_toHexString(this.__wbg_ptr);
|
|
319
|
-
deferred1_0 = ret[0];
|
|
320
|
-
deferred1_1 = ret[1];
|
|
321
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
322
|
-
} finally {
|
|
323
|
-
wasm.__wbindgen_export6(deferred1_0, deferred1_1, 1);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
if (Symbol.dispose) Digest.prototype[Symbol.dispose] = Digest.prototype.free;
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* A data fragment used in the Sedimentree system.
|
|
331
|
-
*/
|
|
332
|
-
export class Fragment {
|
|
333
|
-
static __wrap(ptr) {
|
|
334
|
-
ptr = ptr >>> 0;
|
|
335
|
-
const obj = Object.create(Fragment.prototype);
|
|
336
|
-
obj.__wbg_ptr = ptr;
|
|
337
|
-
FragmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
338
|
-
return obj;
|
|
339
|
-
}
|
|
340
|
-
__destroy_into_raw() {
|
|
341
|
-
const ptr = this.__wbg_ptr;
|
|
342
|
-
this.__wbg_ptr = 0;
|
|
343
|
-
FragmentFinalization.unregister(this);
|
|
344
|
-
return ptr;
|
|
345
|
-
}
|
|
346
|
-
free() {
|
|
347
|
-
const ptr = this.__destroy_into_raw();
|
|
348
|
-
wasm.__wbg_fragment_free(ptr, 0);
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Upcasts; to the JS-import type for [`WasmFragment`].
|
|
352
|
-
* @returns {Fragment}
|
|
353
|
-
*/
|
|
354
|
-
__wasm_refgen_toWasmFragment() {
|
|
355
|
-
const ret = wasm.fragment___wasm_refgen_toWasmFragment(this.__wbg_ptr);
|
|
356
|
-
return Fragment.__wrap(ret);
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Get the blob metadata of the fragment.
|
|
360
|
-
* @returns {BlobMeta}
|
|
361
|
-
*/
|
|
362
|
-
get blobMeta() {
|
|
363
|
-
const ret = wasm.fragment_blobMeta(this.__wbg_ptr);
|
|
364
|
-
return BlobMeta.__wrap(ret);
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Get the boundary digests of the fragment.
|
|
368
|
-
* @returns {Digest[]}
|
|
369
|
-
*/
|
|
370
|
-
get boundary() {
|
|
371
|
-
const ret = wasm.fragment_boundary(this.__wbg_ptr);
|
|
372
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
373
|
-
wasm.__wbindgen_export6(ret[0], ret[1] * 4, 4);
|
|
374
|
-
return v1;
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Get the head digest of the fragment.
|
|
378
|
-
* @returns {Digest}
|
|
379
|
-
*/
|
|
380
|
-
get head() {
|
|
381
|
-
const ret = wasm.fragment_head(this.__wbg_ptr);
|
|
382
|
-
return Digest.__wrap(ret);
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Create a new fragment from the given sedimentree ID, head, boundary, checkpoints, and blob metadata.
|
|
386
|
-
* @param {SedimentreeId} sedimentree_id
|
|
387
|
-
* @param {Digest} head
|
|
388
|
-
* @param {Digest[]} boundary
|
|
389
|
-
* @param {Digest[]} checkpoints
|
|
390
|
-
* @param {BlobMeta} blob_meta
|
|
391
|
-
*/
|
|
392
|
-
constructor(sedimentree_id, head, boundary, checkpoints, blob_meta) {
|
|
393
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
394
|
-
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
395
|
-
_assertClass(head, Digest);
|
|
396
|
-
var ptr1 = head.__destroy_into_raw();
|
|
397
|
-
const ptr2 = passArrayJsValueToWasm0(boundary, wasm.__wbindgen_export);
|
|
398
|
-
const len2 = WASM_VECTOR_LEN;
|
|
399
|
-
const ptr3 = passArrayJsValueToWasm0(checkpoints, wasm.__wbindgen_export);
|
|
400
|
-
const len3 = WASM_VECTOR_LEN;
|
|
401
|
-
_assertClass(blob_meta, BlobMeta);
|
|
402
|
-
var ptr4 = blob_meta.__destroy_into_raw();
|
|
403
|
-
const ret = wasm.fragment_new(ptr0, ptr1, ptr2, len2, ptr3, len3, ptr4);
|
|
404
|
-
this.__wbg_ptr = ret >>> 0;
|
|
405
|
-
FragmentFinalization.register(this, this.__wbg_ptr, this);
|
|
406
|
-
return this;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
if (Symbol.dispose) Fragment.prototype[Symbol.dispose] = Fragment.prototype.free;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* A fragment stored with its associated blob.
|
|
413
|
-
*/
|
|
414
|
-
export class FragmentWithBlob {
|
|
415
|
-
static __wrap(ptr) {
|
|
416
|
-
ptr = ptr >>> 0;
|
|
417
|
-
const obj = Object.create(FragmentWithBlob.prototype);
|
|
418
|
-
obj.__wbg_ptr = ptr;
|
|
419
|
-
FragmentWithBlobFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
420
|
-
return obj;
|
|
421
|
-
}
|
|
422
|
-
__destroy_into_raw() {
|
|
423
|
-
const ptr = this.__wbg_ptr;
|
|
424
|
-
this.__wbg_ptr = 0;
|
|
425
|
-
FragmentWithBlobFinalization.unregister(this);
|
|
426
|
-
return ptr;
|
|
427
|
-
}
|
|
428
|
-
free() {
|
|
429
|
-
const ptr = this.__destroy_into_raw();
|
|
430
|
-
wasm.__wbg_fragmentwithblob_free(ptr, 0);
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* Upcasts; to the JS-import type for [`WasmFragmentWithBlob`].
|
|
434
|
-
* @returns {FragmentWithBlob}
|
|
435
|
-
*/
|
|
436
|
-
__wasm_refgen_toWasmFragmentWithBlob() {
|
|
437
|
-
const ret = wasm.fragmentwithblob___wasm_refgen_toWasmFragmentWithBlob(this.__wbg_ptr);
|
|
438
|
-
return FragmentWithBlob.__wrap(ret);
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Get the blob.
|
|
442
|
-
* @returns {Uint8Array}
|
|
443
|
-
*/
|
|
444
|
-
get blob() {
|
|
445
|
-
const ret = wasm.fragmentwithblob_blob(this.__wbg_ptr);
|
|
446
|
-
return ret;
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Create a new fragment with blob.
|
|
450
|
-
* @param {SignedFragment} signed
|
|
451
|
-
* @param {Uint8Array} blob
|
|
452
|
-
*/
|
|
453
|
-
constructor(signed, blob) {
|
|
454
|
-
_assertClass(signed, SignedFragment);
|
|
455
|
-
var ptr0 = signed.__destroy_into_raw();
|
|
456
|
-
const ret = wasm.fragmentwithblob_new(ptr0, blob);
|
|
457
|
-
this.__wbg_ptr = ret >>> 0;
|
|
458
|
-
FragmentWithBlobFinalization.register(this, this.__wbg_ptr, this);
|
|
459
|
-
return this;
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Get the signed fragment.
|
|
463
|
-
* @returns {SignedFragment}
|
|
464
|
-
*/
|
|
465
|
-
get signed() {
|
|
466
|
-
const ret = wasm.fragmentwithblob_signed(this.__wbg_ptr);
|
|
467
|
-
return SignedFragment.__wrap(ret);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
if (Symbol.dispose) FragmentWithBlob.prototype[Symbol.dispose] = FragmentWithBlob.prototype.free;
|
|
471
|
-
|
|
472
|
-
export class FragmentsArray {
|
|
473
|
-
static __wrap(ptr) {
|
|
474
|
-
ptr = ptr >>> 0;
|
|
475
|
-
const obj = Object.create(FragmentsArray.prototype);
|
|
476
|
-
obj.__wbg_ptr = ptr;
|
|
477
|
-
FragmentsArrayFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
478
|
-
return obj;
|
|
479
|
-
}
|
|
480
|
-
__destroy_into_raw() {
|
|
481
|
-
const ptr = this.__wbg_ptr;
|
|
482
|
-
this.__wbg_ptr = 0;
|
|
483
|
-
FragmentsArrayFinalization.unregister(this);
|
|
484
|
-
return ptr;
|
|
485
|
-
}
|
|
486
|
-
free() {
|
|
487
|
-
const ptr = this.__destroy_into_raw();
|
|
488
|
-
wasm.__wbg_fragmentsarray_free(ptr, 0);
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Upcasts; to the JS-import type for [`WasmFragmentsArray`].
|
|
492
|
-
* @returns {FragmentsArray}
|
|
493
|
-
*/
|
|
494
|
-
__wasm_refgen_toWasmFragmentsArray() {
|
|
495
|
-
const ret = wasm.fragmentsarray___wasm_refgen_toWasmFragmentsArray(this.__wbg_ptr);
|
|
496
|
-
return FragmentsArray.__wrap(ret);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
if (Symbol.dispose) FragmentsArray.prototype[Symbol.dispose] = FragmentsArray.prototype.free;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* A Wasm wrapper around the [`LooseCommit`] type.
|
|
503
|
-
*/
|
|
504
|
-
export class LooseCommit {
|
|
505
|
-
static __wrap(ptr) {
|
|
506
|
-
ptr = ptr >>> 0;
|
|
507
|
-
const obj = Object.create(LooseCommit.prototype);
|
|
508
|
-
obj.__wbg_ptr = ptr;
|
|
509
|
-
LooseCommitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
510
|
-
return obj;
|
|
511
|
-
}
|
|
512
|
-
__destroy_into_raw() {
|
|
513
|
-
const ptr = this.__wbg_ptr;
|
|
514
|
-
this.__wbg_ptr = 0;
|
|
515
|
-
LooseCommitFinalization.unregister(this);
|
|
516
|
-
return ptr;
|
|
517
|
-
}
|
|
518
|
-
free() {
|
|
519
|
-
const ptr = this.__destroy_into_raw();
|
|
520
|
-
wasm.__wbg_loosecommit_free(ptr, 0);
|
|
521
|
-
}
|
|
522
|
-
/**
|
|
523
|
-
* Upcasts; to the JS-import type for [`WasmLooseCommit`].
|
|
524
|
-
* @returns {LooseCommit}
|
|
525
|
-
*/
|
|
526
|
-
__wasm_refgen_toWasmLooseCommit() {
|
|
527
|
-
const ret = wasm.loosecommit___wasm_refgen_toWasmLooseCommit(this.__wbg_ptr);
|
|
528
|
-
return LooseCommit.__wrap(ret);
|
|
529
|
-
}
|
|
530
|
-
/**
|
|
531
|
-
* Get the blob metadata of the commit.
|
|
532
|
-
* @returns {BlobMeta}
|
|
533
|
-
*/
|
|
534
|
-
get blobMeta() {
|
|
535
|
-
const ret = wasm.loosecommit_blobMeta(this.__wbg_ptr);
|
|
536
|
-
return BlobMeta.__wrap(ret);
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Get the digest of the commit.
|
|
540
|
-
* @returns {Digest}
|
|
541
|
-
*/
|
|
542
|
-
get digest() {
|
|
543
|
-
const ret = wasm.loosecommit_digest(this.__wbg_ptr);
|
|
544
|
-
return Digest.__wrap(ret);
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Create a new `LooseCommit` from the given sedimentree ID, parents, and blob metadata.
|
|
548
|
-
* @param {SedimentreeId} sedimentree_id
|
|
549
|
-
* @param {Digest[]} parents
|
|
550
|
-
* @param {BlobMeta} blob_meta
|
|
551
|
-
*/
|
|
552
|
-
constructor(sedimentree_id, parents, blob_meta) {
|
|
553
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
554
|
-
var ptr0 = sedimentree_id.__destroy_into_raw();
|
|
555
|
-
const ptr1 = passArrayJsValueToWasm0(parents, wasm.__wbindgen_export);
|
|
556
|
-
const len1 = WASM_VECTOR_LEN;
|
|
557
|
-
_assertClass(blob_meta, BlobMeta);
|
|
558
|
-
const ret = wasm.loosecommit_new(ptr0, ptr1, len1, blob_meta.__wbg_ptr);
|
|
559
|
-
this.__wbg_ptr = ret >>> 0;
|
|
560
|
-
LooseCommitFinalization.register(this, this.__wbg_ptr, this);
|
|
561
|
-
return this;
|
|
562
|
-
}
|
|
563
|
-
/**
|
|
564
|
-
* Get the parent digests of the commit.
|
|
565
|
-
* @returns {Digest[]}
|
|
566
|
-
*/
|
|
567
|
-
get parents() {
|
|
568
|
-
const ret = wasm.loosecommit_parents(this.__wbg_ptr);
|
|
569
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
570
|
-
wasm.__wbindgen_export6(ret[0], ret[1] * 4, 4);
|
|
571
|
-
return v1;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
if (Symbol.dispose) LooseCommit.prototype[Symbol.dispose] = LooseCommit.prototype.free;
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* An in-memory storage implementation for use in tests and development.
|
|
578
|
-
*
|
|
579
|
-
* This wraps the core `MemoryStorage` and exposes it via the `SedimentreeStorage` interface.
|
|
580
|
-
*/
|
|
581
|
-
export class MemoryStorage {
|
|
582
|
-
__destroy_into_raw() {
|
|
583
|
-
const ptr = this.__wbg_ptr;
|
|
584
|
-
this.__wbg_ptr = 0;
|
|
585
|
-
MemoryStorageFinalization.unregister(this);
|
|
586
|
-
return ptr;
|
|
587
|
-
}
|
|
588
|
-
free() {
|
|
589
|
-
const ptr = this.__destroy_into_raw();
|
|
590
|
-
wasm.__wbg_memorystorage_free(ptr, 0);
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* Delete all commits for a sedimentree.
|
|
594
|
-
* @param {SedimentreeId} sedimentree_id
|
|
595
|
-
* @returns {Promise<any>}
|
|
596
|
-
*/
|
|
597
|
-
deleteAllCommits(sedimentree_id) {
|
|
598
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
599
|
-
const ret = wasm.memorystorage_deleteAllCommits(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
600
|
-
return ret;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Delete all fragments for a sedimentree.
|
|
604
|
-
* @param {SedimentreeId} sedimentree_id
|
|
605
|
-
* @returns {Promise<any>}
|
|
606
|
-
*/
|
|
607
|
-
deleteAllFragments(sedimentree_id) {
|
|
608
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
609
|
-
const ret = wasm.memorystorage_deleteAllFragments(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
610
|
-
return ret;
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* Delete a commit by digest.
|
|
614
|
-
* @param {SedimentreeId} sedimentree_id
|
|
615
|
-
* @param {Digest} digest
|
|
616
|
-
* @returns {Promise<any>}
|
|
617
|
-
*/
|
|
618
|
-
deleteCommit(sedimentree_id, digest) {
|
|
619
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
620
|
-
_assertClass(digest, Digest);
|
|
621
|
-
const ret = wasm.memorystorage_deleteCommit(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
622
|
-
return ret;
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Delete a fragment by digest.
|
|
626
|
-
* @param {SedimentreeId} sedimentree_id
|
|
627
|
-
* @param {Digest} digest
|
|
628
|
-
* @returns {Promise<any>}
|
|
629
|
-
*/
|
|
630
|
-
deleteFragment(sedimentree_id, digest) {
|
|
631
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
632
|
-
_assertClass(digest, Digest);
|
|
633
|
-
const ret = wasm.memorystorage_deleteFragment(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
634
|
-
return ret;
|
|
635
|
-
}
|
|
636
|
-
/**
|
|
637
|
-
* Delete a sedimentree ID.
|
|
638
|
-
* @param {SedimentreeId} sedimentree_id
|
|
639
|
-
* @returns {Promise<any>}
|
|
640
|
-
*/
|
|
641
|
-
deleteSedimentreeId(sedimentree_id) {
|
|
642
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
643
|
-
const ret = wasm.memorystorage_deleteSedimentreeId(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
644
|
-
return ret;
|
|
645
|
-
}
|
|
646
|
-
/**
|
|
647
|
-
* List all commit digests for a sedimentree.
|
|
648
|
-
* @param {SedimentreeId} sedimentree_id
|
|
649
|
-
* @returns {Promise<any>}
|
|
650
|
-
*/
|
|
651
|
-
listCommitDigests(sedimentree_id) {
|
|
652
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
653
|
-
const ret = wasm.memorystorage_listCommitDigests(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
654
|
-
return ret;
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* List all fragment digests for a sedimentree.
|
|
658
|
-
* @param {SedimentreeId} sedimentree_id
|
|
659
|
-
* @returns {Promise<any>}
|
|
660
|
-
*/
|
|
661
|
-
listFragmentDigests(sedimentree_id) {
|
|
662
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
663
|
-
const ret = wasm.memorystorage_listFragmentDigests(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
664
|
-
return ret;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Load all commits for a sedimentree, returning `CommitWithBlob[]`.
|
|
668
|
-
* @param {SedimentreeId} sedimentree_id
|
|
669
|
-
* @returns {Promise<any>}
|
|
670
|
-
*/
|
|
671
|
-
loadAllCommits(sedimentree_id) {
|
|
672
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
673
|
-
const ret = wasm.memorystorage_loadAllCommits(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
674
|
-
return ret;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Load all fragments for a sedimentree, returning `FragmentWithBlob[]`.
|
|
678
|
-
* @param {SedimentreeId} sedimentree_id
|
|
679
|
-
* @returns {Promise<any>}
|
|
680
|
-
*/
|
|
681
|
-
loadAllFragments(sedimentree_id) {
|
|
682
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
683
|
-
const ret = wasm.memorystorage_loadAllFragments(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
684
|
-
return ret;
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* Load all sedimentree IDs.
|
|
688
|
-
* @returns {Promise<any>}
|
|
689
|
-
*/
|
|
690
|
-
loadAllSedimentreeIds() {
|
|
691
|
-
const ret = wasm.memorystorage_loadAllSedimentreeIds(this.__wbg_ptr);
|
|
692
|
-
return ret;
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* Load a commit by digest, returning `CommitWithBlob` or null.
|
|
696
|
-
* @param {SedimentreeId} sedimentree_id
|
|
697
|
-
* @param {Digest} digest
|
|
698
|
-
* @returns {Promise<any>}
|
|
699
|
-
*/
|
|
700
|
-
loadCommit(sedimentree_id, digest) {
|
|
701
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
702
|
-
_assertClass(digest, Digest);
|
|
703
|
-
const ret = wasm.memorystorage_loadCommit(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
704
|
-
return ret;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* Load a fragment by digest, returning `FragmentWithBlob` or null.
|
|
708
|
-
* @param {SedimentreeId} sedimentree_id
|
|
709
|
-
* @param {Digest} digest
|
|
710
|
-
* @returns {Promise<any>}
|
|
711
|
-
*/
|
|
712
|
-
loadFragment(sedimentree_id, digest) {
|
|
713
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
714
|
-
_assertClass(digest, Digest);
|
|
715
|
-
const ret = wasm.memorystorage_loadFragment(this.__wbg_ptr, sedimentree_id.__wbg_ptr, digest.__wbg_ptr);
|
|
716
|
-
return ret;
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* Create a new in-memory storage instance.
|
|
720
|
-
*/
|
|
721
|
-
constructor() {
|
|
722
|
-
const ret = wasm.memorystorage_new();
|
|
723
|
-
this.__wbg_ptr = ret >>> 0;
|
|
724
|
-
MemoryStorageFinalization.register(this, this.__wbg_ptr, this);
|
|
725
|
-
return this;
|
|
726
|
-
}
|
|
727
|
-
/**
|
|
728
|
-
* Save commits and fragments in a single batch.
|
|
729
|
-
* @param {SedimentreeId} sedimentree_id
|
|
730
|
-
* @param {Array<any>} commits
|
|
731
|
-
* @param {Array<any>} fragments
|
|
732
|
-
* @returns {Promise<any>}
|
|
733
|
-
*/
|
|
734
|
-
saveBatchAll(sedimentree_id, commits, fragments) {
|
|
735
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
736
|
-
const ret = wasm.memorystorage_saveBatchAll(this.__wbg_ptr, sedimentree_id.__wbg_ptr, commits, fragments);
|
|
737
|
-
return ret;
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* Save a commit with its blob.
|
|
741
|
-
* @param {SedimentreeId} sedimentree_id
|
|
742
|
-
* @param {Digest} _digest
|
|
743
|
-
* @param {SignedLooseCommit} signed_commit
|
|
744
|
-
* @param {Uint8Array} blob
|
|
745
|
-
* @returns {Promise<any>}
|
|
746
|
-
*/
|
|
747
|
-
saveCommit(sedimentree_id, _digest, signed_commit, blob) {
|
|
748
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
749
|
-
_assertClass(_digest, Digest);
|
|
750
|
-
_assertClass(signed_commit, SignedLooseCommit);
|
|
751
|
-
const ret = wasm.memorystorage_saveCommit(this.__wbg_ptr, sedimentree_id.__wbg_ptr, _digest.__wbg_ptr, signed_commit.__wbg_ptr, blob);
|
|
752
|
-
return ret;
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Save a fragment with its blob.
|
|
756
|
-
* @param {SedimentreeId} sedimentree_id
|
|
757
|
-
* @param {Digest} _digest
|
|
758
|
-
* @param {SignedFragment} signed_fragment
|
|
759
|
-
* @param {Uint8Array} blob
|
|
760
|
-
* @returns {Promise<any>}
|
|
761
|
-
*/
|
|
762
|
-
saveFragment(sedimentree_id, _digest, signed_fragment, blob) {
|
|
763
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
764
|
-
_assertClass(_digest, Digest);
|
|
765
|
-
_assertClass(signed_fragment, SignedFragment);
|
|
766
|
-
const ret = wasm.memorystorage_saveFragment(this.__wbg_ptr, sedimentree_id.__wbg_ptr, _digest.__wbg_ptr, signed_fragment.__wbg_ptr, blob);
|
|
767
|
-
return ret;
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Save a sedimentree ID.
|
|
771
|
-
* @param {SedimentreeId} sedimentree_id
|
|
772
|
-
* @returns {Promise<any>}
|
|
773
|
-
*/
|
|
774
|
-
saveSedimentreeId(sedimentree_id) {
|
|
775
|
-
_assertClass(sedimentree_id, SedimentreeId);
|
|
776
|
-
const ret = wasm.memorystorage_saveSedimentreeId(this.__wbg_ptr, sedimentree_id.__wbg_ptr);
|
|
777
|
-
return ret;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
if (Symbol.dispose) MemoryStorage.prototype[Symbol.dispose] = MemoryStorage.prototype.free;
|
|
781
|
-
|
|
782
|
-
/**
|
|
783
|
-
* The main Sedimentree data structure.
|
|
784
|
-
*/
|
|
785
|
-
export class Sedimentree {
|
|
786
|
-
static __wrap(ptr) {
|
|
787
|
-
ptr = ptr >>> 0;
|
|
788
|
-
const obj = Object.create(Sedimentree.prototype);
|
|
789
|
-
obj.__wbg_ptr = ptr;
|
|
790
|
-
SedimentreeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
791
|
-
return obj;
|
|
792
|
-
}
|
|
793
|
-
__destroy_into_raw() {
|
|
794
|
-
const ptr = this.__wbg_ptr;
|
|
795
|
-
this.__wbg_ptr = 0;
|
|
796
|
-
SedimentreeFinalization.unregister(this);
|
|
797
|
-
return ptr;
|
|
798
|
-
}
|
|
799
|
-
free() {
|
|
800
|
-
const ptr = this.__destroy_into_raw();
|
|
801
|
-
wasm.__wbg_sedimentree_free(ptr, 0);
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Create an empty Sedimentree.
|
|
805
|
-
* @returns {Sedimentree}
|
|
806
|
-
*/
|
|
807
|
-
static empty() {
|
|
808
|
-
const ret = wasm.sedimentree_empty();
|
|
809
|
-
return Sedimentree.__wrap(ret);
|
|
810
|
-
}
|
|
811
|
-
/**
|
|
812
|
-
* Create a new Sedimentree from fragments and loose commits.
|
|
813
|
-
* @param {Fragment[]} fragments
|
|
814
|
-
* @param {LooseCommit[]} commits
|
|
815
|
-
*/
|
|
816
|
-
constructor(fragments, commits) {
|
|
817
|
-
const ptr0 = passArrayJsValueToWasm0(fragments, wasm.__wbindgen_export);
|
|
818
|
-
const len0 = WASM_VECTOR_LEN;
|
|
819
|
-
const ptr1 = passArrayJsValueToWasm0(commits, wasm.__wbindgen_export);
|
|
820
|
-
const len1 = WASM_VECTOR_LEN;
|
|
821
|
-
const ret = wasm.sedimentree_new(ptr0, len0, ptr1, len1);
|
|
822
|
-
this.__wbg_ptr = ret >>> 0;
|
|
823
|
-
SedimentreeFinalization.register(this, this.__wbg_ptr, this);
|
|
824
|
-
return this;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
if (Symbol.dispose) Sedimentree.prototype[Symbol.dispose] = Sedimentree.prototype.free;
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* A Wasm wrapper around the [`SedimentreeId`] type.
|
|
831
|
-
*/
|
|
832
|
-
export class SedimentreeId {
|
|
833
|
-
static __wrap(ptr) {
|
|
834
|
-
ptr = ptr >>> 0;
|
|
835
|
-
const obj = Object.create(SedimentreeId.prototype);
|
|
836
|
-
obj.__wbg_ptr = ptr;
|
|
837
|
-
SedimentreeIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
838
|
-
return obj;
|
|
839
|
-
}
|
|
840
|
-
__destroy_into_raw() {
|
|
841
|
-
const ptr = this.__wbg_ptr;
|
|
842
|
-
this.__wbg_ptr = 0;
|
|
843
|
-
SedimentreeIdFinalization.unregister(this);
|
|
844
|
-
return ptr;
|
|
845
|
-
}
|
|
846
|
-
free() {
|
|
847
|
-
const ptr = this.__destroy_into_raw();
|
|
848
|
-
wasm.__wbg_sedimentreeid_free(ptr, 0);
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Upcasts; to the JS-import type for [`WasmSedimentreeId`].
|
|
852
|
-
* @returns {SedimentreeId}
|
|
853
|
-
*/
|
|
854
|
-
__wasm_refgen_toWasmSedimentreeId() {
|
|
855
|
-
const ret = wasm.sedimentreeid___wasm_refgen_toWasmSedimentreeId(this.__wbg_ptr);
|
|
856
|
-
return SedimentreeId.__wrap(ret);
|
|
857
|
-
}
|
|
858
|
-
/**
|
|
859
|
-
* Create an ID from a byte array.
|
|
860
|
-
*
|
|
861
|
-
* # Errors
|
|
862
|
-
*
|
|
863
|
-
* Returns `Not32Bytes` if the provided byte array is not exactly 32 bytes long.
|
|
864
|
-
* @param {Uint8Array} bytes
|
|
865
|
-
* @returns {SedimentreeId}
|
|
866
|
-
*/
|
|
867
|
-
static fromBytes(bytes) {
|
|
868
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_export);
|
|
869
|
-
const len0 = WASM_VECTOR_LEN;
|
|
870
|
-
const ret = wasm.sedimentreeid_fromBytes(ptr0, len0);
|
|
871
|
-
if (ret[2]) {
|
|
872
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
873
|
-
}
|
|
874
|
-
return SedimentreeId.__wrap(ret[0]);
|
|
875
|
-
}
|
|
876
|
-
/**
|
|
877
|
-
* Returns the raw bytes of this ID.
|
|
878
|
-
* @returns {Uint8Array}
|
|
879
|
-
*/
|
|
880
|
-
toBytes() {
|
|
881
|
-
const ret = wasm.sedimentreeid_toBytes(this.__wbg_ptr);
|
|
882
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
883
|
-
wasm.__wbindgen_export6(ret[0], ret[1] * 1, 1);
|
|
884
|
-
return v1;
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* Returns the string representation of the ID.
|
|
888
|
-
* @returns {string}
|
|
889
|
-
*/
|
|
890
|
-
toString() {
|
|
891
|
-
let deferred1_0;
|
|
892
|
-
let deferred1_1;
|
|
893
|
-
try {
|
|
894
|
-
const ret = wasm.sedimentreeid_toString(this.__wbg_ptr);
|
|
895
|
-
deferred1_0 = ret[0];
|
|
896
|
-
deferred1_1 = ret[1];
|
|
897
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
898
|
-
} finally {
|
|
899
|
-
wasm.__wbindgen_export6(deferred1_0, deferred1_1, 1);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
if (Symbol.dispose) SedimentreeId.prototype[Symbol.dispose] = SedimentreeId.prototype.free;
|
|
904
|
-
|
|
905
|
-
export class SedimentreeIdsArray {
|
|
906
|
-
static __wrap(ptr) {
|
|
907
|
-
ptr = ptr >>> 0;
|
|
908
|
-
const obj = Object.create(SedimentreeIdsArray.prototype);
|
|
909
|
-
obj.__wbg_ptr = ptr;
|
|
910
|
-
SedimentreeIdsArrayFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
911
|
-
return obj;
|
|
912
|
-
}
|
|
913
|
-
__destroy_into_raw() {
|
|
914
|
-
const ptr = this.__wbg_ptr;
|
|
915
|
-
this.__wbg_ptr = 0;
|
|
916
|
-
SedimentreeIdsArrayFinalization.unregister(this);
|
|
917
|
-
return ptr;
|
|
918
|
-
}
|
|
919
|
-
free() {
|
|
920
|
-
const ptr = this.__destroy_into_raw();
|
|
921
|
-
wasm.__wbg_sedimentreeidsarray_free(ptr, 0);
|
|
922
|
-
}
|
|
923
|
-
/**
|
|
924
|
-
* Upcasts; to the JS-import type for [`WasmSedimentreeIdsArray`].
|
|
925
|
-
* @returns {SedimentreeIdsArray}
|
|
926
|
-
*/
|
|
927
|
-
__wasm_refgen_toWasmSedimentreeIdsArray() {
|
|
928
|
-
const ret = wasm.sedimentreeidsarray___wasm_refgen_toWasmSedimentreeIdsArray(this.__wbg_ptr);
|
|
929
|
-
return SedimentreeIdsArray.__wrap(ret);
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
if (Symbol.dispose) SedimentreeIdsArray.prototype[Symbol.dispose] = SedimentreeIdsArray.prototype.free;
|
|
933
|
-
|
|
934
|
-
/**
|
|
935
|
-
* A Wasm wrapper around `Signed<Fragment>`.
|
|
936
|
-
*/
|
|
937
|
-
export class SignedFragment {
|
|
938
|
-
static __wrap(ptr) {
|
|
939
|
-
ptr = ptr >>> 0;
|
|
940
|
-
const obj = Object.create(SignedFragment.prototype);
|
|
941
|
-
obj.__wbg_ptr = ptr;
|
|
942
|
-
SignedFragmentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
943
|
-
return obj;
|
|
944
|
-
}
|
|
945
|
-
static __unwrap(jsValue) {
|
|
946
|
-
if (!(jsValue instanceof SignedFragment)) {
|
|
947
|
-
return 0;
|
|
948
|
-
}
|
|
949
|
-
return jsValue.__destroy_into_raw();
|
|
950
|
-
}
|
|
951
|
-
__destroy_into_raw() {
|
|
952
|
-
const ptr = this.__wbg_ptr;
|
|
953
|
-
this.__wbg_ptr = 0;
|
|
954
|
-
SignedFragmentFinalization.unregister(this);
|
|
955
|
-
return ptr;
|
|
956
|
-
}
|
|
957
|
-
free() {
|
|
958
|
-
const ptr = this.__destroy_into_raw();
|
|
959
|
-
wasm.__wbg_signedfragment_free(ptr, 0);
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* Upcasts; to the JS-import type for [`WasmSignedFragment`].
|
|
963
|
-
* @returns {SignedFragment}
|
|
964
|
-
*/
|
|
965
|
-
__wasm_refgen_toWasmSignedFragment() {
|
|
966
|
-
const ret = wasm.signedfragment___wasm_refgen_toWasmSignedFragment(this.__wbg_ptr);
|
|
967
|
-
return SignedFragment.__wrap(ret);
|
|
968
|
-
}
|
|
969
|
-
/**
|
|
970
|
-
* Encode this signed fragment to raw bytes.
|
|
971
|
-
* @returns {Uint8Array}
|
|
972
|
-
*/
|
|
973
|
-
encode() {
|
|
974
|
-
const ret = wasm.signedfragment_encode(this.__wbg_ptr);
|
|
975
|
-
return ret;
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* Get the unsigned payload without re-verifying the signature.
|
|
979
|
-
*
|
|
980
|
-
* # Errors
|
|
981
|
-
*
|
|
982
|
-
* Returns an error if the payload cannot be decoded.
|
|
983
|
-
* @returns {Fragment}
|
|
984
|
-
*/
|
|
985
|
-
get payload() {
|
|
986
|
-
const ret = wasm.signedfragment_payload(this.__wbg_ptr);
|
|
987
|
-
if (ret[2]) {
|
|
988
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
989
|
-
}
|
|
990
|
-
return Fragment.__wrap(ret[0]);
|
|
991
|
-
}
|
|
992
|
-
/**
|
|
993
|
-
* Decode a `SignedFragment` from raw bytes.
|
|
994
|
-
*
|
|
995
|
-
* # Errors
|
|
996
|
-
*
|
|
997
|
-
* Returns an error if the bytes are not a valid signed fragment.
|
|
998
|
-
* @param {Uint8Array} bytes
|
|
999
|
-
* @returns {SignedFragment}
|
|
1000
|
-
*/
|
|
1001
|
-
static tryDecode(bytes) {
|
|
1002
|
-
const ret = wasm.signedfragment_tryDecode(bytes);
|
|
1003
|
-
if (ret[2]) {
|
|
1004
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1005
|
-
}
|
|
1006
|
-
return SignedFragment.__wrap(ret[0]);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
if (Symbol.dispose) SignedFragment.prototype[Symbol.dispose] = SignedFragment.prototype.free;
|
|
1010
|
-
|
|
1011
|
-
/**
|
|
1012
|
-
* A Wasm wrapper around `Signed<LooseCommit>`.
|
|
1013
|
-
*/
|
|
1014
|
-
export class SignedLooseCommit {
|
|
1015
|
-
static __wrap(ptr) {
|
|
1016
|
-
ptr = ptr >>> 0;
|
|
1017
|
-
const obj = Object.create(SignedLooseCommit.prototype);
|
|
1018
|
-
obj.__wbg_ptr = ptr;
|
|
1019
|
-
SignedLooseCommitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1020
|
-
return obj;
|
|
1021
|
-
}
|
|
1022
|
-
static __unwrap(jsValue) {
|
|
1023
|
-
if (!(jsValue instanceof SignedLooseCommit)) {
|
|
1024
|
-
return 0;
|
|
1025
|
-
}
|
|
1026
|
-
return jsValue.__destroy_into_raw();
|
|
1027
|
-
}
|
|
1028
|
-
__destroy_into_raw() {
|
|
1029
|
-
const ptr = this.__wbg_ptr;
|
|
1030
|
-
this.__wbg_ptr = 0;
|
|
1031
|
-
SignedLooseCommitFinalization.unregister(this);
|
|
1032
|
-
return ptr;
|
|
1033
|
-
}
|
|
1034
|
-
free() {
|
|
1035
|
-
const ptr = this.__destroy_into_raw();
|
|
1036
|
-
wasm.__wbg_signedloosecommit_free(ptr, 0);
|
|
1037
|
-
}
|
|
1038
|
-
/**
|
|
1039
|
-
* Upcasts; to the JS-import type for [`WasmSignedLooseCommit`].
|
|
1040
|
-
* @returns {SignedLooseCommit}
|
|
1041
|
-
*/
|
|
1042
|
-
__wasm_refgen_toWasmSignedLooseCommit() {
|
|
1043
|
-
const ret = wasm.signedloosecommit___wasm_refgen_toWasmSignedLooseCommit(this.__wbg_ptr);
|
|
1044
|
-
return SignedLooseCommit.__wrap(ret);
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* Encode this signed loose commit to raw bytes.
|
|
1048
|
-
* @returns {Uint8Array}
|
|
1049
|
-
*/
|
|
1050
|
-
encode() {
|
|
1051
|
-
const ret = wasm.signedloosecommit_encode(this.__wbg_ptr);
|
|
1052
|
-
return ret;
|
|
1053
|
-
}
|
|
1054
|
-
/**
|
|
1055
|
-
* Get the unsigned payload without re-verifying the signature.
|
|
1056
|
-
*
|
|
1057
|
-
* # Errors
|
|
1058
|
-
*
|
|
1059
|
-
* Returns an error if the payload cannot be decoded.
|
|
1060
|
-
* @returns {LooseCommit}
|
|
1061
|
-
*/
|
|
1062
|
-
get payload() {
|
|
1063
|
-
const ret = wasm.signedloosecommit_payload(this.__wbg_ptr);
|
|
1064
|
-
if (ret[2]) {
|
|
1065
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1066
|
-
}
|
|
1067
|
-
return LooseCommit.__wrap(ret[0]);
|
|
1068
|
-
}
|
|
1069
|
-
/**
|
|
1070
|
-
* Decode a `SignedLooseCommit` from raw bytes.
|
|
1071
|
-
*
|
|
1072
|
-
* # Errors
|
|
1073
|
-
*
|
|
1074
|
-
* Returns an error if the bytes are not a valid signed loose commit.
|
|
1075
|
-
* @param {Uint8Array} bytes
|
|
1076
|
-
* @returns {SignedLooseCommit}
|
|
1077
|
-
*/
|
|
1078
|
-
static tryDecode(bytes) {
|
|
1079
|
-
const ret = wasm.signedloosecommit_tryDecode(bytes);
|
|
1080
|
-
if (ret[2]) {
|
|
1081
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1082
|
-
}
|
|
1083
|
-
return SignedLooseCommit.__wrap(ret[0]);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
if (Symbol.dispose) SignedLooseCommit.prototype[Symbol.dispose] = SignedLooseCommit.prototype.free;
|
|
1087
|
-
|
|
1088
|
-
function __wbg_get_imports() {
|
|
1089
|
-
const import0 = {
|
|
1090
|
-
__proto__: null,
|
|
1091
|
-
__wbg___wasm_refgen_toWasmDigest_476b24805f220005: function(arg0) {
|
|
1092
|
-
const ret = arg0.__wasm_refgen_toWasmDigest();
|
|
1093
|
-
_assertClass(ret, Digest);
|
|
1094
|
-
var ptr1 = ret.__destroy_into_raw();
|
|
1095
|
-
return ptr1;
|
|
1096
|
-
},
|
|
1097
|
-
__wbg___wasm_refgen_toWasmFragment_10dd1ff9b3934840: function(arg0) {
|
|
1098
|
-
const ret = arg0.__wasm_refgen_toWasmFragment();
|
|
1099
|
-
_assertClass(ret, Fragment);
|
|
1100
|
-
var ptr1 = ret.__destroy_into_raw();
|
|
1101
|
-
return ptr1;
|
|
1102
|
-
},
|
|
1103
|
-
__wbg___wasm_refgen_toWasmLooseCommit_f36ad6a9389cee03: function(arg0) {
|
|
1104
|
-
const ret = arg0.__wasm_refgen_toWasmLooseCommit();
|
|
1105
|
-
_assertClass(ret, LooseCommit);
|
|
1106
|
-
var ptr1 = ret.__destroy_into_raw();
|
|
1107
|
-
return ptr1;
|
|
1108
|
-
},
|
|
1109
|
-
__wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
|
|
1110
|
-
const ret = debugString(arg1);
|
|
1111
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1112
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1113
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1114
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1115
|
-
},
|
|
1116
|
-
__wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
|
|
1117
|
-
const ret = typeof(arg0) === 'function';
|
|
1118
|
-
return ret;
|
|
1119
|
-
},
|
|
1120
|
-
__wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
|
|
1121
|
-
const ret = arg0 === undefined;
|
|
1122
|
-
return ret;
|
|
1123
|
-
},
|
|
1124
|
-
__wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
|
|
1125
|
-
const obj = arg1;
|
|
1126
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1127
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1128
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1129
|
-
},
|
|
1130
|
-
__wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
|
|
1131
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1132
|
-
},
|
|
1133
|
-
__wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
|
|
1134
|
-
arg0._wbg_cb_unref();
|
|
1135
|
-
},
|
|
1136
|
-
__wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1137
|
-
const ret = arg0.call(arg1, arg2);
|
|
1138
|
-
return ret;
|
|
1139
|
-
}, arguments); },
|
|
1140
|
-
__wbg_commitwithblob_new: function(arg0) {
|
|
1141
|
-
const ret = CommitWithBlob.__wrap(arg0);
|
|
1142
|
-
return ret;
|
|
1143
|
-
},
|
|
1144
|
-
__wbg_digest_new: function(arg0) {
|
|
1145
|
-
const ret = Digest.__wrap(arg0);
|
|
1146
|
-
return ret;
|
|
1147
|
-
},
|
|
1148
|
-
__wbg_fragmentwithblob_new: function(arg0) {
|
|
1149
|
-
const ret = FragmentWithBlob.__wrap(arg0);
|
|
1150
|
-
return ret;
|
|
1151
|
-
},
|
|
1152
|
-
__wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
|
|
1153
|
-
const ret = Reflect.get(arg0, arg1);
|
|
1154
|
-
return ret;
|
|
1155
|
-
}, arguments); },
|
|
1156
|
-
__wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
|
|
1157
|
-
const ret = arg0[arg1 >>> 0];
|
|
1158
|
-
return ret;
|
|
1159
|
-
},
|
|
1160
|
-
__wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
|
|
1161
|
-
const ret = Number.isSafeInteger(arg0);
|
|
1162
|
-
return ret;
|
|
1163
|
-
},
|
|
1164
|
-
__wbg_length_b3416cf66a5452c8: function(arg0) {
|
|
1165
|
-
const ret = arg0.length;
|
|
1166
|
-
return ret;
|
|
1167
|
-
},
|
|
1168
|
-
__wbg_length_ea16607d7b61445b: function(arg0) {
|
|
1169
|
-
const ret = arg0.length;
|
|
1170
|
-
return ret;
|
|
1171
|
-
},
|
|
1172
|
-
__wbg_new_5f486cdf45a04d78: function(arg0) {
|
|
1173
|
-
const ret = new Uint8Array(arg0);
|
|
1174
|
-
return ret;
|
|
1175
|
-
},
|
|
1176
|
-
__wbg_new_a70fbab9066b301f: function() {
|
|
1177
|
-
const ret = new Array();
|
|
1178
|
-
return ret;
|
|
1179
|
-
},
|
|
1180
|
-
__wbg_new_d15cb560a6a0e5f0: function(arg0, arg1) {
|
|
1181
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1182
|
-
return ret;
|
|
1183
|
-
},
|
|
1184
|
-
__wbg_new_from_slice_22da9388ac046e50: function(arg0, arg1) {
|
|
1185
|
-
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1186
|
-
return ret;
|
|
1187
|
-
},
|
|
1188
|
-
__wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
|
|
1189
|
-
try {
|
|
1190
|
-
var state0 = {a: arg0, b: arg1};
|
|
1191
|
-
var cb0 = (arg0, arg1) => {
|
|
1192
|
-
const a = state0.a;
|
|
1193
|
-
state0.a = 0;
|
|
1194
|
-
try {
|
|
1195
|
-
return __wasm_bindgen_func_elem_552_67(a, state0.b, arg0, arg1);
|
|
1196
|
-
} finally {
|
|
1197
|
-
state0.a = a;
|
|
1198
|
-
}
|
|
1199
|
-
};
|
|
1200
|
-
const ret = new Promise(cb0);
|
|
1201
|
-
return ret;
|
|
1202
|
-
} finally {
|
|
1203
|
-
state0.a = state0.b = 0;
|
|
1204
|
-
}
|
|
1205
|
-
},
|
|
1206
|
-
__wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
|
|
1207
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1208
|
-
},
|
|
1209
|
-
__wbg_push_e87b0e732085a946: function(arg0, arg1) {
|
|
1210
|
-
const ret = arg0.push(arg1);
|
|
1211
|
-
return ret;
|
|
1212
|
-
},
|
|
1213
|
-
__wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
|
|
1214
|
-
const ret = arg0.queueMicrotask;
|
|
1215
|
-
return ret;
|
|
1216
|
-
},
|
|
1217
|
-
__wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
|
|
1218
|
-
queueMicrotask(arg0);
|
|
1219
|
-
},
|
|
1220
|
-
__wbg_resolve_ae8d83246e5bcc12: function(arg0) {
|
|
1221
|
-
const ret = Promise.resolve(arg0);
|
|
1222
|
-
return ret;
|
|
1223
|
-
},
|
|
1224
|
-
__wbg_sedimentreeid_new: function(arg0) {
|
|
1225
|
-
const ret = SedimentreeId.__wrap(arg0);
|
|
1226
|
-
return ret;
|
|
1227
|
-
},
|
|
1228
|
-
__wbg_set_name_7ef37fe858379aaf: function(arg0, arg1, arg2) {
|
|
1229
|
-
arg0.name = getStringFromWasm0(arg1, arg2);
|
|
1230
|
-
},
|
|
1231
|
-
__wbg_signedfragment_unwrap: function(arg0) {
|
|
1232
|
-
const ret = SignedFragment.__unwrap(arg0);
|
|
1233
|
-
return ret;
|
|
1234
|
-
},
|
|
1235
|
-
__wbg_signedloosecommit_unwrap: function(arg0) {
|
|
1236
|
-
const ret = SignedLooseCommit.__unwrap(arg0);
|
|
1237
|
-
return ret;
|
|
1238
|
-
},
|
|
1239
|
-
__wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
|
|
1240
|
-
const ret = typeof global === 'undefined' ? null : global;
|
|
1241
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1242
|
-
},
|
|
1243
|
-
__wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
|
|
1244
|
-
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1245
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1246
|
-
},
|
|
1247
|
-
__wbg_static_accessor_SELF_f207c857566db248: function() {
|
|
1248
|
-
const ret = typeof self === 'undefined' ? null : self;
|
|
1249
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1250
|
-
},
|
|
1251
|
-
__wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
|
|
1252
|
-
const ret = typeof window === 'undefined' ? null : window;
|
|
1253
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1254
|
-
},
|
|
1255
|
-
__wbg_then_098abe61755d12f6: function(arg0, arg1) {
|
|
1256
|
-
const ret = arg0.then(arg1);
|
|
1257
|
-
return ret;
|
|
1258
|
-
},
|
|
1259
|
-
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1260
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 70, function: Function { arguments: [Externref], shim_idx: 132, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1261
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_385, __wasm_bindgen_func_elem_552);
|
|
1262
|
-
return ret;
|
|
1263
|
-
},
|
|
1264
|
-
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
1265
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
1266
|
-
const ret = arg0;
|
|
1267
|
-
return ret;
|
|
1268
|
-
},
|
|
1269
|
-
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1270
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1271
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
1272
|
-
return ret;
|
|
1273
|
-
},
|
|
1274
|
-
__wbindgen_init_externref_table: function() {
|
|
1275
|
-
const table = wasm.__wbindgen_externrefs;
|
|
1276
|
-
const offset = table.grow(4);
|
|
1277
|
-
table.set(0, undefined);
|
|
1278
|
-
table.set(offset + 0, undefined);
|
|
1279
|
-
table.set(offset + 1, null);
|
|
1280
|
-
table.set(offset + 2, true);
|
|
1281
|
-
table.set(offset + 3, false);
|
|
1282
|
-
},
|
|
1283
|
-
};
|
|
1284
|
-
return {
|
|
1285
|
-
__proto__: null,
|
|
1286
|
-
"./sedimentree_wasm_bg.js": import0,
|
|
1287
|
-
};
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
function __wasm_bindgen_func_elem_552(arg0, arg1, arg2) {
|
|
1291
|
-
const ret = wasm.__wasm_bindgen_func_elem_552(arg0, arg1, arg2);
|
|
1292
|
-
if (ret[1]) {
|
|
1293
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
function __wasm_bindgen_func_elem_552_67(arg0, arg1, arg2, arg3) {
|
|
1298
|
-
wasm.__wasm_bindgen_func_elem_552_67(arg0, arg1, arg2, arg3);
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
const MemoryStorageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1302
|
-
? { register: () => {}, unregister: () => {} }
|
|
1303
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_memorystorage_free(ptr >>> 0, 1));
|
|
1304
|
-
const BlobMetaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1305
|
-
? { register: () => {}, unregister: () => {} }
|
|
1306
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_blobmeta_free(ptr >>> 0, 1));
|
|
1307
|
-
const CommitWithBlobFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1308
|
-
? { register: () => {}, unregister: () => {} }
|
|
1309
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_commitwithblob_free(ptr >>> 0, 1));
|
|
1310
|
-
const DepthFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1311
|
-
? { register: () => {}, unregister: () => {} }
|
|
1312
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_depth_free(ptr >>> 0, 1));
|
|
1313
|
-
const DigestFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1314
|
-
? { register: () => {}, unregister: () => {} }
|
|
1315
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_digest_free(ptr >>> 0, 1));
|
|
1316
|
-
const FragmentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1317
|
-
? { register: () => {}, unregister: () => {} }
|
|
1318
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_fragment_free(ptr >>> 0, 1));
|
|
1319
|
-
const FragmentWithBlobFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1320
|
-
? { register: () => {}, unregister: () => {} }
|
|
1321
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_fragmentwithblob_free(ptr >>> 0, 1));
|
|
1322
|
-
const FragmentsArrayFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1323
|
-
? { register: () => {}, unregister: () => {} }
|
|
1324
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_fragmentsarray_free(ptr >>> 0, 1));
|
|
1325
|
-
const LooseCommitFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1326
|
-
? { register: () => {}, unregister: () => {} }
|
|
1327
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_loosecommit_free(ptr >>> 0, 1));
|
|
1328
|
-
const SedimentreeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1329
|
-
? { register: () => {}, unregister: () => {} }
|
|
1330
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_sedimentree_free(ptr >>> 0, 1));
|
|
1331
|
-
const SedimentreeIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1332
|
-
? { register: () => {}, unregister: () => {} }
|
|
1333
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_sedimentreeid_free(ptr >>> 0, 1));
|
|
1334
|
-
const SedimentreeIdsArrayFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1335
|
-
? { register: () => {}, unregister: () => {} }
|
|
1336
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_sedimentreeidsarray_free(ptr >>> 0, 1));
|
|
1337
|
-
const SignedFragmentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1338
|
-
? { register: () => {}, unregister: () => {} }
|
|
1339
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_signedfragment_free(ptr >>> 0, 1));
|
|
1340
|
-
const SignedLooseCommitFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1341
|
-
? { register: () => {}, unregister: () => {} }
|
|
1342
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_signedloosecommit_free(ptr >>> 0, 1));
|
|
1343
|
-
|
|
1344
|
-
function addToExternrefTable0(obj) {
|
|
1345
|
-
const idx = wasm.__wbindgen_export4();
|
|
1346
|
-
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
1347
|
-
return idx;
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
function _assertClass(instance, klass) {
|
|
1351
|
-
if (!(instance instanceof klass)) {
|
|
1352
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
1357
|
-
? { register: () => {}, unregister: () => {} }
|
|
1358
|
-
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
1359
|
-
|
|
1360
|
-
function debugString(val) {
|
|
1361
|
-
// primitive types
|
|
1362
|
-
const type = typeof val;
|
|
1363
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1364
|
-
return `${val}`;
|
|
1365
|
-
}
|
|
1366
|
-
if (type == 'string') {
|
|
1367
|
-
return `"${val}"`;
|
|
1368
|
-
}
|
|
1369
|
-
if (type == 'symbol') {
|
|
1370
|
-
const description = val.description;
|
|
1371
|
-
if (description == null) {
|
|
1372
|
-
return 'Symbol';
|
|
1373
|
-
} else {
|
|
1374
|
-
return `Symbol(${description})`;
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
if (type == 'function') {
|
|
1378
|
-
const name = val.name;
|
|
1379
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
1380
|
-
return `Function(${name})`;
|
|
1381
|
-
} else {
|
|
1382
|
-
return 'Function';
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
// objects
|
|
1386
|
-
if (Array.isArray(val)) {
|
|
1387
|
-
const length = val.length;
|
|
1388
|
-
let debug = '[';
|
|
1389
|
-
if (length > 0) {
|
|
1390
|
-
debug += debugString(val[0]);
|
|
1391
|
-
}
|
|
1392
|
-
for(let i = 1; i < length; i++) {
|
|
1393
|
-
debug += ', ' + debugString(val[i]);
|
|
1394
|
-
}
|
|
1395
|
-
debug += ']';
|
|
1396
|
-
return debug;
|
|
1397
|
-
}
|
|
1398
|
-
// Test for built-in
|
|
1399
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1400
|
-
let className;
|
|
1401
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
1402
|
-
className = builtInMatches[1];
|
|
1403
|
-
} else {
|
|
1404
|
-
// Failed to match the standard '[object ClassName]'
|
|
1405
|
-
return toString.call(val);
|
|
1406
|
-
}
|
|
1407
|
-
if (className == 'Object') {
|
|
1408
|
-
// we're a user defined class or Object
|
|
1409
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1410
|
-
// easier than looping through ownProperties of `val`.
|
|
1411
|
-
try {
|
|
1412
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
1413
|
-
} catch (_) {
|
|
1414
|
-
return 'Object';
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
// errors
|
|
1418
|
-
if (val instanceof Error) {
|
|
1419
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1420
|
-
}
|
|
1421
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1422
|
-
return className;
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1426
|
-
ptr = ptr >>> 0;
|
|
1427
|
-
const mem = getDataViewMemory0();
|
|
1428
|
-
const result = [];
|
|
1429
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1430
|
-
result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
|
|
1431
|
-
}
|
|
1432
|
-
wasm.__wbindgen_export7(ptr, len);
|
|
1433
|
-
return result;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
1437
|
-
ptr = ptr >>> 0;
|
|
1438
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
let cachedDataViewMemory0 = null;
|
|
1442
|
-
function getDataViewMemory0() {
|
|
1443
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1444
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1445
|
-
}
|
|
1446
|
-
return cachedDataViewMemory0;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
function getStringFromWasm0(ptr, len) {
|
|
1450
|
-
ptr = ptr >>> 0;
|
|
1451
|
-
return decodeText(ptr, len);
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
let cachedUint8ArrayMemory0 = null;
|
|
1455
|
-
function getUint8ArrayMemory0() {
|
|
1456
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1457
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1458
|
-
}
|
|
1459
|
-
return cachedUint8ArrayMemory0;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
function handleError(f, args) {
|
|
1463
|
-
try {
|
|
1464
|
-
return f.apply(this, args);
|
|
1465
|
-
} catch (e) {
|
|
1466
|
-
const idx = addToExternrefTable0(e);
|
|
1467
|
-
wasm.__wbindgen_export3(idx);
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
function isLikeNone(x) {
|
|
1472
|
-
return x === undefined || x === null;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
1476
|
-
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
1477
|
-
const real = (...args) => {
|
|
1478
|
-
|
|
1479
|
-
// First up with a closure we increment the internal reference
|
|
1480
|
-
// count. This ensures that the Rust closure environment won't
|
|
1481
|
-
// be deallocated while we're invoking it.
|
|
1482
|
-
state.cnt++;
|
|
1483
|
-
const a = state.a;
|
|
1484
|
-
state.a = 0;
|
|
1485
|
-
try {
|
|
1486
|
-
return f(a, state.b, ...args);
|
|
1487
|
-
} finally {
|
|
1488
|
-
state.a = a;
|
|
1489
|
-
real._wbg_cb_unref();
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
real._wbg_cb_unref = () => {
|
|
1493
|
-
if (--state.cnt === 0) {
|
|
1494
|
-
state.dtor(state.a, state.b);
|
|
1495
|
-
state.a = 0;
|
|
1496
|
-
CLOSURE_DTORS.unregister(state);
|
|
1497
|
-
}
|
|
1498
|
-
};
|
|
1499
|
-
CLOSURE_DTORS.register(real, state, state);
|
|
1500
|
-
return real;
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
1504
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1505
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1506
|
-
WASM_VECTOR_LEN = arg.length;
|
|
1507
|
-
return ptr;
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
1511
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
1512
|
-
for (let i = 0; i < array.length; i++) {
|
|
1513
|
-
const add = addToExternrefTable0(array[i]);
|
|
1514
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
1515
|
-
}
|
|
1516
|
-
WASM_VECTOR_LEN = array.length;
|
|
1517
|
-
return ptr;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
1521
|
-
if (realloc === undefined) {
|
|
1522
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
1523
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1524
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1525
|
-
WASM_VECTOR_LEN = buf.length;
|
|
1526
|
-
return ptr;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
let len = arg.length;
|
|
1530
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
1531
|
-
|
|
1532
|
-
const mem = getUint8ArrayMemory0();
|
|
1533
|
-
|
|
1534
|
-
let offset = 0;
|
|
1535
|
-
|
|
1536
|
-
for (; offset < len; offset++) {
|
|
1537
|
-
const code = arg.charCodeAt(offset);
|
|
1538
|
-
if (code > 0x7F) break;
|
|
1539
|
-
mem[ptr + offset] = code;
|
|
1540
|
-
}
|
|
1541
|
-
if (offset !== len) {
|
|
1542
|
-
if (offset !== 0) {
|
|
1543
|
-
arg = arg.slice(offset);
|
|
1544
|
-
}
|
|
1545
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1546
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1547
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1548
|
-
|
|
1549
|
-
offset += ret.written;
|
|
1550
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
WASM_VECTOR_LEN = offset;
|
|
1554
|
-
return ptr;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
function takeFromExternrefTable0(idx) {
|
|
1558
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1559
|
-
wasm.__wbindgen_export5(idx);
|
|
1560
|
-
return value;
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1564
|
-
cachedTextDecoder.decode();
|
|
1565
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1566
|
-
let numBytesDecoded = 0;
|
|
1567
|
-
function decodeText(ptr, len) {
|
|
1568
|
-
numBytesDecoded += len;
|
|
1569
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1570
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1571
|
-
cachedTextDecoder.decode();
|
|
1572
|
-
numBytesDecoded = len;
|
|
1573
|
-
}
|
|
1574
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
const cachedTextEncoder = new TextEncoder();
|
|
1578
|
-
|
|
1579
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1580
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1581
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
1582
|
-
view.set(buf);
|
|
1583
|
-
return {
|
|
1584
|
-
read: arg.length,
|
|
1585
|
-
written: buf.length
|
|
1586
|
-
};
|
|
1587
|
-
};
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
let WASM_VECTOR_LEN = 0;
|
|
1591
|
-
|
|
1592
|
-
let wasmModule, wasm;
|
|
1593
|
-
function __wbg_finalize_init(instance, module) {
|
|
1594
|
-
wasm = instance.exports;
|
|
1595
|
-
wasmModule = module;
|
|
1596
|
-
cachedDataViewMemory0 = null;
|
|
1597
|
-
cachedUint8ArrayMemory0 = null;
|
|
1598
|
-
wasm.__wbindgen_start();
|
|
1599
|
-
return wasm;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
async function __wbg_load(module, imports) {
|
|
1603
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
1604
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1605
|
-
try {
|
|
1606
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1607
|
-
} catch (e) {
|
|
1608
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1609
|
-
|
|
1610
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1611
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1612
|
-
|
|
1613
|
-
} else { throw e; }
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
const bytes = await module.arrayBuffer();
|
|
1618
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
1619
|
-
} else {
|
|
1620
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
1621
|
-
|
|
1622
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
1623
|
-
return { instance, module };
|
|
1624
|
-
} else {
|
|
1625
|
-
return instance;
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
function expectedResponseType(type) {
|
|
1630
|
-
switch (type) {
|
|
1631
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
1632
|
-
}
|
|
1633
|
-
return false;
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
function initSync(module) {
|
|
1638
|
-
if (wasm !== undefined) return wasm;
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
if (module !== undefined) {
|
|
1642
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1643
|
-
({module} = module)
|
|
1644
|
-
} else {
|
|
1645
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
const imports = __wbg_get_imports();
|
|
1650
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
1651
|
-
module = new WebAssembly.Module(module);
|
|
1652
|
-
}
|
|
1653
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
1654
|
-
return __wbg_finalize_init(instance, module);
|
|
1655
|
-
}
|
|
1656
|
-
|
|
1657
|
-
async function __wbg_init(module_or_path) {
|
|
1658
|
-
if (wasm !== undefined) return wasm;
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
if (module_or_path !== undefined) {
|
|
1662
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1663
|
-
({module_or_path} = module_or_path)
|
|
1664
|
-
} else {
|
|
1665
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
if (module_or_path === undefined) {
|
|
1670
|
-
module_or_path = new /* @vite-ignore */ URL('sedimentree_wasm_bg.wasm', import.meta.url);
|
|
1671
|
-
}
|
|
1672
|
-
const imports = __wbg_get_imports();
|
|
1673
|
-
|
|
1674
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1675
|
-
module_or_path = fetch(module_or_path);
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1679
|
-
|
|
1680
|
-
return __wbg_finalize_init(instance, module);
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
export { initSync, __wbg_init as default };
|
|
1684
|
-
|
|
1685
|
-
export function __wbg_set_wasm(val) { wasm = val; }
|