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