hermes-wasm 1.0.2 → 1.0.4
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/hermes_wasm.d.ts +36 -15
- package/hermes_wasm.js +59 -35
- package/hermes_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/hermes_wasm.d.ts
CHANGED
|
@@ -74,6 +74,17 @@ export class IpfsIndex {
|
|
|
74
74
|
* Load cache from IndexedDB
|
|
75
75
|
*/
|
|
76
76
|
load_cache_from_idb(): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Load index with IndexedDB cache pre-loaded
|
|
79
|
+
*
|
|
80
|
+
* This method first loads any cached data from IndexedDB, then opens the index.
|
|
81
|
+
* This allows previously cached slices to be used during index loading,
|
|
82
|
+
* reducing network requests on page refresh.
|
|
83
|
+
*
|
|
84
|
+
* @param fetch_fn - JS function: (path: string) => Promise<Uint8Array>
|
|
85
|
+
* @param size_fn - JS function: (path: string) => Promise<number>
|
|
86
|
+
*/
|
|
87
|
+
load_with_idb_cache(fetch_fn: Function, size_fn: Function): Promise<void>;
|
|
77
88
|
/**
|
|
78
89
|
* Get network statistics
|
|
79
90
|
*/
|
|
@@ -169,6 +180,14 @@ export class RemoteIndex {
|
|
|
169
180
|
* Call this after load() to restore cached data from a previous session.
|
|
170
181
|
*/
|
|
171
182
|
load_cache_from_idb(): Promise<boolean>;
|
|
183
|
+
/**
|
|
184
|
+
* Load index with IndexedDB cache pre-loaded
|
|
185
|
+
*
|
|
186
|
+
* This method first loads any cached data from IndexedDB, then opens the index.
|
|
187
|
+
* This allows previously cached slices to be used during index loading,
|
|
188
|
+
* reducing network requests on page refresh.
|
|
189
|
+
*/
|
|
190
|
+
load_with_idb_cache(): Promise<void>;
|
|
172
191
|
/**
|
|
173
192
|
* Get network statistics (requests made, bytes transferred, etc.)
|
|
174
193
|
*/
|
|
@@ -237,6 +256,7 @@ export interface InitOutput {
|
|
|
237
256
|
readonly ipfsindex_import_cache: (a: number, b: number, c: number) => [number, number];
|
|
238
257
|
readonly ipfsindex_load: (a: number, b: any, c: any) => any;
|
|
239
258
|
readonly ipfsindex_load_cache_from_idb: (a: number) => any;
|
|
259
|
+
readonly ipfsindex_load_with_idb_cache: (a: number, b: any, c: any) => any;
|
|
240
260
|
readonly ipfsindex_network_stats: (a: number) => any;
|
|
241
261
|
readonly ipfsindex_new: (a: number, b: number) => number;
|
|
242
262
|
readonly ipfsindex_num_docs: (a: number) => number;
|
|
@@ -246,6 +266,14 @@ export interface InitOutput {
|
|
|
246
266
|
readonly ipfsindex_search: (a: number, b: number, c: number, d: number) => any;
|
|
247
267
|
readonly ipfsindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
248
268
|
readonly ipfsindex_with_cache_size: (a: number, b: number, c: number) => number;
|
|
269
|
+
readonly __wbg_indexregistry_free: (a: number, b: number) => void;
|
|
270
|
+
readonly indexregistry_add_remote: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
271
|
+
readonly indexregistry_list: (a: number) => any;
|
|
272
|
+
readonly indexregistry_new: () => number;
|
|
273
|
+
readonly indexregistry_remove: (a: number, b: number, c: number) => void;
|
|
274
|
+
readonly indexregistry_search: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
275
|
+
readonly init: () => void;
|
|
276
|
+
readonly setup_logging: () => void;
|
|
249
277
|
readonly __wbg_remoteindex_free: (a: number, b: number) => void;
|
|
250
278
|
readonly remoteindex_cache_stats: (a: number) => any;
|
|
251
279
|
readonly remoteindex_clear_idb_cache: (a: number) => any;
|
|
@@ -256,6 +284,7 @@ export interface InitOutput {
|
|
|
256
284
|
readonly remoteindex_import_cache: (a: number, b: number, c: number) => [number, number];
|
|
257
285
|
readonly remoteindex_load: (a: number) => any;
|
|
258
286
|
readonly remoteindex_load_cache_from_idb: (a: number) => any;
|
|
287
|
+
readonly remoteindex_load_with_idb_cache: (a: number) => any;
|
|
259
288
|
readonly remoteindex_network_stats: (a: number) => any;
|
|
260
289
|
readonly remoteindex_new: (a: number, b: number) => number;
|
|
261
290
|
readonly remoteindex_num_docs: (a: number) => number;
|
|
@@ -265,14 +294,6 @@ export interface InitOutput {
|
|
|
265
294
|
readonly remoteindex_search: (a: number, b: number, c: number, d: number) => any;
|
|
266
295
|
readonly remoteindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
267
296
|
readonly remoteindex_with_cache_size: (a: number, b: number, c: number) => number;
|
|
268
|
-
readonly __wbg_indexregistry_free: (a: number, b: number) => void;
|
|
269
|
-
readonly indexregistry_add_remote: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
270
|
-
readonly indexregistry_list: (a: number) => any;
|
|
271
|
-
readonly indexregistry_new: () => number;
|
|
272
|
-
readonly indexregistry_remove: (a: number, b: number, c: number) => void;
|
|
273
|
-
readonly indexregistry_search: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
274
|
-
readonly init: () => void;
|
|
275
|
-
readonly setup_logging: () => void;
|
|
276
297
|
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
277
298
|
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
278
299
|
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
@@ -281,13 +302,13 @@ export interface InitOutput {
|
|
|
281
302
|
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
282
303
|
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
283
304
|
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
284
|
-
readonly
|
|
285
|
-
readonly
|
|
286
|
-
readonly
|
|
287
|
-
readonly
|
|
288
|
-
readonly
|
|
289
|
-
readonly
|
|
290
|
-
readonly
|
|
305
|
+
readonly wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut__web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______: (a: number, b: number) => void;
|
|
306
|
+
readonly wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
307
|
+
readonly wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut__wasm_bindgen_9620576bde3df5d6___JsValue____Output_______: (a: number, b: number) => void;
|
|
308
|
+
readonly wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue__wasm_bindgen_9620576bde3df5d6___JsValue_____: (a: number, b: number, c: any, d: any) => void;
|
|
309
|
+
readonly wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____: (a: number, b: number, c: any) => void;
|
|
310
|
+
readonly wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue_____: (a: number, b: number, c: any) => void;
|
|
311
|
+
readonly wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke______: (a: number, b: number) => void;
|
|
291
312
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
292
313
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
293
314
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/hermes_wasm.js
CHANGED
|
@@ -183,6 +183,23 @@ export class IpfsIndex {
|
|
|
183
183
|
const ret = wasm.ipfsindex_load_cache_from_idb(this.__wbg_ptr);
|
|
184
184
|
return ret;
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Load index with IndexedDB cache pre-loaded
|
|
188
|
+
*
|
|
189
|
+
* This method first loads any cached data from IndexedDB, then opens the index.
|
|
190
|
+
* This allows previously cached slices to be used during index loading,
|
|
191
|
+
* reducing network requests on page refresh.
|
|
192
|
+
*
|
|
193
|
+
* @param fetch_fn - JS function: (path: string) => Promise<Uint8Array>
|
|
194
|
+
* @param size_fn - JS function: (path: string) => Promise<number>
|
|
195
|
+
* @param {Function} fetch_fn
|
|
196
|
+
* @param {Function} size_fn
|
|
197
|
+
* @returns {Promise<void>}
|
|
198
|
+
*/
|
|
199
|
+
load_with_idb_cache(fetch_fn, size_fn) {
|
|
200
|
+
const ret = wasm.ipfsindex_load_with_idb_cache(this.__wbg_ptr, fetch_fn, size_fn);
|
|
201
|
+
return ret;
|
|
202
|
+
}
|
|
186
203
|
/**
|
|
187
204
|
* Get network statistics
|
|
188
205
|
* @returns {any}
|
|
@@ -394,6 +411,18 @@ export class RemoteIndex {
|
|
|
394
411
|
const ret = wasm.remoteindex_load_cache_from_idb(this.__wbg_ptr);
|
|
395
412
|
return ret;
|
|
396
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Load index with IndexedDB cache pre-loaded
|
|
416
|
+
*
|
|
417
|
+
* This method first loads any cached data from IndexedDB, then opens the index.
|
|
418
|
+
* This allows previously cached slices to be used during index loading,
|
|
419
|
+
* reducing network requests on page refresh.
|
|
420
|
+
* @returns {Promise<void>}
|
|
421
|
+
*/
|
|
422
|
+
load_with_idb_cache() {
|
|
423
|
+
const ret = wasm.remoteindex_load_with_idb_cache(this.__wbg_ptr);
|
|
424
|
+
return ret;
|
|
425
|
+
}
|
|
397
426
|
/**
|
|
398
427
|
* Get network statistics (requests made, bytes transferred, etc.)
|
|
399
428
|
* @returns {any}
|
|
@@ -533,11 +562,6 @@ function __wbg_get_imports() {
|
|
|
533
562
|
const ret = arg0 === null;
|
|
534
563
|
return ret;
|
|
535
564
|
},
|
|
536
|
-
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
537
|
-
const val = arg0;
|
|
538
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
539
|
-
return ret;
|
|
540
|
-
},
|
|
541
565
|
__wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
|
|
542
566
|
const ret = typeof(arg0) === 'string';
|
|
543
567
|
return ret;
|
|
@@ -591,7 +615,7 @@ function __wbg_get_imports() {
|
|
|
591
615
|
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
592
616
|
return ret;
|
|
593
617
|
}, arguments); },
|
|
594
|
-
|
|
618
|
+
__wbg_clearTimeout_3b5c565a5ec539dd: function(arg0) {
|
|
595
619
|
const ret = clearTimeout(arg0);
|
|
596
620
|
return ret;
|
|
597
621
|
},
|
|
@@ -614,6 +638,10 @@ function __wbg_get_imports() {
|
|
|
614
638
|
const ret = arg0.done;
|
|
615
639
|
return ret;
|
|
616
640
|
},
|
|
641
|
+
__wbg_entries_04679661ea6e74fc: function(arg0) {
|
|
642
|
+
const ret = arg0.entries();
|
|
643
|
+
return ret;
|
|
644
|
+
},
|
|
617
645
|
__wbg_error_7534b8e9a36f1ab4: function(arg0, arg1) {
|
|
618
646
|
let deferred0_0;
|
|
619
647
|
let deferred0_1;
|
|
@@ -628,7 +656,7 @@ function __wbg_get_imports() {
|
|
|
628
656
|
__wbg_error_9a7fe3f932034cde: function(arg0) {
|
|
629
657
|
console.error(arg0);
|
|
630
658
|
},
|
|
631
|
-
|
|
659
|
+
__wbg_fetch_16dcf1cfbbc66b3c: function(arg0) {
|
|
632
660
|
const ret = fetch(arg0);
|
|
633
661
|
return ret;
|
|
634
662
|
},
|
|
@@ -644,6 +672,10 @@ function __wbg_get_imports() {
|
|
|
644
672
|
const ret = arg0.get(arg1);
|
|
645
673
|
return ret;
|
|
646
674
|
}, arguments); },
|
|
675
|
+
__wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
|
|
676
|
+
const ret = arg0[arg1 >>> 0];
|
|
677
|
+
return ret;
|
|
678
|
+
},
|
|
647
679
|
__wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
|
|
648
680
|
const ret = Reflect.get(arg0, arg1);
|
|
649
681
|
return ret;
|
|
@@ -723,8 +755,8 @@ function __wbg_get_imports() {
|
|
|
723
755
|
const ret = result;
|
|
724
756
|
return ret;
|
|
725
757
|
},
|
|
726
|
-
|
|
727
|
-
const ret =
|
|
758
|
+
__wbg_isArray_d314bb98fcf08331: function(arg0) {
|
|
759
|
+
const ret = Array.isArray(arg0);
|
|
728
760
|
return ret;
|
|
729
761
|
},
|
|
730
762
|
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
@@ -757,7 +789,7 @@ function __wbg_get_imports() {
|
|
|
757
789
|
const a = state0.a;
|
|
758
790
|
state0.a = 0;
|
|
759
791
|
try {
|
|
760
|
-
return
|
|
792
|
+
return wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue__wasm_bindgen_9620576bde3df5d6___JsValue_____(a, state0.b, arg0, arg1);
|
|
761
793
|
} finally {
|
|
762
794
|
state0.a = a;
|
|
763
795
|
}
|
|
@@ -796,10 +828,6 @@ function __wbg_get_imports() {
|
|
|
796
828
|
const ret = arg0.next();
|
|
797
829
|
return ret;
|
|
798
830
|
}, arguments); },
|
|
799
|
-
__wbg_next_418f80d8f5303233: function(arg0) {
|
|
800
|
-
const ret = arg0.next;
|
|
801
|
-
return ret;
|
|
802
|
-
},
|
|
803
831
|
__wbg_now_ebffdf7e580f210d: function(arg0) {
|
|
804
832
|
const ret = arg0.now();
|
|
805
833
|
return ret;
|
|
@@ -842,7 +870,7 @@ function __wbg_get_imports() {
|
|
|
842
870
|
const ret = arg0.result;
|
|
843
871
|
return ret;
|
|
844
872
|
}, arguments); },
|
|
845
|
-
|
|
873
|
+
__wbg_setTimeout_cb2a856ba8315e7a: function(arg0, arg1) {
|
|
846
874
|
const ret = setTimeout(arg0, arg1);
|
|
847
875
|
return ret;
|
|
848
876
|
},
|
|
@@ -920,10 +948,6 @@ function __wbg_get_imports() {
|
|
|
920
948
|
const ret = arg0.status;
|
|
921
949
|
return ret;
|
|
922
950
|
},
|
|
923
|
-
__wbg_stringify_8d1cc6ff383e8bae: function() { return handleError(function (arg0) {
|
|
924
|
-
const ret = JSON.stringify(arg0);
|
|
925
|
-
return ret;
|
|
926
|
-
}, arguments); },
|
|
927
951
|
__wbg_target_521be630ab05b11e: function(arg0) {
|
|
928
952
|
const ret = arg0.target;
|
|
929
953
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -959,23 +983,23 @@ function __wbg_get_imports() {
|
|
|
959
983
|
console.warn(arg0);
|
|
960
984
|
},
|
|
961
985
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
962
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
963
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
986
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 197, function: Function { arguments: [NamedExternref("Event")], shim_idx: 198, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
987
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut__web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____);
|
|
964
988
|
return ret;
|
|
965
989
|
},
|
|
966
990
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
967
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
968
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
991
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 197, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 198, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
992
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut__web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____);
|
|
969
993
|
return ret;
|
|
970
994
|
},
|
|
971
995
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
972
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
973
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
996
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 416, function: Function { arguments: [], shim_idx: 417, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
997
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut_____Output_______, wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke______);
|
|
974
998
|
return ret;
|
|
975
999
|
},
|
|
976
1000
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
977
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
978
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1001
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 453, function: Function { arguments: [Externref], shim_idx: 454, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1002
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_9620576bde3df5d6___closure__destroy___dyn_core_a637aa3d115f5170___ops__function__FnMut__wasm_bindgen_9620576bde3df5d6___JsValue____Output_______, wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue_____);
|
|
979
1003
|
return ret;
|
|
980
1004
|
},
|
|
981
1005
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -1014,20 +1038,20 @@ function __wbg_get_imports() {
|
|
|
1014
1038
|
};
|
|
1015
1039
|
}
|
|
1016
1040
|
|
|
1017
|
-
function
|
|
1018
|
-
wasm.
|
|
1041
|
+
function wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke______(arg0, arg1) {
|
|
1042
|
+
wasm.wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke______(arg0, arg1);
|
|
1019
1043
|
}
|
|
1020
1044
|
|
|
1021
|
-
function
|
|
1022
|
-
wasm.
|
|
1045
|
+
function wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____(arg0, arg1, arg2) {
|
|
1046
|
+
wasm.wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___web_sys_4f108ac1dfcf3659___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____(arg0, arg1, arg2);
|
|
1023
1047
|
}
|
|
1024
1048
|
|
|
1025
|
-
function
|
|
1026
|
-
wasm.
|
|
1049
|
+
function wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue_____(arg0, arg1, arg2) {
|
|
1050
|
+
wasm.wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue_____(arg0, arg1, arg2);
|
|
1027
1051
|
}
|
|
1028
1052
|
|
|
1029
|
-
function
|
|
1030
|
-
wasm.
|
|
1053
|
+
function wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue__wasm_bindgen_9620576bde3df5d6___JsValue_____(arg0, arg1, arg2, arg3) {
|
|
1054
|
+
wasm.wasm_bindgen_9620576bde3df5d6___convert__closures_____invoke___wasm_bindgen_9620576bde3df5d6___JsValue__wasm_bindgen_9620576bde3df5d6___JsValue_____(arg0, arg1, arg2, arg3);
|
|
1031
1055
|
}
|
|
1032
1056
|
|
|
1033
1057
|
|
package/hermes_wasm_bg.wasm
CHANGED
|
Binary file
|