hermes-wasm 1.0.0 → 1.0.2
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 +33 -13
- package/hermes_wasm.js +61 -17
- package/hermes_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/hermes_wasm.d.ts
CHANGED
|
@@ -74,6 +74,10 @@ export class IpfsIndex {
|
|
|
74
74
|
* Load cache from IndexedDB
|
|
75
75
|
*/
|
|
76
76
|
load_cache_from_idb(): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Get network statistics
|
|
79
|
+
*/
|
|
80
|
+
network_stats(): any;
|
|
77
81
|
/**
|
|
78
82
|
* Create a new IPFS index
|
|
79
83
|
*
|
|
@@ -88,6 +92,10 @@ export class IpfsIndex {
|
|
|
88
92
|
* Get number of segments
|
|
89
93
|
*/
|
|
90
94
|
num_segments(): number;
|
|
95
|
+
/**
|
|
96
|
+
* Reset network statistics
|
|
97
|
+
*/
|
|
98
|
+
reset_network_stats(): void;
|
|
91
99
|
/**
|
|
92
100
|
* Save cache to IndexedDB
|
|
93
101
|
*/
|
|
@@ -96,6 +104,10 @@ export class IpfsIndex {
|
|
|
96
104
|
* Search the index
|
|
97
105
|
*/
|
|
98
106
|
search(query_str: string, limit: number): Promise<any>;
|
|
107
|
+
/**
|
|
108
|
+
* Search the index with offset for pagination
|
|
109
|
+
*/
|
|
110
|
+
search_offset(query_str: string, limit: number, offset: number): Promise<any>;
|
|
99
111
|
/**
|
|
100
112
|
* Create with custom cache size
|
|
101
113
|
*/
|
|
@@ -191,6 +203,10 @@ export class RemoteIndex {
|
|
|
191
203
|
* Returns document addresses (segment_id + doc_id) without document content.
|
|
192
204
|
*/
|
|
193
205
|
search(query_str: string, limit: number): Promise<any>;
|
|
206
|
+
/**
|
|
207
|
+
* Search with offset for pagination
|
|
208
|
+
*/
|
|
209
|
+
search_offset(query_str: string, limit: number, offset: number): Promise<any>;
|
|
194
210
|
/**
|
|
195
211
|
* Create with custom cache size (in bytes)
|
|
196
212
|
*/
|
|
@@ -221,19 +237,16 @@ export interface InitOutput {
|
|
|
221
237
|
readonly ipfsindex_import_cache: (a: number, b: number, c: number) => [number, number];
|
|
222
238
|
readonly ipfsindex_load: (a: number, b: any, c: any) => any;
|
|
223
239
|
readonly ipfsindex_load_cache_from_idb: (a: number) => any;
|
|
240
|
+
readonly ipfsindex_network_stats: (a: number) => any;
|
|
224
241
|
readonly ipfsindex_new: (a: number, b: number) => number;
|
|
225
242
|
readonly ipfsindex_num_docs: (a: number) => number;
|
|
226
243
|
readonly ipfsindex_num_segments: (a: number) => number;
|
|
244
|
+
readonly ipfsindex_reset_network_stats: (a: number) => void;
|
|
227
245
|
readonly ipfsindex_save_cache_to_idb: (a: number) => any;
|
|
228
246
|
readonly ipfsindex_search: (a: number, b: number, c: number, d: number) => any;
|
|
247
|
+
readonly ipfsindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
229
248
|
readonly ipfsindex_with_cache_size: (a: number, b: number, c: number) => number;
|
|
230
|
-
readonly __wbg_indexregistry_free: (a: number, b: number) => void;
|
|
231
249
|
readonly __wbg_remoteindex_free: (a: number, b: number) => void;
|
|
232
|
-
readonly indexregistry_add_remote: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
233
|
-
readonly indexregistry_list: (a: number) => any;
|
|
234
|
-
readonly indexregistry_new: () => number;
|
|
235
|
-
readonly indexregistry_remove: (a: number, b: number, c: number) => void;
|
|
236
|
-
readonly indexregistry_search: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
237
250
|
readonly remoteindex_cache_stats: (a: number) => any;
|
|
238
251
|
readonly remoteindex_clear_idb_cache: (a: number) => any;
|
|
239
252
|
readonly remoteindex_default_fields: (a: number) => any;
|
|
@@ -250,7 +263,14 @@ export interface InitOutput {
|
|
|
250
263
|
readonly remoteindex_reset_network_stats: (a: number) => void;
|
|
251
264
|
readonly remoteindex_save_cache_to_idb: (a: number) => any;
|
|
252
265
|
readonly remoteindex_search: (a: number, b: number, c: number, d: number) => any;
|
|
266
|
+
readonly remoteindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
253
267
|
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;
|
|
254
274
|
readonly init: () => void;
|
|
255
275
|
readonly setup_logging: () => void;
|
|
256
276
|
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
@@ -261,13 +281,13 @@ export interface InitOutput {
|
|
|
261
281
|
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
262
282
|
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
263
283
|
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
264
|
-
readonly
|
|
265
|
-
readonly
|
|
266
|
-
readonly
|
|
267
|
-
readonly
|
|
268
|
-
readonly
|
|
269
|
-
readonly
|
|
270
|
-
readonly
|
|
284
|
+
readonly wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut__web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______: (a: number, b: number) => void;
|
|
285
|
+
readonly wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
286
|
+
readonly wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut__wasm_bindgen_a188ea924c18c4d1___JsValue____Output_______: (a: number, b: number) => void;
|
|
287
|
+
readonly wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue__wasm_bindgen_a188ea924c18c4d1___JsValue_____: (a: number, b: number, c: any, d: any) => void;
|
|
288
|
+
readonly wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____: (a: number, b: number, c: any) => void;
|
|
289
|
+
readonly wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue_____: (a: number, b: number, c: any) => void;
|
|
290
|
+
readonly wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke______: (a: number, b: number) => void;
|
|
271
291
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
272
292
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
273
293
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/hermes_wasm.js
CHANGED
|
@@ -183,6 +183,14 @@ export class IpfsIndex {
|
|
|
183
183
|
const ret = wasm.ipfsindex_load_cache_from_idb(this.__wbg_ptr);
|
|
184
184
|
return ret;
|
|
185
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Get network statistics
|
|
188
|
+
* @returns {any}
|
|
189
|
+
*/
|
|
190
|
+
network_stats() {
|
|
191
|
+
const ret = wasm.ipfsindex_network_stats(this.__wbg_ptr);
|
|
192
|
+
return ret;
|
|
193
|
+
}
|
|
186
194
|
/**
|
|
187
195
|
* Create a new IPFS index
|
|
188
196
|
*
|
|
@@ -213,6 +221,12 @@ export class IpfsIndex {
|
|
|
213
221
|
const ret = wasm.ipfsindex_num_segments(this.__wbg_ptr);
|
|
214
222
|
return ret >>> 0;
|
|
215
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* Reset network statistics
|
|
226
|
+
*/
|
|
227
|
+
reset_network_stats() {
|
|
228
|
+
wasm.ipfsindex_reset_network_stats(this.__wbg_ptr);
|
|
229
|
+
}
|
|
216
230
|
/**
|
|
217
231
|
* Save cache to IndexedDB
|
|
218
232
|
* @returns {Promise<void>}
|
|
@@ -233,6 +247,19 @@ export class IpfsIndex {
|
|
|
233
247
|
const ret = wasm.ipfsindex_search(this.__wbg_ptr, ptr0, len0, limit);
|
|
234
248
|
return ret;
|
|
235
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Search the index with offset for pagination
|
|
252
|
+
* @param {string} query_str
|
|
253
|
+
* @param {number} limit
|
|
254
|
+
* @param {number} offset
|
|
255
|
+
* @returns {Promise<any>}
|
|
256
|
+
*/
|
|
257
|
+
search_offset(query_str, limit, offset) {
|
|
258
|
+
const ptr0 = passStringToWasm0(query_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
259
|
+
const len0 = WASM_VECTOR_LEN;
|
|
260
|
+
const ret = wasm.ipfsindex_search_offset(this.__wbg_ptr, ptr0, len0, limit, offset);
|
|
261
|
+
return ret;
|
|
262
|
+
}
|
|
236
263
|
/**
|
|
237
264
|
* Create with custom cache size
|
|
238
265
|
* @param {string} base_path
|
|
@@ -435,6 +462,19 @@ export class RemoteIndex {
|
|
|
435
462
|
const ret = wasm.remoteindex_search(this.__wbg_ptr, ptr0, len0, limit);
|
|
436
463
|
return ret;
|
|
437
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Search with offset for pagination
|
|
467
|
+
* @param {string} query_str
|
|
468
|
+
* @param {number} limit
|
|
469
|
+
* @param {number} offset
|
|
470
|
+
* @returns {Promise<any>}
|
|
471
|
+
*/
|
|
472
|
+
search_offset(query_str, limit, offset) {
|
|
473
|
+
const ptr0 = passStringToWasm0(query_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
475
|
+
const ret = wasm.remoteindex_search_offset(this.__wbg_ptr, ptr0, len0, limit, offset);
|
|
476
|
+
return ret;
|
|
477
|
+
}
|
|
438
478
|
/**
|
|
439
479
|
* Create with custom cache size (in bytes)
|
|
440
480
|
* @param {string} base_url
|
|
@@ -547,6 +587,10 @@ function __wbg_get_imports() {
|
|
|
547
587
|
const ret = arg0.call(arg1, arg2);
|
|
548
588
|
return ret;
|
|
549
589
|
}, arguments); },
|
|
590
|
+
__wbg_call_e8c868596c950cf6: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
591
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
592
|
+
return ret;
|
|
593
|
+
}, arguments); },
|
|
550
594
|
__wbg_clearTimeout_42d9ccd50822fd3a: function(arg0) {
|
|
551
595
|
const ret = clearTimeout(arg0);
|
|
552
596
|
return ret;
|
|
@@ -713,7 +757,7 @@ function __wbg_get_imports() {
|
|
|
713
757
|
const a = state0.a;
|
|
714
758
|
state0.a = 0;
|
|
715
759
|
try {
|
|
716
|
-
return
|
|
760
|
+
return wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue__wasm_bindgen_a188ea924c18c4d1___JsValue_____(a, state0.b, arg0, arg1);
|
|
717
761
|
} finally {
|
|
718
762
|
state0.a = a;
|
|
719
763
|
}
|
|
@@ -915,23 +959,23 @@ function __wbg_get_imports() {
|
|
|
915
959
|
console.warn(arg0);
|
|
916
960
|
},
|
|
917
961
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
918
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
919
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
962
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 164, function: Function { arguments: [NamedExternref("Event")], shim_idx: 165, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
963
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut__web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____);
|
|
920
964
|
return ret;
|
|
921
965
|
},
|
|
922
966
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
923
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
924
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
967
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 164, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 165, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
968
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut__web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____);
|
|
925
969
|
return ret;
|
|
926
970
|
},
|
|
927
971
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
928
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
929
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
972
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 391, function: Function { arguments: [], shim_idx: 392, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
973
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut_____Output_______, wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke______);
|
|
930
974
|
return ret;
|
|
931
975
|
},
|
|
932
976
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
933
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
934
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
977
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 427, function: Function { arguments: [Externref], shim_idx: 428, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
978
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_a188ea924c18c4d1___closure__destroy___dyn_core_81e502cd214aeeaa___ops__function__FnMut__wasm_bindgen_a188ea924c18c4d1___JsValue____Output_______, wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue_____);
|
|
935
979
|
return ret;
|
|
936
980
|
},
|
|
937
981
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -970,20 +1014,20 @@ function __wbg_get_imports() {
|
|
|
970
1014
|
};
|
|
971
1015
|
}
|
|
972
1016
|
|
|
973
|
-
function
|
|
974
|
-
wasm.
|
|
1017
|
+
function wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke______(arg0, arg1) {
|
|
1018
|
+
wasm.wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke______(arg0, arg1);
|
|
975
1019
|
}
|
|
976
1020
|
|
|
977
|
-
function
|
|
978
|
-
wasm.
|
|
1021
|
+
function wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____(arg0, arg1, arg2) {
|
|
1022
|
+
wasm.wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___web_sys_fa8ef3463a9f903f___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent_____(arg0, arg1, arg2);
|
|
979
1023
|
}
|
|
980
1024
|
|
|
981
|
-
function
|
|
982
|
-
wasm.
|
|
1025
|
+
function wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue_____(arg0, arg1, arg2) {
|
|
1026
|
+
wasm.wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue_____(arg0, arg1, arg2);
|
|
983
1027
|
}
|
|
984
1028
|
|
|
985
|
-
function
|
|
986
|
-
wasm.
|
|
1029
|
+
function wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue__wasm_bindgen_a188ea924c18c4d1___JsValue_____(arg0, arg1, arg2, arg3) {
|
|
1030
|
+
wasm.wasm_bindgen_a188ea924c18c4d1___convert__closures_____invoke___wasm_bindgen_a188ea924c18c4d1___JsValue__wasm_bindgen_a188ea924c18c4d1___JsValue_____(arg0, arg1, arg2, arg3);
|
|
987
1031
|
}
|
|
988
1032
|
|
|
989
1033
|
|
package/hermes_wasm_bg.wasm
CHANGED
|
Binary file
|