@minigraf/browser 1.1.0 → 1.2.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/{minigraf.d.ts → minigraf_wasm.d.ts} +17 -14
- package/{minigraf.js → minigraf_wasm.js} +177 -211
- package/minigraf_wasm_bg.wasm +0 -0
- package/package.json +8 -20
- package/README.md +0 -87
- package/minigraf_bg.wasm +0 -0
- package/minigraf_bg.wasm.d.ts +0 -18
|
@@ -68,20 +68,23 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
68
68
|
export interface InitOutput {
|
|
69
69
|
readonly memory: WebAssembly.Memory;
|
|
70
70
|
readonly __wbg_browserdb_free: (a: number, b: number) => void;
|
|
71
|
-
readonly browserdb_checkpoint: (a: number) =>
|
|
72
|
-
readonly browserdb_execute: (a: number, b: number, c: number) =>
|
|
73
|
-
readonly browserdb_exportGraph: (a: number
|
|
74
|
-
readonly browserdb_importGraph: (a: number, b:
|
|
75
|
-
readonly browserdb_open: (a: number, b: number) =>
|
|
76
|
-
readonly browserdb_openInMemory: (
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
81
|
-
readonly
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
84
|
-
readonly
|
|
71
|
+
readonly browserdb_checkpoint: (a: number) => any;
|
|
72
|
+
readonly browserdb_execute: (a: number, b: number, c: number) => any;
|
|
73
|
+
readonly browserdb_exportGraph: (a: number) => [number, number, number];
|
|
74
|
+
readonly browserdb_importGraph: (a: number, b: any) => any;
|
|
75
|
+
readonly browserdb_open: (a: number, b: number) => any;
|
|
76
|
+
readonly browserdb_openInMemory: () => [number, number, number];
|
|
77
|
+
readonly wasm_bindgen__convert__closures_____invoke__h6588d25cdde23584: (a: number, b: number, c: any) => [number, number];
|
|
78
|
+
readonly wasm_bindgen__convert__closures_____invoke__h4bf2427f775cf424: (a: number, b: number, c: any, d: any) => void;
|
|
79
|
+
readonly wasm_bindgen__convert__closures_____invoke__hf2a775813a6f6bfe: (a: number, b: number, c: any) => void;
|
|
80
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
81
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
82
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
83
|
+
readonly __externref_table_alloc: () => number;
|
|
84
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
85
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
86
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
87
|
+
readonly __wbindgen_start: () => void;
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ts-self-types="./
|
|
1
|
+
/* @ts-self-types="./minigraf_wasm.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Browser-only Minigraf database handle backed by IndexedDB.
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export class BrowserDb {
|
|
11
11
|
static __wrap(ptr) {
|
|
12
|
-
ptr = ptr >>> 0;
|
|
13
12
|
const obj = Object.create(BrowserDb.prototype);
|
|
14
13
|
obj.__wbg_ptr = ptr;
|
|
15
14
|
BrowserDbFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -35,7 +34,7 @@ export class BrowserDb {
|
|
|
35
34
|
*/
|
|
36
35
|
checkpoint() {
|
|
37
36
|
const ret = wasm.browserdb_checkpoint(this.__wbg_ptr);
|
|
38
|
-
return
|
|
37
|
+
return ret;
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
41
40
|
* Execute a Datalog command string and return a JSON-encoded result.
|
|
@@ -49,10 +48,10 @@ export class BrowserDb {
|
|
|
49
48
|
* @returns {Promise<string>}
|
|
50
49
|
*/
|
|
51
50
|
execute(datalog) {
|
|
52
|
-
const ptr0 = passStringToWasm0(datalog, wasm.
|
|
51
|
+
const ptr0 = passStringToWasm0(datalog, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
53
52
|
const len0 = WASM_VECTOR_LEN;
|
|
54
53
|
const ret = wasm.browserdb_execute(this.__wbg_ptr, ptr0, len0);
|
|
55
|
-
return
|
|
54
|
+
return ret;
|
|
56
55
|
}
|
|
57
56
|
/**
|
|
58
57
|
* Serialise the current database to a portable `.graph` blob.
|
|
@@ -65,19 +64,11 @@ export class BrowserDb {
|
|
|
65
64
|
* @returns {Uint8Array}
|
|
66
65
|
*/
|
|
67
66
|
exportGraph() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
72
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
73
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
74
|
-
if (r2) {
|
|
75
|
-
throw takeObject(r1);
|
|
76
|
-
}
|
|
77
|
-
return takeObject(r0);
|
|
78
|
-
} finally {
|
|
79
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
67
|
+
const ret = wasm.browserdb_exportGraph(this.__wbg_ptr);
|
|
68
|
+
if (ret[2]) {
|
|
69
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
80
70
|
}
|
|
71
|
+
return takeFromExternrefTable0(ret[0]);
|
|
81
72
|
}
|
|
82
73
|
/**
|
|
83
74
|
* Replace the current database with a `.graph` blob.
|
|
@@ -89,8 +80,8 @@ export class BrowserDb {
|
|
|
89
80
|
* @returns {Promise<void>}
|
|
90
81
|
*/
|
|
91
82
|
importGraph(data) {
|
|
92
|
-
const ret = wasm.browserdb_importGraph(this.__wbg_ptr,
|
|
93
|
-
return
|
|
83
|
+
const ret = wasm.browserdb_importGraph(this.__wbg_ptr, data);
|
|
84
|
+
return ret;
|
|
94
85
|
}
|
|
95
86
|
/**
|
|
96
87
|
* Open or create a database backed by IndexedDB.
|
|
@@ -101,10 +92,10 @@ export class BrowserDb {
|
|
|
101
92
|
* @returns {Promise<BrowserDb>}
|
|
102
93
|
*/
|
|
103
94
|
static open(db_name) {
|
|
104
|
-
const ptr0 = passStringToWasm0(db_name, wasm.
|
|
95
|
+
const ptr0 = passStringToWasm0(db_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
105
96
|
const len0 = WASM_VECTOR_LEN;
|
|
106
97
|
const ret = wasm.browserdb_open(ptr0, len0);
|
|
107
|
-
return
|
|
98
|
+
return ret;
|
|
108
99
|
}
|
|
109
100
|
/**
|
|
110
101
|
* Open an in-memory database (no IndexedDB — for testing only).
|
|
@@ -113,340 +104,326 @@ export class BrowserDb {
|
|
|
113
104
|
* @returns {BrowserDb}
|
|
114
105
|
*/
|
|
115
106
|
static openInMemory() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
120
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
121
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
122
|
-
if (r2) {
|
|
123
|
-
throw takeObject(r1);
|
|
124
|
-
}
|
|
125
|
-
return BrowserDb.__wrap(r0);
|
|
126
|
-
} finally {
|
|
127
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
107
|
+
const ret = wasm.browserdb_openInMemory();
|
|
108
|
+
if (ret[2]) {
|
|
109
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
128
110
|
}
|
|
111
|
+
return BrowserDb.__wrap(ret[0]);
|
|
129
112
|
}
|
|
130
113
|
}
|
|
131
114
|
if (Symbol.dispose) BrowserDb.prototype[Symbol.dispose] = BrowserDb.prototype.free;
|
|
132
|
-
|
|
133
115
|
function __wbg_get_imports() {
|
|
134
116
|
const import0 = {
|
|
135
117
|
__proto__: null,
|
|
136
|
-
|
|
137
|
-
const ret = debugString(
|
|
138
|
-
const ptr1 = passStringToWasm0(ret, wasm.
|
|
118
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
|
|
119
|
+
const ret = debugString(arg1);
|
|
120
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
139
121
|
const len1 = WASM_VECTOR_LEN;
|
|
140
122
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
141
123
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
142
124
|
},
|
|
143
|
-
|
|
144
|
-
const ret = typeof(
|
|
125
|
+
__wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
|
|
126
|
+
const ret = typeof(arg0) === 'function';
|
|
145
127
|
return ret;
|
|
146
128
|
},
|
|
147
|
-
|
|
148
|
-
const ret =
|
|
129
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
130
|
+
const ret = arg0 === undefined;
|
|
149
131
|
return ret;
|
|
150
132
|
},
|
|
151
|
-
|
|
152
|
-
const obj =
|
|
133
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
|
|
134
|
+
const obj = arg1;
|
|
153
135
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
154
136
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
155
137
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
156
138
|
},
|
|
157
|
-
|
|
139
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
158
140
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
159
141
|
},
|
|
160
|
-
|
|
161
|
-
|
|
142
|
+
__wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
|
|
143
|
+
arg0._wbg_cb_unref();
|
|
162
144
|
},
|
|
163
145
|
__wbg_browserdb_new: function(arg0) {
|
|
164
146
|
const ret = BrowserDb.__wrap(arg0);
|
|
165
|
-
return
|
|
147
|
+
return ret;
|
|
166
148
|
},
|
|
167
|
-
|
|
168
|
-
const ret =
|
|
169
|
-
return
|
|
149
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
150
|
+
const ret = arg0.call(arg1);
|
|
151
|
+
return ret;
|
|
170
152
|
}, arguments); },
|
|
171
|
-
|
|
172
|
-
const ret =
|
|
173
|
-
return
|
|
153
|
+
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
154
|
+
const ret = arg0.call(arg1, arg2);
|
|
155
|
+
return ret;
|
|
174
156
|
}, arguments); },
|
|
175
|
-
|
|
176
|
-
const ret =
|
|
157
|
+
__wbg_contains_72b3d3ec2e94729e: function(arg0, arg1, arg2) {
|
|
158
|
+
const ret = arg0.contains(getStringFromWasm0(arg1, arg2));
|
|
177
159
|
return ret;
|
|
178
160
|
},
|
|
179
|
-
|
|
180
|
-
const ret =
|
|
181
|
-
return
|
|
161
|
+
__wbg_createObjectStore_ff668af6e79f0433: function() { return handleError(function (arg0, arg1, arg2) {
|
|
162
|
+
const ret = arg0.createObjectStore(getStringFromWasm0(arg1, arg2));
|
|
163
|
+
return ret;
|
|
182
164
|
}, arguments); },
|
|
183
|
-
|
|
184
|
-
const ret =
|
|
185
|
-
return
|
|
165
|
+
__wbg_getAllKeys_600fd10abc7076d8: function() { return handleError(function (arg0) {
|
|
166
|
+
const ret = arg0.getAllKeys();
|
|
167
|
+
return ret;
|
|
168
|
+
}, arguments); },
|
|
169
|
+
__wbg_getAll_b31fdebb43579f13: function() { return handleError(function (arg0) {
|
|
170
|
+
const ret = arg0.getAll();
|
|
171
|
+
return ret;
|
|
186
172
|
}, arguments); },
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return addHeapObject(ret);
|
|
173
|
+
__wbg_getRandomValues_bf16787eede473f5: function() { return handleError(function (arg0, arg1) {
|
|
174
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
190
175
|
}, arguments); },
|
|
191
|
-
|
|
192
|
-
const ret =
|
|
193
|
-
return
|
|
176
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
177
|
+
const ret = arg0[arg1 >>> 0];
|
|
178
|
+
return ret;
|
|
194
179
|
},
|
|
195
|
-
|
|
196
|
-
const ret =
|
|
197
|
-
return isLikeNone(ret) ? 0 :
|
|
180
|
+
__wbg_indexedDB_c7dd741e3b661da5: function() { return handleError(function (arg0) {
|
|
181
|
+
const ret = arg0.indexedDB;
|
|
182
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
198
183
|
}, arguments); },
|
|
199
|
-
|
|
184
|
+
__wbg_instanceof_IdbDatabase_1cc734ba1b040dd7: function(arg0) {
|
|
200
185
|
let result;
|
|
201
186
|
try {
|
|
202
|
-
result =
|
|
187
|
+
result = arg0 instanceof IDBDatabase;
|
|
203
188
|
} catch (_) {
|
|
204
189
|
result = false;
|
|
205
190
|
}
|
|
206
191
|
const ret = result;
|
|
207
192
|
return ret;
|
|
208
193
|
},
|
|
209
|
-
|
|
194
|
+
__wbg_instanceof_IdbOpenDbRequest_c34a5f3bfadf1d88: function(arg0) {
|
|
210
195
|
let result;
|
|
211
196
|
try {
|
|
212
|
-
result =
|
|
197
|
+
result = arg0 instanceof IDBOpenDBRequest;
|
|
213
198
|
} catch (_) {
|
|
214
199
|
result = false;
|
|
215
200
|
}
|
|
216
201
|
const ret = result;
|
|
217
202
|
return ret;
|
|
218
203
|
},
|
|
219
|
-
|
|
204
|
+
__wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
|
|
220
205
|
let result;
|
|
221
206
|
try {
|
|
222
|
-
result =
|
|
207
|
+
result = arg0 instanceof Uint8Array;
|
|
223
208
|
} catch (_) {
|
|
224
209
|
result = false;
|
|
225
210
|
}
|
|
226
211
|
const ret = result;
|
|
227
212
|
return ret;
|
|
228
213
|
},
|
|
229
|
-
|
|
214
|
+
__wbg_instanceof_Window_05ba1ee4f6781663: function(arg0) {
|
|
230
215
|
let result;
|
|
231
216
|
try {
|
|
232
|
-
result =
|
|
217
|
+
result = arg0 instanceof Window;
|
|
233
218
|
} catch (_) {
|
|
234
219
|
result = false;
|
|
235
220
|
}
|
|
236
221
|
const ret = result;
|
|
237
222
|
return ret;
|
|
238
223
|
},
|
|
239
|
-
|
|
240
|
-
const ret = Array.isArray(
|
|
224
|
+
__wbg_isArray_0677c962b281d01a: function(arg0) {
|
|
225
|
+
const ret = Array.isArray(arg0);
|
|
241
226
|
return ret;
|
|
242
227
|
},
|
|
243
|
-
|
|
244
|
-
const ret =
|
|
228
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
229
|
+
const ret = arg0.length;
|
|
245
230
|
return ret;
|
|
246
231
|
},
|
|
247
|
-
|
|
248
|
-
const ret =
|
|
232
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
233
|
+
const ret = arg0.length;
|
|
249
234
|
return ret;
|
|
250
235
|
},
|
|
251
|
-
|
|
236
|
+
__wbg_new_aec3e25493d729fe: function(arg0, arg1) {
|
|
252
237
|
try {
|
|
253
238
|
var state0 = {a: arg0, b: arg1};
|
|
254
239
|
var cb0 = (arg0, arg1) => {
|
|
255
240
|
const a = state0.a;
|
|
256
241
|
state0.a = 0;
|
|
257
242
|
try {
|
|
258
|
-
return
|
|
243
|
+
return wasm_bindgen__convert__closures_____invoke__h4bf2427f775cf424(a, state0.b, arg0, arg1);
|
|
259
244
|
} finally {
|
|
260
245
|
state0.a = a;
|
|
261
246
|
}
|
|
262
247
|
};
|
|
263
248
|
const ret = new Promise(cb0);
|
|
264
|
-
return
|
|
249
|
+
return ret;
|
|
265
250
|
} finally {
|
|
266
251
|
state0.a = 0;
|
|
267
252
|
}
|
|
268
253
|
},
|
|
269
|
-
|
|
254
|
+
__wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
|
|
270
255
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
271
|
-
return
|
|
256
|
+
return ret;
|
|
272
257
|
},
|
|
273
|
-
|
|
258
|
+
__wbg_new_typed_1824d93f294193e5: function(arg0, arg1) {
|
|
274
259
|
try {
|
|
275
260
|
var state0 = {a: arg0, b: arg1};
|
|
276
261
|
var cb0 = (arg0, arg1) => {
|
|
277
262
|
const a = state0.a;
|
|
278
263
|
state0.a = 0;
|
|
279
264
|
try {
|
|
280
|
-
return
|
|
265
|
+
return wasm_bindgen__convert__closures_____invoke__h4bf2427f775cf424(a, state0.b, arg0, arg1);
|
|
281
266
|
} finally {
|
|
282
267
|
state0.a = a;
|
|
283
268
|
}
|
|
284
269
|
};
|
|
285
270
|
const ret = new Promise(cb0);
|
|
286
|
-
return
|
|
271
|
+
return ret;
|
|
287
272
|
} finally {
|
|
288
273
|
state0.a = 0;
|
|
289
274
|
}
|
|
290
275
|
},
|
|
291
|
-
|
|
276
|
+
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
292
277
|
const ret = Date.now();
|
|
293
278
|
return ret;
|
|
294
279
|
},
|
|
295
|
-
|
|
296
|
-
const ret =
|
|
297
|
-
return
|
|
280
|
+
__wbg_objectStoreNames_146ab25540bff6db: function(arg0) {
|
|
281
|
+
const ret = arg0.objectStoreNames;
|
|
282
|
+
return ret;
|
|
298
283
|
},
|
|
299
|
-
|
|
300
|
-
const ret =
|
|
301
|
-
return
|
|
284
|
+
__wbg_objectStore_d5f47956b6c741e3: function() { return handleError(function (arg0, arg1, arg2) {
|
|
285
|
+
const ret = arg0.objectStore(getStringFromWasm0(arg1, arg2));
|
|
286
|
+
return ret;
|
|
302
287
|
}, arguments); },
|
|
303
|
-
|
|
304
|
-
const ret =
|
|
305
|
-
return
|
|
288
|
+
__wbg_open_72e5234a49d5f85d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
289
|
+
const ret = arg0.open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
290
|
+
return ret;
|
|
306
291
|
}, arguments); },
|
|
307
|
-
|
|
308
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1),
|
|
292
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
293
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
309
294
|
},
|
|
310
|
-
|
|
311
|
-
const ret =
|
|
312
|
-
return
|
|
295
|
+
__wbg_put_a368805e3dcab3a7: function() { return handleError(function (arg0, arg1, arg2) {
|
|
296
|
+
const ret = arg0.put(arg1, arg2);
|
|
297
|
+
return ret;
|
|
313
298
|
}, arguments); },
|
|
314
|
-
|
|
315
|
-
const ret =
|
|
316
|
-
return
|
|
299
|
+
__wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
|
|
300
|
+
const ret = arg0.queueMicrotask;
|
|
301
|
+
return ret;
|
|
317
302
|
},
|
|
318
|
-
|
|
319
|
-
queueMicrotask(
|
|
303
|
+
__wbg_queueMicrotask_6a09b7bc46549209: function(arg0) {
|
|
304
|
+
queueMicrotask(arg0);
|
|
320
305
|
},
|
|
321
|
-
|
|
322
|
-
const ret = Promise.resolve(
|
|
323
|
-
return
|
|
306
|
+
__wbg_resolve_2191a4dfe481c25b: function(arg0) {
|
|
307
|
+
const ret = Promise.resolve(arg0);
|
|
308
|
+
return ret;
|
|
324
309
|
},
|
|
325
|
-
|
|
326
|
-
const ret =
|
|
327
|
-
return
|
|
310
|
+
__wbg_result_2b1294a2bf8dc773: function() { return handleError(function (arg0) {
|
|
311
|
+
const ret = arg0.result;
|
|
312
|
+
return ret;
|
|
328
313
|
}, arguments); },
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
},
|
|
332
|
-
__wbg_set_onerror_2b7dfa4e6dea4159: function(arg0, arg1) {
|
|
333
|
-
getObject(arg0).onerror = getObject(arg1);
|
|
314
|
+
__wbg_set_oncomplete_e6abb66d0ad42731: function(arg0, arg1) {
|
|
315
|
+
arg0.oncomplete = arg1;
|
|
334
316
|
},
|
|
335
|
-
|
|
336
|
-
|
|
317
|
+
__wbg_set_onerror_3488a474171ed56d: function(arg0, arg1) {
|
|
318
|
+
arg0.onerror = arg1;
|
|
337
319
|
},
|
|
338
|
-
|
|
339
|
-
|
|
320
|
+
__wbg_set_onerror_f8d31be44335c633: function(arg0, arg1) {
|
|
321
|
+
arg0.onerror = arg1;
|
|
340
322
|
},
|
|
341
|
-
|
|
342
|
-
|
|
323
|
+
__wbg_set_onsuccess_cd0c3642a2873e66: function(arg0, arg1) {
|
|
324
|
+
arg0.onsuccess = arg1;
|
|
343
325
|
},
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
326
|
+
__wbg_set_onupgradeneeded_7b2cf4ba1c57e655: function(arg0, arg1) {
|
|
327
|
+
arg0.onupgradeneeded = arg1;
|
|
347
328
|
},
|
|
348
|
-
|
|
329
|
+
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
349
330
|
const ret = typeof global === 'undefined' ? null : global;
|
|
350
|
-
return isLikeNone(ret) ? 0 :
|
|
331
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
351
332
|
},
|
|
352
|
-
|
|
333
|
+
__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
|
|
334
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
335
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
336
|
+
},
|
|
337
|
+
__wbg_static_accessor_SELF_146583524fe1469b: function() {
|
|
353
338
|
const ret = typeof self === 'undefined' ? null : self;
|
|
354
|
-
return isLikeNone(ret) ? 0 :
|
|
339
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
355
340
|
},
|
|
356
|
-
|
|
341
|
+
__wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
|
|
357
342
|
const ret = typeof window === 'undefined' ? null : window;
|
|
358
|
-
return isLikeNone(ret) ? 0 :
|
|
343
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
359
344
|
},
|
|
360
|
-
|
|
361
|
-
const ret =
|
|
362
|
-
return isLikeNone(ret) ? 0 :
|
|
345
|
+
__wbg_target_e759594a8d965ed7: function(arg0) {
|
|
346
|
+
const ret = arg0.target;
|
|
347
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
363
348
|
},
|
|
364
|
-
|
|
365
|
-
const ret =
|
|
366
|
-
return
|
|
349
|
+
__wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
|
|
350
|
+
const ret = arg0.then(arg1, arg2);
|
|
351
|
+
return ret;
|
|
367
352
|
},
|
|
368
|
-
|
|
369
|
-
const ret =
|
|
370
|
-
return
|
|
353
|
+
__wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
|
|
354
|
+
const ret = arg0.then(arg1);
|
|
355
|
+
return ret;
|
|
371
356
|
},
|
|
372
|
-
|
|
373
|
-
const ret =
|
|
374
|
-
return
|
|
357
|
+
__wbg_transaction_d911d96b4b0af154: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
358
|
+
const ret = arg0.transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
|
|
359
|
+
return ret;
|
|
375
360
|
}, arguments); },
|
|
376
361
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
377
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
378
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
379
|
-
return
|
|
362
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 70, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
363
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6588d25cdde23584);
|
|
364
|
+
return ret;
|
|
380
365
|
},
|
|
381
366
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
382
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
383
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
384
|
-
return
|
|
367
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 253, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
368
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hf2a775813a6f6bfe);
|
|
369
|
+
return ret;
|
|
385
370
|
},
|
|
386
371
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
387
372
|
// Cast intrinsic for `F64 -> Externref`.
|
|
388
373
|
const ret = arg0;
|
|
389
|
-
return
|
|
374
|
+
return ret;
|
|
390
375
|
},
|
|
391
376
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
392
377
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
393
378
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
394
|
-
return
|
|
395
|
-
},
|
|
396
|
-
__wbindgen_object_clone_ref: function(arg0) {
|
|
397
|
-
const ret = getObject(arg0);
|
|
398
|
-
return addHeapObject(ret);
|
|
379
|
+
return ret;
|
|
399
380
|
},
|
|
400
|
-
|
|
401
|
-
|
|
381
|
+
__wbindgen_init_externref_table: function() {
|
|
382
|
+
const table = wasm.__wbindgen_externrefs;
|
|
383
|
+
const offset = table.grow(4);
|
|
384
|
+
table.set(0, undefined);
|
|
385
|
+
table.set(offset + 0, undefined);
|
|
386
|
+
table.set(offset + 1, null);
|
|
387
|
+
table.set(offset + 2, true);
|
|
388
|
+
table.set(offset + 3, false);
|
|
402
389
|
},
|
|
403
390
|
};
|
|
404
391
|
return {
|
|
405
392
|
__proto__: null,
|
|
406
|
-
"./
|
|
393
|
+
"./minigraf_wasm_bg.js": import0,
|
|
407
394
|
};
|
|
408
395
|
}
|
|
409
396
|
|
|
410
|
-
function
|
|
411
|
-
wasm.
|
|
397
|
+
function wasm_bindgen__convert__closures_____invoke__hf2a775813a6f6bfe(arg0, arg1, arg2) {
|
|
398
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hf2a775813a6f6bfe(arg0, arg1, arg2);
|
|
412
399
|
}
|
|
413
400
|
|
|
414
|
-
function
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
419
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
420
|
-
if (r1) {
|
|
421
|
-
throw takeObject(r0);
|
|
422
|
-
}
|
|
423
|
-
} finally {
|
|
424
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
401
|
+
function wasm_bindgen__convert__closures_____invoke__h6588d25cdde23584(arg0, arg1, arg2) {
|
|
402
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h6588d25cdde23584(arg0, arg1, arg2);
|
|
403
|
+
if (ret[1]) {
|
|
404
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
425
405
|
}
|
|
426
406
|
}
|
|
427
407
|
|
|
428
|
-
function
|
|
429
|
-
wasm.
|
|
408
|
+
function wasm_bindgen__convert__closures_____invoke__h4bf2427f775cf424(arg0, arg1, arg2, arg3) {
|
|
409
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h4bf2427f775cf424(arg0, arg1, arg2, arg3);
|
|
430
410
|
}
|
|
431
411
|
|
|
432
412
|
|
|
433
413
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
434
414
|
const BrowserDbFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
435
415
|
? { register: () => {}, unregister: () => {} }
|
|
436
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_browserdb_free(ptr
|
|
437
|
-
|
|
438
|
-
function addHeapObject(obj) {
|
|
439
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
440
|
-
const idx = heap_next;
|
|
441
|
-
heap_next = heap[idx];
|
|
416
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_browserdb_free(ptr, 1));
|
|
442
417
|
|
|
443
|
-
|
|
418
|
+
function addToExternrefTable0(obj) {
|
|
419
|
+
const idx = wasm.__externref_table_alloc();
|
|
420
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
444
421
|
return idx;
|
|
445
422
|
}
|
|
446
423
|
|
|
447
424
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
448
425
|
? { register: () => {}, unregister: () => {} }
|
|
449
|
-
: new FinalizationRegistry(state => wasm.
|
|
426
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
450
427
|
|
|
451
428
|
function debugString(val) {
|
|
452
429
|
// primitive types
|
|
@@ -513,12 +490,6 @@ function debugString(val) {
|
|
|
513
490
|
return className;
|
|
514
491
|
}
|
|
515
492
|
|
|
516
|
-
function dropObject(idx) {
|
|
517
|
-
if (idx < 1028) return;
|
|
518
|
-
heap[idx] = heap_next;
|
|
519
|
-
heap_next = idx;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
493
|
function getArrayU8FromWasm0(ptr, len) {
|
|
523
494
|
ptr = ptr >>> 0;
|
|
524
495
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -533,8 +504,7 @@ function getDataViewMemory0() {
|
|
|
533
504
|
}
|
|
534
505
|
|
|
535
506
|
function getStringFromWasm0(ptr, len) {
|
|
536
|
-
|
|
537
|
-
return decodeText(ptr, len);
|
|
507
|
+
return decodeText(ptr >>> 0, len);
|
|
538
508
|
}
|
|
539
509
|
|
|
540
510
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -545,21 +515,15 @@ function getUint8ArrayMemory0() {
|
|
|
545
515
|
return cachedUint8ArrayMemory0;
|
|
546
516
|
}
|
|
547
517
|
|
|
548
|
-
function getObject(idx) { return heap[idx]; }
|
|
549
|
-
|
|
550
518
|
function handleError(f, args) {
|
|
551
519
|
try {
|
|
552
520
|
return f.apply(this, args);
|
|
553
521
|
} catch (e) {
|
|
554
|
-
|
|
522
|
+
const idx = addToExternrefTable0(e);
|
|
523
|
+
wasm.__wbindgen_exn_store(idx);
|
|
555
524
|
}
|
|
556
525
|
}
|
|
557
526
|
|
|
558
|
-
let heap = new Array(1024).fill(undefined);
|
|
559
|
-
heap.push(undefined, null, true, false);
|
|
560
|
-
|
|
561
|
-
let heap_next = heap.length;
|
|
562
|
-
|
|
563
527
|
function isLikeNone(x) {
|
|
564
528
|
return x === undefined || x === null;
|
|
565
529
|
}
|
|
@@ -583,7 +547,7 @@ function makeMutClosure(arg0, arg1, f) {
|
|
|
583
547
|
};
|
|
584
548
|
real._wbg_cb_unref = () => {
|
|
585
549
|
if (--state.cnt === 0) {
|
|
586
|
-
wasm.
|
|
550
|
+
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
587
551
|
state.a = 0;
|
|
588
552
|
CLOSURE_DTORS.unregister(state);
|
|
589
553
|
}
|
|
@@ -629,10 +593,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
629
593
|
return ptr;
|
|
630
594
|
}
|
|
631
595
|
|
|
632
|
-
function
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
return
|
|
596
|
+
function takeFromExternrefTable0(idx) {
|
|
597
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
598
|
+
wasm.__externref_table_dealloc(idx);
|
|
599
|
+
return value;
|
|
636
600
|
}
|
|
637
601
|
|
|
638
602
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -664,12 +628,14 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
664
628
|
|
|
665
629
|
let WASM_VECTOR_LEN = 0;
|
|
666
630
|
|
|
667
|
-
let wasmModule, wasm;
|
|
631
|
+
let wasmModule, wasmInstance, wasm;
|
|
668
632
|
function __wbg_finalize_init(instance, module) {
|
|
633
|
+
wasmInstance = instance;
|
|
669
634
|
wasm = instance.exports;
|
|
670
635
|
wasmModule = module;
|
|
671
636
|
cachedDataViewMemory0 = null;
|
|
672
637
|
cachedUint8ArrayMemory0 = null;
|
|
638
|
+
wasm.__wbindgen_start();
|
|
673
639
|
return wasm;
|
|
674
640
|
}
|
|
675
641
|
|
|
@@ -741,7 +707,7 @@ async function __wbg_init(module_or_path) {
|
|
|
741
707
|
}
|
|
742
708
|
|
|
743
709
|
if (module_or_path === undefined) {
|
|
744
|
-
module_or_path = new URL('
|
|
710
|
+
module_or_path = new URL('minigraf_wasm_bg.wasm', import.meta.url);
|
|
745
711
|
}
|
|
746
712
|
const imports = __wbg_get_imports();
|
|
747
713
|
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minigraf/browser",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
],
|
|
7
|
-
"description": "Zero-config, single-file, embedded graph database with bi-temporal Datalog queries",
|
|
8
|
-
"version": "1.1.0",
|
|
9
|
-
"license": "MIT OR Apache-2.0",
|
|
4
|
+
"description": "wasm-pack build shim for Minigraf browser and WASI targets",
|
|
5
|
+
"version": "1.2.0",
|
|
10
6
|
"repository": {
|
|
11
7
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/project-minigraf/minigraf"
|
|
8
|
+
"url": "https://github.com/project-minigraf/minigraf-wasm"
|
|
13
9
|
},
|
|
14
10
|
"files": [
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"minigraf.d.ts"
|
|
11
|
+
"minigraf_wasm_bg.wasm",
|
|
12
|
+
"minigraf_wasm.js",
|
|
13
|
+
"minigraf_wasm.d.ts"
|
|
19
14
|
],
|
|
20
|
-
"main": "
|
|
21
|
-
"types": "
|
|
15
|
+
"main": "minigraf_wasm.js",
|
|
16
|
+
"types": "minigraf_wasm.d.ts",
|
|
22
17
|
"sideEffects": [
|
|
23
18
|
"./snippets/*"
|
|
24
|
-
],
|
|
25
|
-
"keywords": [
|
|
26
|
-
"graph",
|
|
27
|
-
"datalog",
|
|
28
|
-
"bitemporal",
|
|
29
|
-
"embedded",
|
|
30
|
-
"database"
|
|
31
19
|
]
|
|
32
20
|
}
|
package/README.md
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# @minigraf/browser
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@minigraf/browser)
|
|
4
|
-
[](https://github.com/project-minigraf/minigraf#license)
|
|
5
|
-
|
|
6
|
-
> Embedded bi-temporal graph database for the browser — Datalog queries, time travel, IndexedDB persistence
|
|
7
|
-
|
|
8
|
-
Minigraf in the browser: zero configuration, persistent graph storage backed by IndexedDB, Datalog queries with recursive rules and time travel. One API, no server required.
|
|
9
|
-
|
|
10
|
-
## Install
|
|
11
|
-
|
|
12
|
-
```sh
|
|
13
|
-
npm install @minigraf/browser
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Quick start
|
|
17
|
-
|
|
18
|
-
```javascript
|
|
19
|
-
import init, { BrowserDb } from '@minigraf/browser';
|
|
20
|
-
await init();
|
|
21
|
-
|
|
22
|
-
// Persistent database (survives page reloads — backed by IndexedDB)
|
|
23
|
-
const db = await BrowserDb.open('my-graph');
|
|
24
|
-
|
|
25
|
-
// In-memory database (ephemeral / testing)
|
|
26
|
-
const mem = BrowserDb.openInMemory();
|
|
27
|
-
|
|
28
|
-
// Transact facts
|
|
29
|
-
const r = JSON.parse(await db.execute(
|
|
30
|
-
'(transact [[:alice :person/name "Alice"] [:alice :person/age 30]])'
|
|
31
|
-
));
|
|
32
|
-
// { "transacted": 1 }
|
|
33
|
-
|
|
34
|
-
// Query with Datalog
|
|
35
|
-
const q = JSON.parse(await db.execute(
|
|
36
|
-
'(query [:find ?name ?age :where [?e :person/name ?name] [?e :person/age ?age]])'
|
|
37
|
-
));
|
|
38
|
-
// { "variables": ["?name", "?age"], "results": [["Alice", 30]] }
|
|
39
|
-
|
|
40
|
-
// Time travel — state as of transaction 1
|
|
41
|
-
const snap = JSON.parse(await db.execute(
|
|
42
|
-
'(query [:find ?age :as-of 1 :where [:alice :person/age ?age]])'
|
|
43
|
-
));
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Response shapes
|
|
47
|
-
|
|
48
|
-
| Command | JSON |
|
|
49
|
-
|---|---|
|
|
50
|
-
| `transact` | `{"transacted": <tx_count>}` |
|
|
51
|
-
| `retract` | `{"retracted": <tx_count>}` |
|
|
52
|
-
| `query` | `{"variables": [...], "results": [[...]]}` |
|
|
53
|
-
| `rule` | `{"ok": true}` |
|
|
54
|
-
|
|
55
|
-
## Export / import
|
|
56
|
-
|
|
57
|
-
The `.graph` binary format is byte-identical between browser and native builds. Export a snapshot or load a native-generated file:
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
// Export (Uint8Array — byte-identical to a native .graph file)
|
|
61
|
-
const bytes = db.exportGraph();
|
|
62
|
-
|
|
63
|
-
// Import a native .graph file (must be checkpointed — no pending WAL)
|
|
64
|
-
const file = document.querySelector('input[type=file]').files[0];
|
|
65
|
-
await db.importGraph(new Uint8Array(await file.arrayBuffer()));
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Constraints
|
|
69
|
-
|
|
70
|
-
- Requires a browser environment with IndexedDB. Not compatible with Node.js — use the [`minigraf` npm package](https://www.npmjs.com/package/minigraf) for Node.js instead.
|
|
71
|
-
- Single-threaded. Runs on the main thread or in a Web Worker; no shared state across workers.
|
|
72
|
-
|
|
73
|
-
## wasm-pack clobbering note (for maintainers)
|
|
74
|
-
|
|
75
|
-
`wasm-pack build` may overwrite this file. If it does, `wasm-release.yml` must copy the canonical
|
|
76
|
-
README from a stable source (e.g. a root-level `minigraf-wasm.README.md`) into the build output
|
|
77
|
-
directory before `npm publish`. Verify this on first release after any `wasm-pack` version upgrade.
|
|
78
|
-
|
|
79
|
-
## Links
|
|
80
|
-
|
|
81
|
-
- [Full browser integration guide](https://github.com/project-minigraf/minigraf/wiki/Use-Cases#wasm--browser)
|
|
82
|
-
- [Repository](https://github.com/project-minigraf/minigraf)
|
|
83
|
-
- [Datalog Reference](https://github.com/project-minigraf/minigraf/wiki/Datalog-Reference)
|
|
84
|
-
|
|
85
|
-
## License
|
|
86
|
-
|
|
87
|
-
MIT OR Apache-2.0
|
package/minigraf_bg.wasm
DELETED
|
Binary file
|
package/minigraf_bg.wasm.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_browserdb_free: (a: number, b: number) => void;
|
|
5
|
-
export const browserdb_checkpoint: (a: number) => number;
|
|
6
|
-
export const browserdb_execute: (a: number, b: number, c: number) => number;
|
|
7
|
-
export const browserdb_exportGraph: (a: number, b: number) => void;
|
|
8
|
-
export const browserdb_importGraph: (a: number, b: number) => number;
|
|
9
|
-
export const browserdb_open: (a: number, b: number) => number;
|
|
10
|
-
export const browserdb_openInMemory: (a: number) => void;
|
|
11
|
-
export const __wasm_bindgen_func_elem_2769: (a: number, b: number, c: number, d: number) => void;
|
|
12
|
-
export const __wasm_bindgen_func_elem_2781: (a: number, b: number, c: number, d: number) => void;
|
|
13
|
-
export const __wasm_bindgen_func_elem_658: (a: number, b: number, c: number) => void;
|
|
14
|
-
export const __wbindgen_export: (a: number, b: number) => number;
|
|
15
|
-
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
16
|
-
export const __wbindgen_export3: (a: number) => void;
|
|
17
|
-
export const __wbindgen_export4: (a: number, b: number) => void;
|
|
18
|
-
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|