@morphemeris/armilla-core 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.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -0
  3. package/dist/armilla.d.ts +41 -0
  4. package/dist/armilla.js +98 -0
  5. package/dist/armilla.test.d.ts +1 -0
  6. package/dist/armilla.test.js +160 -0
  7. package/dist/basemap.generated.d.ts +8 -0
  8. package/dist/basemap.generated.js +9 -0
  9. package/dist/basemap.test.d.ts +1 -0
  10. package/dist/basemap.test.js +21 -0
  11. package/dist/index.d.ts +11 -0
  12. package/dist/index.js +11 -0
  13. package/dist/index.test.d.ts +1 -0
  14. package/dist/index.test.js +14 -0
  15. package/dist/index.web.d.ts +3 -0
  16. package/dist/index.web.js +24 -0
  17. package/dist/runtime.d.ts +13 -0
  18. package/dist/runtime.js +20 -0
  19. package/dist/surface.d.ts +10 -0
  20. package/dist/surface.js +9 -0
  21. package/dist/types.d.ts +55 -0
  22. package/dist/types.generated.d.ts +1274 -0
  23. package/dist/types.generated.js +4 -0
  24. package/dist/types.js +24 -0
  25. package/dist/vocabulary.generated.d.ts +8 -0
  26. package/dist/vocabulary.generated.js +9 -0
  27. package/dist/vocabulary.test.d.ts +1 -0
  28. package/dist/vocabulary.test.js +36 -0
  29. package/dist/wasm-types.d.ts +19 -0
  30. package/dist/wasm-types.js +1 -0
  31. package/dist/wasm.d.ts +2 -0
  32. package/dist/wasm.js +16 -0
  33. package/dist/web.test.d.ts +1 -0
  34. package/dist/web.test.js +34 -0
  35. package/dist/workspace.test.d.ts +1 -0
  36. package/dist/workspace.test.js +43 -0
  37. package/docs/changelog.md +37 -0
  38. package/docs/coordinates.md +52 -0
  39. package/docs/themes.md +111 -0
  40. package/docs/vocabulary.json +1501 -0
  41. package/docs/vocabulary.md +86 -0
  42. package/package.json +73 -0
  43. package/wasm/README.md +21 -0
  44. package/wasm/armilla_wasm.d.ts +104 -0
  45. package/wasm/armilla_wasm.js +497 -0
  46. package/wasm/armilla_wasm_bg.wasm +0 -0
  47. package/wasm/armilla_wasm_bg.wasm.d.ts +21 -0
  48. package/wasm/package.json +23 -0
  49. package/wasm-web/README.md +21 -0
  50. package/wasm-web/armilla_wasm.d.ts +150 -0
  51. package/wasm-web/armilla_wasm.js +583 -0
  52. package/wasm-web/armilla_wasm_bg.wasm +0 -0
  53. package/wasm-web/armilla_wasm_bg.wasm.d.ts +21 -0
  54. package/wasm-web/package.json +27 -0
@@ -0,0 +1,583 @@
1
+ /* @ts-self-types="./armilla_wasm.d.ts" */
2
+
3
+ /**
4
+ * Encode a view state as a URL-safe bookmark string (spec §11.5).
5
+ *
6
+ * # Errors
7
+ *
8
+ * The §15 `Error` record as a JSON string when the view state is invalid.
9
+ * @param {string} view_state
10
+ * @returns {string}
11
+ */
12
+ export function bookmark(view_state) {
13
+ let deferred3_0;
14
+ let deferred3_1;
15
+ try {
16
+ const ptr0 = passStringToWasm0(view_state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
17
+ const len0 = WASM_VECTOR_LEN;
18
+ const ret = wasm.bookmark(ptr0, len0);
19
+ var ptr2 = ret[0];
20
+ var len2 = ret[1];
21
+ if (ret[3]) {
22
+ ptr2 = 0; len2 = 0;
23
+ throw takeFromExternrefTable0(ret[2]);
24
+ }
25
+ deferred3_0 = ptr2;
26
+ deferred3_1 = len2;
27
+ return getStringFromWasm0(ptr2, len2);
28
+ } finally {
29
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
30
+ }
31
+ }
32
+
33
+ /**
34
+ * The compiled-in default theme as JSON (spec §10.2).
35
+ * @returns {string}
36
+ */
37
+ export function default_theme() {
38
+ let deferred1_0;
39
+ let deferred1_1;
40
+ try {
41
+ const ret = wasm.default_theme();
42
+ deferred1_0 = ret[0];
43
+ deferred1_1 = ret[1];
44
+ return getStringFromWasm0(ret[0], ret[1]);
45
+ } finally {
46
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Report which rule set a resolved property (spec §13.4).
52
+ *
53
+ * # Errors
54
+ *
55
+ * The §15 `Error` record as a JSON string.
56
+ * @param {string} scene
57
+ * @param {string} theme_chain
58
+ * @param {string} mark_id
59
+ * @param {string} property
60
+ * @returns {string}
61
+ */
62
+ export function explain(scene, theme_chain, mark_id, property) {
63
+ let deferred6_0;
64
+ let deferred6_1;
65
+ try {
66
+ const ptr0 = passStringToWasm0(scene, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
67
+ const len0 = WASM_VECTOR_LEN;
68
+ const ptr1 = passStringToWasm0(theme_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
69
+ const len1 = WASM_VECTOR_LEN;
70
+ const ptr2 = passStringToWasm0(mark_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
71
+ const len2 = WASM_VECTOR_LEN;
72
+ const ptr3 = passStringToWasm0(property, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
73
+ const len3 = WASM_VECTOR_LEN;
74
+ const ret = wasm.explain(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
75
+ var ptr5 = ret[0];
76
+ var len5 = ret[1];
77
+ if (ret[3]) {
78
+ ptr5 = 0; len5 = 0;
79
+ throw takeFromExternrefTable0(ret[2]);
80
+ }
81
+ deferred6_0 = ptr5;
82
+ deferred6_1 = len5;
83
+ return getStringFromWasm0(ptr5, len5);
84
+ } finally {
85
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Lay out a chart input under a theme chain, view state, environment, and
91
+ * panel options; returns the scene as JSON (spec §13.5 `layout`).
92
+ *
93
+ * # Errors
94
+ *
95
+ * The §15 `Error` record as a JSON string.
96
+ * @param {string} chart_input
97
+ * @param {string} theme_chain
98
+ * @param {string} view_state
99
+ * @param {string} environment
100
+ * @param {string} options
101
+ * @returns {string}
102
+ */
103
+ export function layout(chart_input, theme_chain, view_state, environment, options) {
104
+ let deferred7_0;
105
+ let deferred7_1;
106
+ try {
107
+ const ptr0 = passStringToWasm0(chart_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
108
+ const len0 = WASM_VECTOR_LEN;
109
+ const ptr1 = passStringToWasm0(theme_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
110
+ const len1 = WASM_VECTOR_LEN;
111
+ const ptr2 = passStringToWasm0(view_state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
112
+ const len2 = WASM_VECTOR_LEN;
113
+ const ptr3 = passStringToWasm0(environment, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
114
+ const len3 = WASM_VECTOR_LEN;
115
+ const ptr4 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
116
+ const len4 = WASM_VECTOR_LEN;
117
+ const ret = wasm.layout(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
118
+ var ptr6 = ret[0];
119
+ var len6 = ret[1];
120
+ if (ret[3]) {
121
+ ptr6 = 0; len6 = 0;
122
+ throw takeFromExternrefTable0(ret[2]);
123
+ }
124
+ deferred7_0 = ptr6;
125
+ deferred7_1 = len6;
126
+ return getStringFromWasm0(ptr6, len6);
127
+ } finally {
128
+ wasm.__wbindgen_free(deferred7_0, deferred7_1, 1);
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Lint a theme chain; returns the findings as a JSON array (spec §10.7).
134
+ *
135
+ * # Errors
136
+ *
137
+ * The §15 `Error` record as a JSON string when the chain does not parse.
138
+ * @param {string} theme_chain
139
+ * @returns {string}
140
+ */
141
+ export function lint(theme_chain) {
142
+ let deferred3_0;
143
+ let deferred3_1;
144
+ try {
145
+ const ptr0 = passStringToWasm0(theme_chain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
146
+ const len0 = WASM_VECTOR_LEN;
147
+ const ret = wasm.lint(ptr0, len0);
148
+ var ptr2 = ret[0];
149
+ var len2 = ret[1];
150
+ if (ret[3]) {
151
+ ptr2 = 0; len2 = 0;
152
+ throw takeFromExternrefTable0(ret[2]);
153
+ }
154
+ deferred3_0 = ptr2;
155
+ deferred3_1 = len2;
156
+ return getStringFromWasm0(ptr2, len2);
157
+ } finally {
158
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
159
+ }
160
+ }
161
+
162
+ /**
163
+ * Build the map panels' line model (spec §12.2).
164
+ *
165
+ * # Errors
166
+ *
167
+ * The §15 `Error` record as a JSON string.
168
+ * @param {string} chart_input
169
+ * @param {string} view_state
170
+ * @param {string} environment
171
+ * @returns {string}
172
+ */
173
+ export function map_lines(chart_input, view_state, environment) {
174
+ let deferred5_0;
175
+ let deferred5_1;
176
+ try {
177
+ const ptr0 = passStringToWasm0(chart_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
178
+ const len0 = WASM_VECTOR_LEN;
179
+ const ptr1 = passStringToWasm0(view_state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
180
+ const len1 = WASM_VECTOR_LEN;
181
+ const ptr2 = passStringToWasm0(environment, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
182
+ const len2 = WASM_VECTOR_LEN;
183
+ const ret = wasm.map_lines(ptr0, len0, ptr1, len1, ptr2, len2);
184
+ var ptr4 = ret[0];
185
+ var len4 = ret[1];
186
+ if (ret[3]) {
187
+ ptr4 = 0; len4 = 0;
188
+ throw takeFromExternrefTable0(ret[2]);
189
+ }
190
+ deferred5_0 = ptr4;
191
+ deferred5_1 = len4;
192
+ return getStringFromWasm0(ptr4, len4);
193
+ } finally {
194
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
195
+ }
196
+ }
197
+
198
+ /**
199
+ * Migrate a document forward to the current schema version (spec §4.2).
200
+ *
201
+ * # Errors
202
+ *
203
+ * The §15 `Error` record as a JSON string.
204
+ * @param {string} kind
205
+ * @param {string} doc
206
+ * @returns {string}
207
+ */
208
+ export function migrate(kind, doc) {
209
+ let deferred4_0;
210
+ let deferred4_1;
211
+ try {
212
+ const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
213
+ const len0 = WASM_VECTOR_LEN;
214
+ const ptr1 = passStringToWasm0(doc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
215
+ const len1 = WASM_VECTOR_LEN;
216
+ const ret = wasm.migrate(ptr0, len0, ptr1, len1);
217
+ var ptr3 = ret[0];
218
+ var len3 = ret[1];
219
+ if (ret[3]) {
220
+ ptr3 = 0; len3 = 0;
221
+ throw takeFromExternrefTable0(ret[2]);
222
+ }
223
+ deferred4_0 = ptr3;
224
+ deferred4_1 = len3;
225
+ return getStringFromWasm0(ptr3, len3);
226
+ } finally {
227
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Paint a scene as an SVG document string (spec §14).
233
+ *
234
+ * # Errors
235
+ *
236
+ * The §15 `Error` record as a JSON string.
237
+ * @param {string} scene
238
+ * @param {string} pack_manifests
239
+ * @returns {string}
240
+ */
241
+ export function paint_svg(scene, pack_manifests) {
242
+ let deferred4_0;
243
+ let deferred4_1;
244
+ try {
245
+ const ptr0 = passStringToWasm0(scene, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
246
+ const len0 = WASM_VECTOR_LEN;
247
+ const ptr1 = passStringToWasm0(pack_manifests, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
248
+ const len1 = WASM_VECTOR_LEN;
249
+ const ret = wasm.paint_svg(ptr0, len0, ptr1, len1);
250
+ var ptr3 = ret[0];
251
+ var len3 = ret[1];
252
+ if (ret[3]) {
253
+ ptr3 = 0; len3 = 0;
254
+ throw takeFromExternrefTable0(ret[2]);
255
+ }
256
+ deferred4_0 = ptr3;
257
+ deferred4_1 = len3;
258
+ return getStringFromWasm0(ptr3, len3);
259
+ } finally {
260
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
261
+ }
262
+ }
263
+
264
+ /**
265
+ * Build a table panel's row model (spec §12.1).
266
+ *
267
+ * # Errors
268
+ *
269
+ * The §15 `Error` record as a JSON string.
270
+ * @param {string} chart_input
271
+ * @param {string} view_state
272
+ * @param {string} environment
273
+ * @param {string} options
274
+ * @returns {string}
275
+ */
276
+ export function table_rows(chart_input, view_state, environment, options) {
277
+ let deferred6_0;
278
+ let deferred6_1;
279
+ try {
280
+ const ptr0 = passStringToWasm0(chart_input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
+ const len0 = WASM_VECTOR_LEN;
282
+ const ptr1 = passStringToWasm0(view_state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
283
+ const len1 = WASM_VECTOR_LEN;
284
+ const ptr2 = passStringToWasm0(environment, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
285
+ const len2 = WASM_VECTOR_LEN;
286
+ const ptr3 = passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
287
+ const len3 = WASM_VECTOR_LEN;
288
+ const ret = wasm.table_rows(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
289
+ var ptr5 = ret[0];
290
+ var len5 = ret[1];
291
+ if (ret[3]) {
292
+ ptr5 = 0; len5 = 0;
293
+ throw takeFromExternrefTable0(ret[2]);
294
+ }
295
+ deferred6_0 = ptr5;
296
+ deferred6_1 = len5;
297
+ return getStringFromWasm0(ptr5, len5);
298
+ } finally {
299
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
300
+ }
301
+ }
302
+
303
+ /**
304
+ * Decode a bookmark back into a view state as JSON (spec §11.5).
305
+ *
306
+ * # Errors
307
+ *
308
+ * The §15 `Error` record as a JSON string.
309
+ * @param {string} s
310
+ * @returns {string}
311
+ */
312
+ export function unbookmark(s) {
313
+ let deferred3_0;
314
+ let deferred3_1;
315
+ try {
316
+ const ptr0 = passStringToWasm0(s, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
317
+ const len0 = WASM_VECTOR_LEN;
318
+ const ret = wasm.unbookmark(ptr0, len0);
319
+ var ptr2 = ret[0];
320
+ var len2 = ret[1];
321
+ if (ret[3]) {
322
+ ptr2 = 0; len2 = 0;
323
+ throw takeFromExternrefTable0(ret[2]);
324
+ }
325
+ deferred3_0 = ptr2;
326
+ deferred3_1 = len2;
327
+ return getStringFromWasm0(ptr2, len2);
328
+ } finally {
329
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
330
+ }
331
+ }
332
+
333
+ /**
334
+ * Parse and validate a workspace document, returning it normalized
335
+ * (spec §12): hosts consume workspaces; the core only checks them.
336
+ *
337
+ * # Errors
338
+ *
339
+ * The §15 `Error` record as a JSON string.
340
+ * @param {string} workspace
341
+ * @returns {string}
342
+ */
343
+ export function validate_workspace(workspace) {
344
+ let deferred3_0;
345
+ let deferred3_1;
346
+ try {
347
+ const ptr0 = passStringToWasm0(workspace, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
348
+ const len0 = WASM_VECTOR_LEN;
349
+ const ret = wasm.validate_workspace(ptr0, len0);
350
+ var ptr2 = ret[0];
351
+ var len2 = ret[1];
352
+ if (ret[3]) {
353
+ ptr2 = 0; len2 = 0;
354
+ throw takeFromExternrefTable0(ret[2]);
355
+ }
356
+ deferred3_0 = ptr2;
357
+ deferred3_1 = len2;
358
+ return getStringFromWasm0(ptr2, len2);
359
+ } finally {
360
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
361
+ }
362
+ }
363
+
364
+ /**
365
+ * The core version, for provenance and binding checks.
366
+ * @returns {string}
367
+ */
368
+ export function version() {
369
+ let deferred1_0;
370
+ let deferred1_1;
371
+ try {
372
+ const ret = wasm.version();
373
+ deferred1_0 = ret[0];
374
+ deferred1_1 = ret[1];
375
+ return getStringFromWasm0(ret[0], ret[1]);
376
+ } finally {
377
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
378
+ }
379
+ }
380
+ function __wbg_get_imports() {
381
+ const import0 = {
382
+ __proto__: null,
383
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
384
+ // Cast intrinsic for `Ref(String) -> Externref`.
385
+ const ret = getStringFromWasm0(arg0, arg1);
386
+ return ret;
387
+ },
388
+ __wbindgen_init_externref_table: function() {
389
+ const table = wasm.__wbindgen_externrefs;
390
+ const offset = table.grow(4);
391
+ table.set(0, undefined);
392
+ table.set(offset + 0, undefined);
393
+ table.set(offset + 1, null);
394
+ table.set(offset + 2, true);
395
+ table.set(offset + 3, false);
396
+ },
397
+ };
398
+ return {
399
+ __proto__: null,
400
+ "./armilla_wasm_bg.js": import0,
401
+ };
402
+ }
403
+
404
+ function getStringFromWasm0(ptr, len) {
405
+ return decodeText(ptr >>> 0, len);
406
+ }
407
+
408
+ let cachedUint8ArrayMemory0 = null;
409
+ function getUint8ArrayMemory0() {
410
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
411
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
412
+ }
413
+ return cachedUint8ArrayMemory0;
414
+ }
415
+
416
+ function passStringToWasm0(arg, malloc, realloc) {
417
+ if (realloc === undefined) {
418
+ const buf = cachedTextEncoder.encode(arg);
419
+ const ptr = malloc(buf.length, 1) >>> 0;
420
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
421
+ WASM_VECTOR_LEN = buf.length;
422
+ return ptr;
423
+ }
424
+
425
+ let len = arg.length;
426
+ let ptr = malloc(len, 1) >>> 0;
427
+
428
+ const mem = getUint8ArrayMemory0();
429
+
430
+ let offset = 0;
431
+
432
+ for (; offset < len; offset++) {
433
+ const code = arg.charCodeAt(offset);
434
+ if (code > 0x7F) break;
435
+ mem[ptr + offset] = code;
436
+ }
437
+ if (offset !== len) {
438
+ if (offset !== 0) {
439
+ arg = arg.slice(offset);
440
+ }
441
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
442
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
443
+ const ret = cachedTextEncoder.encodeInto(arg, view);
444
+
445
+ offset += ret.written;
446
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
447
+ }
448
+
449
+ WASM_VECTOR_LEN = offset;
450
+ return ptr;
451
+ }
452
+
453
+ function takeFromExternrefTable0(idx) {
454
+ const value = wasm.__wbindgen_externrefs.get(idx);
455
+ wasm.__externref_table_dealloc(idx);
456
+ return value;
457
+ }
458
+
459
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
460
+ cachedTextDecoder.decode();
461
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
462
+ let numBytesDecoded = 0;
463
+ function decodeText(ptr, len) {
464
+ numBytesDecoded += len;
465
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
466
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
467
+ cachedTextDecoder.decode();
468
+ numBytesDecoded = len;
469
+ }
470
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
471
+ }
472
+
473
+ const cachedTextEncoder = new TextEncoder();
474
+
475
+ if (!('encodeInto' in cachedTextEncoder)) {
476
+ cachedTextEncoder.encodeInto = function (arg, view) {
477
+ const buf = cachedTextEncoder.encode(arg);
478
+ view.set(buf);
479
+ return {
480
+ read: arg.length,
481
+ written: buf.length
482
+ };
483
+ };
484
+ }
485
+
486
+ let WASM_VECTOR_LEN = 0;
487
+
488
+ let wasmModule, wasmInstance, wasm;
489
+ function __wbg_finalize_init(instance, module) {
490
+ wasmInstance = instance;
491
+ wasm = instance.exports;
492
+ wasmModule = module;
493
+ cachedUint8ArrayMemory0 = null;
494
+ wasm.__wbindgen_start();
495
+ return wasm;
496
+ }
497
+
498
+ async function __wbg_load(module, imports) {
499
+ if (typeof Response === 'function' && module instanceof Response) {
500
+ if (!module.ok) {
501
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
502
+ }
503
+
504
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
505
+ try {
506
+ return await WebAssembly.instantiateStreaming(module, imports);
507
+ } catch (e) {
508
+ const validResponse = expectedResponseType(module.type);
509
+
510
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
511
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
512
+
513
+ } else { throw e; }
514
+ }
515
+ }
516
+
517
+ const bytes = await module.arrayBuffer();
518
+ return await WebAssembly.instantiate(bytes, imports);
519
+ } else {
520
+ const instance = await WebAssembly.instantiate(module, imports);
521
+
522
+ if (instance instanceof WebAssembly.Instance) {
523
+ return { instance, module };
524
+ } else {
525
+ return instance;
526
+ }
527
+ }
528
+
529
+ function expectedResponseType(type) {
530
+ switch (type) {
531
+ case 'basic': case 'cors': case 'default': return true;
532
+ }
533
+ return false;
534
+ }
535
+ }
536
+
537
+ function initSync(module) {
538
+ if (wasm !== undefined) return wasm;
539
+
540
+
541
+ if (module !== undefined) {
542
+ if (Object.getPrototypeOf(module) === Object.prototype) {
543
+ ({module} = module)
544
+ } else {
545
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
546
+ }
547
+ }
548
+
549
+ const imports = __wbg_get_imports();
550
+ if (!(module instanceof WebAssembly.Module)) {
551
+ module = new WebAssembly.Module(module);
552
+ }
553
+ const instance = new WebAssembly.Instance(module, imports);
554
+ return __wbg_finalize_init(instance, module);
555
+ }
556
+
557
+ async function __wbg_init(module_or_path) {
558
+ if (wasm !== undefined) return wasm;
559
+
560
+
561
+ if (module_or_path !== undefined) {
562
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
563
+ ({module_or_path} = module_or_path)
564
+ } else {
565
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
566
+ }
567
+ }
568
+
569
+ if (module_or_path === undefined) {
570
+ module_or_path = new URL('armilla_wasm_bg.wasm', import.meta.url);
571
+ }
572
+ const imports = __wbg_get_imports();
573
+
574
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
575
+ module_or_path = fetch(module_or_path);
576
+ }
577
+
578
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
579
+
580
+ return __wbg_finalize_init(instance, module);
581
+ }
582
+
583
+ export { initSync, __wbg_init as default };
Binary file
@@ -0,0 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const bookmark: (a: number, b: number) => [number, number, number, number];
5
+ export const default_theme: () => [number, number];
6
+ export const explain: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
7
+ export const layout: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number, number];
8
+ export const lint: (a: number, b: number) => [number, number, number, number];
9
+ export const map_lines: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
10
+ export const migrate: (a: number, b: number, c: number, d: number) => [number, number, number, number];
11
+ export const paint_svg: (a: number, b: number, c: number, d: number) => [number, number, number, number];
12
+ export const table_rows: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
13
+ export const unbookmark: (a: number, b: number) => [number, number, number, number];
14
+ export const validate_workspace: (a: number, b: number) => [number, number, number, number];
15
+ export const version: () => [number, number];
16
+ export const __wbindgen_externrefs: WebAssembly.Table;
17
+ export const __wbindgen_malloc: (a: number, b: number) => number;
18
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
19
+ export const __externref_table_dealloc: (a: number) => void;
20
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
21
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "armilla-wasm",
3
+ "type": "module",
4
+ "description": "armilla WASM exports: layout, lint, migrate, bookmark, explain, default_theme, paint_svg",
5
+ "version": "0.0.0",
6
+ "license": "UNLICENSED",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/morphatic/armilla"
10
+ },
11
+ "files": [
12
+ "armilla_wasm_bg.wasm",
13
+ "armilla_wasm.js",
14
+ "armilla_wasm.d.ts"
15
+ ],
16
+ "main": "armilla_wasm.js",
17
+ "types": "armilla_wasm.d.ts",
18
+ "sideEffects": [
19
+ "./snippets/*"
20
+ ],
21
+ "keywords": [
22
+ "astrology",
23
+ "chart",
24
+ "svg",
25
+ "layout"
26
+ ]
27
+ }