mimium-web 3.2.0 → 4.0.0-alpha

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/mimium_web.d.ts CHANGED
@@ -13,8 +13,9 @@ export class Context {
13
13
  free(): void;
14
14
  get_input_channels(): number;
15
15
  get_output_channels(): number;
16
+ init_github_lib_cache(): Promise<void>;
16
17
  constructor(config: Config);
17
- compile(src: string): void;
18
+ compile(src: string): Promise<void>;
18
19
  /**
19
20
  * .
20
21
  *
@@ -23,7 +24,7 @@ export class Context {
23
24
  * .
24
25
  */
25
26
  process(input: Float32Array, output: Float32Array): bigint;
26
- recompile(src: string): void;
27
+ recompile(src: string): Promise<void>;
27
28
  }
28
29
 
29
30
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -41,12 +42,13 @@ export interface InitOutput {
41
42
  readonly __wbg_set_config_output_channels: (a: number, b: number) => void;
42
43
  readonly __wbg_set_config_sample_rate: (a: number, b: number) => void;
43
44
  readonly config_new: () => number;
44
- readonly context_compile: (a: number, b: number, c: number) => void;
45
+ readonly context_compile: (a: number, b: number, c: number) => any;
45
46
  readonly context_get_input_channels: (a: number) => number;
46
47
  readonly context_get_output_channels: (a: number) => number;
48
+ readonly context_init_github_lib_cache: (a: number) => any;
47
49
  readonly context_new: (a: number) => number;
48
50
  readonly context_process: (a: number, b: number, c: number, d: number, e: number, f: any) => bigint;
49
- readonly context_recompile: (a: number, b: number, c: number) => void;
51
+ readonly context_recompile: (a: number, b: number, c: number) => any;
50
52
  readonly __wbindgen_exn_store: (a: number) => void;
51
53
  readonly __externref_table_alloc: () => number;
52
54
  readonly __wbindgen_export_2: WebAssembly.Table;
@@ -54,9 +56,10 @@ export interface InitOutput {
54
56
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
55
57
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
56
58
  readonly __wbindgen_export_6: WebAssembly.Table;
57
- readonly closure72_externref_shim: (a: number, b: number, c: any) => void;
58
- readonly closure78_externref_shim: (a: number, b: number, c: any) => void;
59
- readonly closure95_externref_shim: (a: number, b: number, c: any, d: any) => void;
59
+ readonly closure80_externref_shim: (a: number, b: number, c: any) => void;
60
+ readonly closure93_externref_shim: (a: number, b: number, c: any) => void;
61
+ readonly closure649_externref_shim: (a: number, b: number, c: any) => void;
62
+ readonly closure662_externref_shim: (a: number, b: number, c: any, d: any) => void;
60
63
  readonly __wbindgen_start: () => void;
61
64
  }
62
65
 
package/mimium_web.js CHANGED
@@ -1,4 +1,4 @@
1
- import { read_file } from './snippets/mimium-lang-acdf782d66cb41e0/src/utils/fileloader.cjs';
1
+ import { preload_mimium_lib_cache, read_file } from './snippets/mimium-lang-53ba5794920c42b3/src/utils/fileloader.cjs';
2
2
 
3
3
  let wasm;
4
4
 
@@ -233,16 +233,20 @@ function passArrayF32ToWasm0(arg, malloc) {
233
233
  WASM_VECTOR_LEN = arg.length;
234
234
  return ptr;
235
235
  }
236
- function __wbg_adapter_18(arg0, arg1, arg2) {
237
- wasm.closure72_externref_shim(arg0, arg1, arg2);
236
+ function __wbg_adapter_22(arg0, arg1, arg2) {
237
+ wasm.closure80_externref_shim(arg0, arg1, arg2);
238
238
  }
239
239
 
240
- function __wbg_adapter_21(arg0, arg1, arg2) {
241
- wasm.closure78_externref_shim(arg0, arg1, arg2);
240
+ function __wbg_adapter_25(arg0, arg1, arg2) {
241
+ wasm.closure93_externref_shim(arg0, arg1, arg2);
242
242
  }
243
243
 
244
- function __wbg_adapter_73(arg0, arg1, arg2, arg3) {
245
- wasm.closure95_externref_shim(arg0, arg1, arg2, arg3);
244
+ function __wbg_adapter_28(arg0, arg1, arg2) {
245
+ wasm.closure649_externref_shim(arg0, arg1, arg2);
246
+ }
247
+
248
+ function __wbg_adapter_87(arg0, arg1, arg2, arg3) {
249
+ wasm.closure662_externref_shim(arg0, arg1, arg2, arg3);
246
250
  }
247
251
 
248
252
  const ConfigFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -362,6 +366,13 @@ export class Context {
362
366
  const ret = wasm.context_get_output_channels(this.__wbg_ptr);
363
367
  return ret >>> 0;
364
368
  }
369
+ /**
370
+ * @returns {Promise<void>}
371
+ */
372
+ init_github_lib_cache() {
373
+ const ret = wasm.context_init_github_lib_cache(this.__wbg_ptr);
374
+ return ret;
375
+ }
365
376
  /**
366
377
  * @param {Config} config
367
378
  */
@@ -375,11 +386,13 @@ export class Context {
375
386
  }
376
387
  /**
377
388
  * @param {string} src
389
+ * @returns {Promise<void>}
378
390
  */
379
391
  compile(src) {
380
392
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
381
393
  const len0 = WASM_VECTOR_LEN;
382
- wasm.context_compile(this.__wbg_ptr, ptr0, len0);
394
+ const ret = wasm.context_compile(this.__wbg_ptr, ptr0, len0);
395
+ return ret;
383
396
  }
384
397
  /**
385
398
  * .
@@ -401,11 +414,13 @@ export class Context {
401
414
  }
402
415
  /**
403
416
  * @param {string} src
417
+ * @returns {Promise<void>}
404
418
  */
405
419
  recompile(src) {
406
420
  const ptr0 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
407
421
  const len0 = WASM_VECTOR_LEN;
408
- wasm.context_recompile(this.__wbg_ptr, ptr0, len0);
422
+ const ret = wasm.context_recompile(this.__wbg_ptr, ptr0, len0);
423
+ return ret;
409
424
  }
410
425
  }
411
426
 
@@ -443,6 +458,10 @@ async function __wbg_load(module, imports) {
443
458
  function __wbg_get_imports() {
444
459
  const imports = {};
445
460
  imports.wbg = {};
461
+ imports.wbg.__wbg_call_500db948e69c7330 = function() { return handleError(function (arg0, arg1, arg2) {
462
+ const ret = arg0.call(arg1, arg2);
463
+ return ret;
464
+ }, arguments) };
446
465
  imports.wbg.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) {
447
466
  const ret = arg0.call(arg1);
448
467
  return ret;
@@ -472,7 +491,7 @@ function __wbg_get_imports() {
472
491
  const a = state0.a;
473
492
  state0.a = 0;
474
493
  try {
475
- return __wbg_adapter_73(a, state0.b, arg0, arg1);
494
+ return __wbg_adapter_87(a, state0.b, arg0, arg1);
476
495
  } finally {
477
496
  state0.a = a;
478
497
  }
@@ -534,6 +553,24 @@ function __wbg_get_imports() {
534
553
  const ret = arg0.navigator;
535
554
  return ret;
536
555
  };
556
+ imports.wbg.__wbg_new_3d446df9155128ef = function(arg0, arg1) {
557
+ try {
558
+ var state0 = {a: arg0, b: arg1};
559
+ var cb0 = (arg0, arg1) => {
560
+ const a = state0.a;
561
+ state0.a = 0;
562
+ try {
563
+ return __wbg_adapter_87(a, state0.b, arg0, arg1);
564
+ } finally {
565
+ state0.a = a;
566
+ }
567
+ };
568
+ const ret = new Promise(cb0);
569
+ return ret;
570
+ } finally {
571
+ state0.a = state0.b = 0;
572
+ }
573
+ };
537
574
  imports.wbg.__wbg_new_688846f374351c92 = function() {
538
575
  const ret = new Object();
539
576
  return ret;
@@ -550,7 +587,18 @@ function __wbg_get_imports() {
550
587
  const ret = arg0.open();
551
588
  return ret;
552
589
  };
553
- imports.wbg.__wbg_readfile_1d383da81336e976 = function() { return handleError(function (arg0, arg1, arg2) {
590
+ imports.wbg.__wbg_preloadmimiumlibcache_9b7f0b92f2d3e780 = function() { return handleError(function (arg0, arg1) {
591
+ const ret = preload_mimium_lib_cache(getStringFromWasm0(arg0, arg1));
592
+ return ret;
593
+ }, arguments) };
594
+ imports.wbg.__wbg_queueMicrotask_2181040e064c0dc8 = function(arg0) {
595
+ queueMicrotask(arg0);
596
+ };
597
+ imports.wbg.__wbg_queueMicrotask_ef9ac43769cbcc4f = function(arg0) {
598
+ const ret = arg0.queueMicrotask;
599
+ return ret;
600
+ };
601
+ imports.wbg.__wbg_readfile_285c1dadce2683a6 = function() { return handleError(function (arg0, arg1, arg2) {
554
602
  const ret = read_file(getStringFromWasm0(arg1, arg2));
555
603
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
556
604
  const len1 = WASM_VECTOR_LEN;
@@ -561,6 +609,10 @@ function __wbg_get_imports() {
561
609
  const ret = arg0.requestMIDIAccess(arg1);
562
610
  return ret;
563
611
  }, arguments) };
612
+ imports.wbg.__wbg_resolve_0bf7c44d641804f9 = function(arg0) {
613
+ const ret = Promise.resolve(arg0);
614
+ return ret;
615
+ };
564
616
  imports.wbg.__wbg_setonmidimessage_cc963fd52d629fb2 = function(arg0, arg1) {
565
617
  arg0.onmidimessage = arg1;
566
618
  };
@@ -590,6 +642,10 @@ function __wbg_get_imports() {
590
642
  const ret = typeof window === 'undefined' ? null : window;
591
643
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
592
644
  };
645
+ imports.wbg.__wbg_then_0438fad860fe38e1 = function(arg0, arg1) {
646
+ const ret = arg0.then(arg1);
647
+ return ret;
648
+ };
593
649
  imports.wbg.__wbg_then_0ffafeddf0e182a4 = function(arg0, arg1, arg2) {
594
650
  const ret = arg0.then(arg1, arg2);
595
651
  return ret;
@@ -607,12 +663,16 @@ function __wbg_get_imports() {
607
663
  const ret = false;
608
664
  return ret;
609
665
  };
610
- imports.wbg.__wbindgen_closure_wrapper219 = function(arg0, arg1, arg2) {
611
- const ret = makeMutClosure(arg0, arg1, 73, __wbg_adapter_18);
666
+ imports.wbg.__wbindgen_closure_wrapper2146 = function(arg0, arg1, arg2) {
667
+ const ret = makeMutClosure(arg0, arg1, 650, __wbg_adapter_28);
668
+ return ret;
669
+ };
670
+ imports.wbg.__wbindgen_closure_wrapper227 = function(arg0, arg1, arg2) {
671
+ const ret = makeMutClosure(arg0, arg1, 81, __wbg_adapter_22);
612
672
  return ret;
613
673
  };
614
- imports.wbg.__wbindgen_closure_wrapper235 = function(arg0, arg1, arg2) {
615
- const ret = makeMutClosure(arg0, arg1, 79, __wbg_adapter_21);
674
+ imports.wbg.__wbindgen_closure_wrapper259 = function(arg0, arg1, arg2) {
675
+ const ret = makeMutClosure(arg0, arg1, 94, __wbg_adapter_25);
616
676
  return ret;
617
677
  };
618
678
  imports.wbg.__wbindgen_copy_to_typed_array = function(arg0, arg1, arg2) {
@@ -635,10 +695,18 @@ function __wbg_get_imports() {
635
695
  table.set(offset + 3, false);
636
696
  ;
637
697
  };
698
+ imports.wbg.__wbindgen_is_function = function(arg0) {
699
+ const ret = typeof(arg0) === 'function';
700
+ return ret;
701
+ };
638
702
  imports.wbg.__wbindgen_is_undefined = function(arg0) {
639
703
  const ret = arg0 === undefined;
640
704
  return ret;
641
705
  };
706
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
707
+ const ret = getStringFromWasm0(arg0, arg1);
708
+ return ret;
709
+ };
642
710
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
643
711
  throw new Error(getStringFromWasm0(arg0, arg1));
644
712
  };
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Tomoya Matsuura <me@matsuuratomoya.com>"
6
6
  ],
7
7
  "description": "mimium wasm binding package.",
8
- "version": "3.2.0",
8
+ "version": "4.0.0-alpha",
9
9
  "license": "MPL-2.0",
10
10
  "repository": {
11
11
  "type": "git",