deepwoken 0.1.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/deepwoken.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export class DeepData {
5
+ private constructor();
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ aspects(): any;
9
+ /**
10
+ * Fetch the latest data bundle from pocamind/data on GitHub
11
+ */
12
+ static fetchLatest(): Promise<DeepData>;
13
+ /**
14
+ * Fetch the latest data bundle from a fork
15
+ */
16
+ static fetchLatestFrom(owner: string, repo: string): Promise<DeepData>;
17
+ /**
18
+ * Parse data from a JSON string
19
+ */
20
+ static fromJson(json: string): DeepData;
21
+ getAspect(name: string): any;
22
+ getMantra(name: string): any;
23
+ getOutfit(name: string): any;
24
+ getTalent(name: string): any;
25
+ getWeapon(name: string): any;
26
+ mantras(): any;
27
+ outfits(): any;
28
+ talents(): any;
29
+ weapons(): any;
30
+ }
package/deepwoken.js ADDED
@@ -0,0 +1,9 @@
1
+ /* @ts-self-types="./deepwoken.d.ts" */
2
+
3
+ import * as wasm from "./deepwoken_bg.wasm";
4
+ import { __wbg_set_wasm } from "./deepwoken_bg.js";
5
+ __wbg_set_wasm(wasm);
6
+ wasm.__wbindgen_start();
7
+ export {
8
+ DeepData
9
+ } from "./deepwoken_bg.js";
@@ -0,0 +1,729 @@
1
+ export class DeepData {
2
+ static __wrap(ptr) {
3
+ ptr = ptr >>> 0;
4
+ const obj = Object.create(DeepData.prototype);
5
+ obj.__wbg_ptr = ptr;
6
+ DeepDataFinalization.register(obj, obj.__wbg_ptr, obj);
7
+ return obj;
8
+ }
9
+ __destroy_into_raw() {
10
+ const ptr = this.__wbg_ptr;
11
+ this.__wbg_ptr = 0;
12
+ DeepDataFinalization.unregister(this);
13
+ return ptr;
14
+ }
15
+ free() {
16
+ const ptr = this.__destroy_into_raw();
17
+ wasm.__wbg_deepdata_free(ptr, 0);
18
+ }
19
+ /**
20
+ * @returns {any}
21
+ */
22
+ aspects() {
23
+ const ret = wasm.deepdata_aspects(this.__wbg_ptr);
24
+ if (ret[2]) {
25
+ throw takeFromExternrefTable0(ret[1]);
26
+ }
27
+ return takeFromExternrefTable0(ret[0]);
28
+ }
29
+ /**
30
+ * Fetch the latest data bundle from pocamind/data on GitHub
31
+ * @returns {Promise<DeepData>}
32
+ */
33
+ static fetchLatest() {
34
+ const ret = wasm.deepdata_fetchLatest();
35
+ return ret;
36
+ }
37
+ /**
38
+ * Fetch the latest data bundle from a fork
39
+ * @param {string} owner
40
+ * @param {string} repo
41
+ * @returns {Promise<DeepData>}
42
+ */
43
+ static fetchLatestFrom(owner, repo) {
44
+ const ptr0 = passStringToWasm0(owner, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
45
+ const len0 = WASM_VECTOR_LEN;
46
+ const ptr1 = passStringToWasm0(repo, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
47
+ const len1 = WASM_VECTOR_LEN;
48
+ const ret = wasm.deepdata_fetchLatestFrom(ptr0, len0, ptr1, len1);
49
+ return ret;
50
+ }
51
+ /**
52
+ * Parse data from a JSON string
53
+ * @param {string} json
54
+ * @returns {DeepData}
55
+ */
56
+ static fromJson(json) {
57
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
58
+ const len0 = WASM_VECTOR_LEN;
59
+ const ret = wasm.deepdata_fromJson(ptr0, len0);
60
+ if (ret[2]) {
61
+ throw takeFromExternrefTable0(ret[1]);
62
+ }
63
+ return DeepData.__wrap(ret[0]);
64
+ }
65
+ /**
66
+ * @param {string} name
67
+ * @returns {any}
68
+ */
69
+ getAspect(name) {
70
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
71
+ const len0 = WASM_VECTOR_LEN;
72
+ const ret = wasm.deepdata_getAspect(this.__wbg_ptr, ptr0, len0);
73
+ if (ret[2]) {
74
+ throw takeFromExternrefTable0(ret[1]);
75
+ }
76
+ return takeFromExternrefTable0(ret[0]);
77
+ }
78
+ /**
79
+ * @param {string} name
80
+ * @returns {any}
81
+ */
82
+ getMantra(name) {
83
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
84
+ const len0 = WASM_VECTOR_LEN;
85
+ const ret = wasm.deepdata_getMantra(this.__wbg_ptr, ptr0, len0);
86
+ if (ret[2]) {
87
+ throw takeFromExternrefTable0(ret[1]);
88
+ }
89
+ return takeFromExternrefTable0(ret[0]);
90
+ }
91
+ /**
92
+ * @param {string} name
93
+ * @returns {any}
94
+ */
95
+ getOutfit(name) {
96
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
97
+ const len0 = WASM_VECTOR_LEN;
98
+ const ret = wasm.deepdata_getOutfit(this.__wbg_ptr, ptr0, len0);
99
+ if (ret[2]) {
100
+ throw takeFromExternrefTable0(ret[1]);
101
+ }
102
+ return takeFromExternrefTable0(ret[0]);
103
+ }
104
+ /**
105
+ * @param {string} name
106
+ * @returns {any}
107
+ */
108
+ getTalent(name) {
109
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
110
+ const len0 = WASM_VECTOR_LEN;
111
+ const ret = wasm.deepdata_getTalent(this.__wbg_ptr, ptr0, len0);
112
+ if (ret[2]) {
113
+ throw takeFromExternrefTable0(ret[1]);
114
+ }
115
+ return takeFromExternrefTable0(ret[0]);
116
+ }
117
+ /**
118
+ * @param {string} name
119
+ * @returns {any}
120
+ */
121
+ getWeapon(name) {
122
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
123
+ const len0 = WASM_VECTOR_LEN;
124
+ const ret = wasm.deepdata_getWeapon(this.__wbg_ptr, ptr0, len0);
125
+ if (ret[2]) {
126
+ throw takeFromExternrefTable0(ret[1]);
127
+ }
128
+ return takeFromExternrefTable0(ret[0]);
129
+ }
130
+ /**
131
+ * @returns {any}
132
+ */
133
+ mantras() {
134
+ const ret = wasm.deepdata_mantras(this.__wbg_ptr);
135
+ if (ret[2]) {
136
+ throw takeFromExternrefTable0(ret[1]);
137
+ }
138
+ return takeFromExternrefTable0(ret[0]);
139
+ }
140
+ /**
141
+ * @returns {any}
142
+ */
143
+ outfits() {
144
+ const ret = wasm.deepdata_outfits(this.__wbg_ptr);
145
+ if (ret[2]) {
146
+ throw takeFromExternrefTable0(ret[1]);
147
+ }
148
+ return takeFromExternrefTable0(ret[0]);
149
+ }
150
+ /**
151
+ * @returns {any}
152
+ */
153
+ talents() {
154
+ const ret = wasm.deepdata_talents(this.__wbg_ptr);
155
+ if (ret[2]) {
156
+ throw takeFromExternrefTable0(ret[1]);
157
+ }
158
+ return takeFromExternrefTable0(ret[0]);
159
+ }
160
+ /**
161
+ * @returns {any}
162
+ */
163
+ weapons() {
164
+ const ret = wasm.deepdata_weapons(this.__wbg_ptr);
165
+ if (ret[2]) {
166
+ throw takeFromExternrefTable0(ret[1]);
167
+ }
168
+ return takeFromExternrefTable0(ret[0]);
169
+ }
170
+ }
171
+ if (Symbol.dispose) DeepData.prototype[Symbol.dispose] = DeepData.prototype.free;
172
+ export function __wbg_Error_ecbf49c1b9d07c30(arg0, arg1) {
173
+ const ret = Error(getStringFromWasm0(arg0, arg1));
174
+ return ret;
175
+ }
176
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
177
+ const ret = String(arg1);
178
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
179
+ const len1 = WASM_VECTOR_LEN;
180
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
181
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
182
+ }
183
+ export function __wbg___wbindgen_debug_string_43c7ccb034739216(arg0, arg1) {
184
+ const ret = debugString(arg1);
185
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
186
+ const len1 = WASM_VECTOR_LEN;
187
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
188
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
189
+ }
190
+ export function __wbg___wbindgen_is_function_18bea6e84080c016(arg0) {
191
+ const ret = typeof(arg0) === 'function';
192
+ return ret;
193
+ }
194
+ export function __wbg___wbindgen_is_object_8d3fac158b36498d(arg0) {
195
+ const val = arg0;
196
+ const ret = typeof(val) === 'object' && val !== null;
197
+ return ret;
198
+ }
199
+ export function __wbg___wbindgen_is_string_4d5f2c5b2acf65b0(arg0) {
200
+ const ret = typeof(arg0) === 'string';
201
+ return ret;
202
+ }
203
+ export function __wbg___wbindgen_is_undefined_4a711ea9d2e1ef93(arg0) {
204
+ const ret = arg0 === undefined;
205
+ return ret;
206
+ }
207
+ export function __wbg___wbindgen_string_get_d09f733449cbf7a2(arg0, arg1) {
208
+ const obj = arg1;
209
+ const ret = typeof(obj) === 'string' ? obj : undefined;
210
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
211
+ var len1 = WASM_VECTOR_LEN;
212
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
213
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
214
+ }
215
+ export function __wbg___wbindgen_throw_df03e93053e0f4bc(arg0, arg1) {
216
+ throw new Error(getStringFromWasm0(arg0, arg1));
217
+ }
218
+ export function __wbg__wbg_cb_unref_9f02ce912168c354(arg0) {
219
+ arg0._wbg_cb_unref();
220
+ }
221
+ export function __wbg_abort_7100d741d811fdb2(arg0, arg1) {
222
+ arg0.abort(arg1);
223
+ }
224
+ export function __wbg_abort_bf4dbbb6563f9ad6(arg0) {
225
+ arg0.abort();
226
+ }
227
+ export function __wbg_append_057d2867b781cdc3() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
228
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
229
+ }, arguments); }
230
+ export function __wbg_arrayBuffer_6881d775e5087c3c() { return handleError(function (arg0) {
231
+ const ret = arg0.arrayBuffer();
232
+ return ret;
233
+ }, arguments); }
234
+ export function __wbg_call_85e5437fa1ab109d() { return handleError(function (arg0, arg1, arg2) {
235
+ const ret = arg0.call(arg1, arg2);
236
+ return ret;
237
+ }, arguments); }
238
+ export function __wbg_call_df7a43aecab856a8() { return handleError(function (arg0, arg1) {
239
+ const ret = arg0.call(arg1);
240
+ return ret;
241
+ }, arguments); }
242
+ export function __wbg_clearTimeout_6b8d9a38b9263d65(arg0) {
243
+ const ret = clearTimeout(arg0);
244
+ return ret;
245
+ }
246
+ export function __wbg_deepdata_new(arg0) {
247
+ const ret = DeepData.__wrap(arg0);
248
+ return ret;
249
+ }
250
+ export function __wbg_done_0ad70482cae88a68(arg0) {
251
+ const ret = arg0.done;
252
+ return ret;
253
+ }
254
+ export function __wbg_fetch_8508e14acc7090e7(arg0, arg1) {
255
+ const ret = arg0.fetch(arg1);
256
+ return ret;
257
+ }
258
+ export function __wbg_fetch_9dad4fe911207b37(arg0) {
259
+ const ret = fetch(arg0);
260
+ return ret;
261
+ }
262
+ export function __wbg_get_6f5cf69c8f3f094a() { return handleError(function (arg0, arg1) {
263
+ const ret = Reflect.get(arg0, arg1);
264
+ return ret;
265
+ }, arguments); }
266
+ export function __wbg_has_393943c179c58bfe() { return handleError(function (arg0, arg1) {
267
+ const ret = Reflect.has(arg0, arg1);
268
+ return ret;
269
+ }, arguments); }
270
+ export function __wbg_headers_5960155bb72206d7(arg0) {
271
+ const ret = arg0.headers;
272
+ return ret;
273
+ }
274
+ export function __wbg_instanceof_Response_4d70bea95d48a514(arg0) {
275
+ let result;
276
+ try {
277
+ result = arg0 instanceof Response;
278
+ } catch (_) {
279
+ result = false;
280
+ }
281
+ const ret = result;
282
+ return ret;
283
+ }
284
+ export function __wbg_iterator_e77d2b7575cca5a7() {
285
+ const ret = Symbol.iterator;
286
+ return ret;
287
+ }
288
+ export function __wbg_length_5e07cf181b2745fb(arg0) {
289
+ const ret = arg0.length;
290
+ return ret;
291
+ }
292
+ export function __wbg_new_62f131e968c83d75() {
293
+ const ret = new Object();
294
+ return ret;
295
+ }
296
+ export function __wbg_new_66075f8c2ea6575e() {
297
+ const ret = new Array();
298
+ return ret;
299
+ }
300
+ export function __wbg_new_74eb411a4d7bd3f1() {
301
+ const ret = new Map();
302
+ return ret;
303
+ }
304
+ export function __wbg_new_a0479da6258a0d71(arg0) {
305
+ const ret = new Uint8Array(arg0);
306
+ return ret;
307
+ }
308
+ export function __wbg_new_a23ce0a01d189235() { return handleError(function () {
309
+ const ret = new Headers();
310
+ return ret;
311
+ }, arguments); }
312
+ export function __wbg_new_eb8f6841a0421871() { return handleError(function () {
313
+ const ret = new AbortController();
314
+ return ret;
315
+ }, arguments); }
316
+ export function __wbg_new_from_slice_e98c2bb0a59c32a0(arg0, arg1) {
317
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
318
+ return ret;
319
+ }
320
+ export function __wbg_new_typed_893dbec5fe999814(arg0, arg1) {
321
+ try {
322
+ var state0 = {a: arg0, b: arg1};
323
+ var cb0 = (arg0, arg1) => {
324
+ const a = state0.a;
325
+ state0.a = 0;
326
+ try {
327
+ return wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(a, state0.b, arg0, arg1);
328
+ } finally {
329
+ state0.a = a;
330
+ }
331
+ };
332
+ const ret = new Promise(cb0);
333
+ return ret;
334
+ } finally {
335
+ state0.a = state0.b = 0;
336
+ }
337
+ }
338
+ export function __wbg_new_with_str_and_init_ccd7de5a7b7630b8() { return handleError(function (arg0, arg1, arg2) {
339
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
340
+ return ret;
341
+ }, arguments); }
342
+ export function __wbg_next_5428439dfc1d0362() { return handleError(function (arg0) {
343
+ const ret = arg0.next();
344
+ return ret;
345
+ }, arguments); }
346
+ export function __wbg_next_d314789a105729f3(arg0) {
347
+ const ret = arg0.next;
348
+ return ret;
349
+ }
350
+ export function __wbg_prototypesetcall_d1a7133bc8d83aa9(arg0, arg1, arg2) {
351
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
352
+ }
353
+ export function __wbg_queueMicrotask_622e69f0935dfab2(arg0) {
354
+ const ret = arg0.queueMicrotask;
355
+ return ret;
356
+ }
357
+ export function __wbg_queueMicrotask_d0528786d26e067c(arg0) {
358
+ queueMicrotask(arg0);
359
+ }
360
+ export function __wbg_resolve_d170483d75a2c8a1(arg0) {
361
+ const ret = Promise.resolve(arg0);
362
+ return ret;
363
+ }
364
+ export function __wbg_setTimeout_f757f00851f76c42(arg0, arg1) {
365
+ const ret = setTimeout(arg0, arg1);
366
+ return ret;
367
+ }
368
+ export function __wbg_set_3ba5af57f57f831c(arg0, arg1, arg2) {
369
+ const ret = arg0.set(arg1, arg2);
370
+ return ret;
371
+ }
372
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
373
+ arg0[arg1] = arg2;
374
+ }
375
+ export function __wbg_set_7bf9e2df46e7632c(arg0, arg1, arg2) {
376
+ arg0[arg1 >>> 0] = arg2;
377
+ }
378
+ export function __wbg_set_body_d3bfb0ba84038563(arg0, arg1) {
379
+ arg0.body = arg1;
380
+ }
381
+ export function __wbg_set_cache_d7fd96d5c85d5834(arg0, arg1) {
382
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
383
+ }
384
+ export function __wbg_set_credentials_75d65e7cc277aad0(arg0, arg1) {
385
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
386
+ }
387
+ export function __wbg_set_headers_e4e56fe005f0b5c9(arg0, arg1) {
388
+ arg0.headers = arg1;
389
+ }
390
+ export function __wbg_set_method_e1291768ddb1e35e(arg0, arg1, arg2) {
391
+ arg0.method = getStringFromWasm0(arg1, arg2);
392
+ }
393
+ export function __wbg_set_mode_1fcb26983836e884(arg0, arg1) {
394
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
395
+ }
396
+ export function __wbg_set_signal_4e03877dd7f2cd34(arg0, arg1) {
397
+ arg0.signal = arg1;
398
+ }
399
+ export function __wbg_signal_065197e577ceaa9e(arg0) {
400
+ const ret = arg0.signal;
401
+ return ret;
402
+ }
403
+ export function __wbg_static_accessor_GLOBAL_THIS_6614f2f4998e3c4c() {
404
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
405
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
406
+ }
407
+ export function __wbg_static_accessor_GLOBAL_d8e8a2fefe80bc1d() {
408
+ const ret = typeof global === 'undefined' ? null : global;
409
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
410
+ }
411
+ export function __wbg_static_accessor_SELF_e29eaf7c465526b1() {
412
+ const ret = typeof self === 'undefined' ? null : self;
413
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
414
+ }
415
+ export function __wbg_static_accessor_WINDOW_66e7ca3eef30585a() {
416
+ const ret = typeof window === 'undefined' ? null : window;
417
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
418
+ }
419
+ export function __wbg_status_3a65028f4384d918(arg0) {
420
+ const ret = arg0.status;
421
+ return ret;
422
+ }
423
+ export function __wbg_stringify_c585a2d825a78689() { return handleError(function (arg0) {
424
+ const ret = JSON.stringify(arg0);
425
+ return ret;
426
+ }, arguments); }
427
+ export function __wbg_text_96bbece7b1823162() { return handleError(function (arg0) {
428
+ const ret = arg0.text();
429
+ return ret;
430
+ }, arguments); }
431
+ export function __wbg_then_1170ade08ea65bc7(arg0, arg1, arg2) {
432
+ const ret = arg0.then(arg1, arg2);
433
+ return ret;
434
+ }
435
+ export function __wbg_then_fdc17de424bf508a(arg0, arg1) {
436
+ const ret = arg0.then(arg1);
437
+ return ret;
438
+ }
439
+ export function __wbg_url_f73e822379c5f00c(arg0, arg1) {
440
+ const ret = arg1.url;
441
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
+ const len1 = WASM_VECTOR_LEN;
443
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
444
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
445
+ }
446
+ export function __wbg_value_414b42ce7b3eca22(arg0) {
447
+ const ret = arg0.value;
448
+ return ret;
449
+ }
450
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
451
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 140, function: Function { arguments: [], shim_idx: 141, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
452
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf10da1d08ed9fc18, wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8);
453
+ return ret;
454
+ }
455
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
456
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 165, function: Function { arguments: [Externref], shim_idx: 166, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
457
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he46194fcf4899997, wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15);
458
+ return ret;
459
+ }
460
+ export function __wbindgen_cast_0000000000000003(arg0) {
461
+ // Cast intrinsic for `F64 -> Externref`.
462
+ const ret = arg0;
463
+ return ret;
464
+ }
465
+ export function __wbindgen_cast_0000000000000004(arg0) {
466
+ // Cast intrinsic for `I64 -> Externref`.
467
+ const ret = arg0;
468
+ return ret;
469
+ }
470
+ export function __wbindgen_cast_0000000000000005(arg0, arg1) {
471
+ // Cast intrinsic for `Ref(String) -> Externref`.
472
+ const ret = getStringFromWasm0(arg0, arg1);
473
+ return ret;
474
+ }
475
+ export function __wbindgen_init_externref_table() {
476
+ const table = wasm.__wbindgen_externrefs;
477
+ const offset = table.grow(4);
478
+ table.set(0, undefined);
479
+ table.set(offset + 0, undefined);
480
+ table.set(offset + 1, null);
481
+ table.set(offset + 2, true);
482
+ table.set(offset + 3, false);
483
+ }
484
+ function wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8(arg0, arg1) {
485
+ wasm.wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8(arg0, arg1);
486
+ }
487
+
488
+ function wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15(arg0, arg1, arg2) {
489
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15(arg0, arg1, arg2);
490
+ if (ret[1]) {
491
+ throw takeFromExternrefTable0(ret[0]);
492
+ }
493
+ }
494
+
495
+ function wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(arg0, arg1, arg2, arg3) {
496
+ wasm.wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(arg0, arg1, arg2, arg3);
497
+ }
498
+
499
+
500
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
501
+
502
+
503
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
504
+
505
+
506
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
507
+ const DeepDataFinalization = (typeof FinalizationRegistry === 'undefined')
508
+ ? { register: () => {}, unregister: () => {} }
509
+ : new FinalizationRegistry(ptr => wasm.__wbg_deepdata_free(ptr >>> 0, 1));
510
+
511
+ function addToExternrefTable0(obj) {
512
+ const idx = wasm.__externref_table_alloc();
513
+ wasm.__wbindgen_externrefs.set(idx, obj);
514
+ return idx;
515
+ }
516
+
517
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
518
+ ? { register: () => {}, unregister: () => {} }
519
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
520
+
521
+ function debugString(val) {
522
+ // primitive types
523
+ const type = typeof val;
524
+ if (type == 'number' || type == 'boolean' || val == null) {
525
+ return `${val}`;
526
+ }
527
+ if (type == 'string') {
528
+ return `"${val}"`;
529
+ }
530
+ if (type == 'symbol') {
531
+ const description = val.description;
532
+ if (description == null) {
533
+ return 'Symbol';
534
+ } else {
535
+ return `Symbol(${description})`;
536
+ }
537
+ }
538
+ if (type == 'function') {
539
+ const name = val.name;
540
+ if (typeof name == 'string' && name.length > 0) {
541
+ return `Function(${name})`;
542
+ } else {
543
+ return 'Function';
544
+ }
545
+ }
546
+ // objects
547
+ if (Array.isArray(val)) {
548
+ const length = val.length;
549
+ let debug = '[';
550
+ if (length > 0) {
551
+ debug += debugString(val[0]);
552
+ }
553
+ for(let i = 1; i < length; i++) {
554
+ debug += ', ' + debugString(val[i]);
555
+ }
556
+ debug += ']';
557
+ return debug;
558
+ }
559
+ // Test for built-in
560
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
561
+ let className;
562
+ if (builtInMatches && builtInMatches.length > 1) {
563
+ className = builtInMatches[1];
564
+ } else {
565
+ // Failed to match the standard '[object ClassName]'
566
+ return toString.call(val);
567
+ }
568
+ if (className == 'Object') {
569
+ // we're a user defined class or Object
570
+ // JSON.stringify avoids problems with cycles, and is generally much
571
+ // easier than looping through ownProperties of `val`.
572
+ try {
573
+ return 'Object(' + JSON.stringify(val) + ')';
574
+ } catch (_) {
575
+ return 'Object';
576
+ }
577
+ }
578
+ // errors
579
+ if (val instanceof Error) {
580
+ return `${val.name}: ${val.message}\n${val.stack}`;
581
+ }
582
+ // TODO we could test for more things here, like `Set`s and `Map`s.
583
+ return className;
584
+ }
585
+
586
+ function getArrayU8FromWasm0(ptr, len) {
587
+ ptr = ptr >>> 0;
588
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
589
+ }
590
+
591
+ let cachedDataViewMemory0 = null;
592
+ function getDataViewMemory0() {
593
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
594
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
595
+ }
596
+ return cachedDataViewMemory0;
597
+ }
598
+
599
+ function getStringFromWasm0(ptr, len) {
600
+ ptr = ptr >>> 0;
601
+ return decodeText(ptr, len);
602
+ }
603
+
604
+ let cachedUint8ArrayMemory0 = null;
605
+ function getUint8ArrayMemory0() {
606
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
607
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
608
+ }
609
+ return cachedUint8ArrayMemory0;
610
+ }
611
+
612
+ function handleError(f, args) {
613
+ try {
614
+ return f.apply(this, args);
615
+ } catch (e) {
616
+ const idx = addToExternrefTable0(e);
617
+ wasm.__wbindgen_exn_store(idx);
618
+ }
619
+ }
620
+
621
+ function isLikeNone(x) {
622
+ return x === undefined || x === null;
623
+ }
624
+
625
+ function makeMutClosure(arg0, arg1, dtor, f) {
626
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
627
+ const real = (...args) => {
628
+
629
+ // First up with a closure we increment the internal reference
630
+ // count. This ensures that the Rust closure environment won't
631
+ // be deallocated while we're invoking it.
632
+ state.cnt++;
633
+ const a = state.a;
634
+ state.a = 0;
635
+ try {
636
+ return f(a, state.b, ...args);
637
+ } finally {
638
+ state.a = a;
639
+ real._wbg_cb_unref();
640
+ }
641
+ };
642
+ real._wbg_cb_unref = () => {
643
+ if (--state.cnt === 0) {
644
+ state.dtor(state.a, state.b);
645
+ state.a = 0;
646
+ CLOSURE_DTORS.unregister(state);
647
+ }
648
+ };
649
+ CLOSURE_DTORS.register(real, state, state);
650
+ return real;
651
+ }
652
+
653
+ function passStringToWasm0(arg, malloc, realloc) {
654
+ if (realloc === undefined) {
655
+ const buf = cachedTextEncoder.encode(arg);
656
+ const ptr = malloc(buf.length, 1) >>> 0;
657
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
658
+ WASM_VECTOR_LEN = buf.length;
659
+ return ptr;
660
+ }
661
+
662
+ let len = arg.length;
663
+ let ptr = malloc(len, 1) >>> 0;
664
+
665
+ const mem = getUint8ArrayMemory0();
666
+
667
+ let offset = 0;
668
+
669
+ for (; offset < len; offset++) {
670
+ const code = arg.charCodeAt(offset);
671
+ if (code > 0x7F) break;
672
+ mem[ptr + offset] = code;
673
+ }
674
+ if (offset !== len) {
675
+ if (offset !== 0) {
676
+ arg = arg.slice(offset);
677
+ }
678
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
679
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
680
+ const ret = cachedTextEncoder.encodeInto(arg, view);
681
+
682
+ offset += ret.written;
683
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
684
+ }
685
+
686
+ WASM_VECTOR_LEN = offset;
687
+ return ptr;
688
+ }
689
+
690
+ function takeFromExternrefTable0(idx) {
691
+ const value = wasm.__wbindgen_externrefs.get(idx);
692
+ wasm.__externref_table_dealloc(idx);
693
+ return value;
694
+ }
695
+
696
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
697
+ cachedTextDecoder.decode();
698
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
699
+ let numBytesDecoded = 0;
700
+ function decodeText(ptr, len) {
701
+ numBytesDecoded += len;
702
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
703
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
704
+ cachedTextDecoder.decode();
705
+ numBytesDecoded = len;
706
+ }
707
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
708
+ }
709
+
710
+ const cachedTextEncoder = new TextEncoder();
711
+
712
+ if (!('encodeInto' in cachedTextEncoder)) {
713
+ cachedTextEncoder.encodeInto = function (arg, view) {
714
+ const buf = cachedTextEncoder.encode(arg);
715
+ view.set(buf);
716
+ return {
717
+ read: arg.length,
718
+ written: buf.length
719
+ };
720
+ };
721
+ }
722
+
723
+ let WASM_VECTOR_LEN = 0;
724
+
725
+
726
+ let wasm;
727
+ export function __wbg_set_wasm(val) {
728
+ wasm = val;
729
+ }
Binary file
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "deepwoken",
3
+ "type": "module",
4
+ "version": "0.1.0",
5
+ "files": [
6
+ "deepwoken_bg.wasm",
7
+ "deepwoken.js",
8
+ "deepwoken_bg.js",
9
+ "deepwoken.d.ts"
10
+ ],
11
+ "main": "deepwoken.js",
12
+ "types": "deepwoken.d.ts",
13
+ "sideEffects": [
14
+ "./deepwoken.js",
15
+ "./snippets/*"
16
+ ]
17
+ }