@applemusic-like-lyrics/lyric 0.0.1 → 0.0.3

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/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Lyric parser/writer for AMLL
2
2
 
3
+ > 警告:此为个人项目,且尚未完成开发,可能仍有大量问题,所以请勿直接用于生产环境!
4
+
5
+ ![AMLL-Lyric](https://img.shields.io/badge/Lyric-%23FB8C84?label=Apple%20Music-like%20Lyrics&labelColor=%23FB5C74)
6
+ [![npm](https://img.shields.io/npm/dt/%40applemusic-like-lyrics/lyric)](https://www.npmjs.com/package/@applemusic-like-lyrics/lyric)
7
+ [![npm](https://img.shields.io/npm/v/%40applemusic-like-lyrics%2Flyric)](https://www.npmjs.com/package/@applemusic-like-lyrics/lyric)
8
+
3
9
  一个 AMLL 的歌词解析/生成模块,使用 Rust 编写,并通过 `wasm-pack`
4
10
  构建成 WASM 模块以提供给其他项目使用。
5
11
 
@@ -17,3 +23,36 @@
17
23
  - QQ 音乐逐词歌词格式 `.qrc`
18
24
  - Lyricify Syllable 逐词歌词格式 `.lys`
19
25
  - ASS 字幕格式 `.ass`
26
+
27
+ ## 与 Core 歌词组件一起使用
28
+
29
+ 在和二者合用的时候,需要注意**两者的歌词行结构并不完全相同**,需要进行诸如(以 LyRiC 举例)下面的方式进行转换方可被歌词组件正确解析:
30
+
31
+ ```typescript
32
+ import { parseLrc } from "@applemusic-like-lyrics/lyric";
33
+ const lines = parseLrc("[00:00.00]test");
34
+ const converted = lines.map((line, i, lines) => ({
35
+ words: [
36
+ {
37
+ word: line.words[0]?.word ?? "",
38
+ startTime: line.words[0]?.startTime ?? 0,
39
+ endTime: lines[i + 1]?.words?.[0]?.startTime ?? Infinity,
40
+ },
41
+ ],
42
+ startTime: line.words[0]?.startTime ?? 0,
43
+ endTime: lines[i + 1]?.words?.[0]?.startTime ?? Infinity,
44
+ translatedLyric: "",
45
+ romanLyric: "",
46
+ isBG: false,
47
+ isDuet: false,
48
+ }));
49
+ // 此时就可以将 converted 传给 LyricPlayer 了
50
+ ```
51
+
52
+ 推荐使用 TypeScript,这样可以更方便地查错。
53
+
54
+ ## 构建
55
+
56
+ ```shell
57
+ wasm-pack build --target bundler --release --scope applemusic-like-lyrics
58
+ ```
package/package.json CHANGED
@@ -4,17 +4,25 @@
4
4
  "SteveXMH <39523898+Steve-xmh@users.noreply.github.com>"
5
5
  ],
6
6
  "description": "一个歌词解析/生成模块,着重于歌词内容解析,支持多种格式",
7
- "version": "0.0.1",
7
+ "version": "0.0.3",
8
+ "license": "GPL-3.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/Steve-xmh/applemusic-like-lyrics"
12
+ },
13
+ "scripts": {
14
+ "build": "wasm-pack build --release",
15
+ "build:dev": "wasm-pack build --dev"
16
+ },
8
17
  "files": [
9
- "lyric_bg.wasm",
10
- "lyric.js",
11
- "lyric_bg.js",
12
- "lyric.d.ts"
18
+ "pkg/*.wasm",
19
+ "pkg/*.js",
20
+ "pkg/*.d.ts"
13
21
  ],
14
- "module": "lyric.js",
15
- "types": "lyric.d.ts",
22
+ "module": "pkg/lyric.js",
23
+ "types": "pkg/lyric.d.ts",
16
24
  "sideEffects": [
17
- "./lyric.js",
18
- "./snippets/*"
25
+ "./pkg/lyric.js",
26
+ "./pkg/snippets/*"
19
27
  ]
20
28
  }
@@ -10,7 +10,6 @@
10
10
  */
11
11
  export function set_panic_hook(): void;
12
12
 
13
-
14
13
  /**
15
14
  * 解析 LyRiC 格式的歌词字符串
16
15
  * @param src 歌词字符串
@@ -90,7 +89,7 @@ export interface LyricWord {
90
89
  endTime: number;
91
90
  /** 单词 */
92
91
  word: string;
93
- };
92
+ }
94
93
 
95
94
  /**
96
95
  * 一行歌词,存储多个单词
@@ -112,7 +111,14 @@ export interface LyricLine {
112
111
  * 此选项只有作为 Lyricify Syllable 文件格式导入导出时才有意义
113
112
  */
114
113
  isDuet?: boolean;
115
- };
114
+ }
116
115
 
116
+ /**
117
+ * 解密十六进制字符串格式的 Qrc 歌词数据
118
+ * 解密后可去头尾 XML 数据后通过调用 `parseQrc` 解析歌词行
119
+ * @param hexData 十六进制格式的字符串,代表被加密的歌词数据
120
+ * @returns 被解密出来的歌词字符串,是前后有 XML 混合的 QRC 歌词
121
+ */
122
+ export function decryptQrcHex(hexData: string): string;
117
123
 
118
124
 
@@ -4,53 +4,53 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
- const heap = new Array(128).fill(undefined);
7
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
8
8
 
9
- heap.push(undefined, null, true, false);
9
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
10
10
 
11
- function getObject(idx) { return heap[idx]; }
11
+ cachedTextDecoder.decode();
12
12
 
13
- let heap_next = heap.length;
13
+ let cachedUint8Memory0 = null;
14
14
 
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
15
+ function getUint8Memory0() {
16
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
17
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
18
+ }
19
+ return cachedUint8Memory0;
19
20
  }
20
21
 
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
22
+ function getStringFromWasm0(ptr, len) {
23
+ ptr = ptr >>> 0;
24
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
25
25
  }
26
26
 
27
+ const heap = new Array(128).fill(undefined);
28
+
29
+ heap.push(undefined, null, true, false);
30
+
31
+ let heap_next = heap.length;
32
+
27
33
  function addHeapObject(obj) {
28
34
  if (heap_next === heap.length) heap.push(heap.length + 1);
29
35
  const idx = heap_next;
30
36
  heap_next = heap[idx];
31
37
 
38
+ if (typeof(heap_next) !== 'number') throw new Error('corrupt heap');
39
+
32
40
  heap[idx] = obj;
33
41
  return idx;
34
42
  }
35
43
 
36
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
37
-
38
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
39
-
40
- cachedTextDecoder.decode();
41
-
42
- let cachedUint8Memory0 = null;
44
+ function getObject(idx) { return heap[idx]; }
43
45
 
44
- function getUint8Memory0() {
45
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
46
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
46
+ function _assertBoolean(n) {
47
+ if (typeof(n) !== 'boolean') {
48
+ throw new Error('expected a boolean argument');
47
49
  }
48
- return cachedUint8Memory0;
49
50
  }
50
51
 
51
- function getStringFromWasm0(ptr, len) {
52
- ptr = ptr >>> 0;
53
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
52
+ function _assertNum(n) {
53
+ if (typeof(n) !== 'number') throw new Error('expected a number argument');
54
54
  }
55
55
 
56
56
  let WASM_VECTOR_LEN = 0;
@@ -74,6 +74,8 @@ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
74
74
 
75
75
  function passStringToWasm0(arg, malloc, realloc) {
76
76
 
77
+ if (typeof(arg) !== 'string') throw new Error('expected a string argument');
78
+
77
79
  if (realloc === undefined) {
78
80
  const buf = cachedTextEncoder.encode(arg);
79
81
  const ptr = malloc(buf.length, 1) >>> 0;
@@ -102,7 +104,7 @@ function passStringToWasm0(arg, malloc, realloc) {
102
104
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
103
105
  const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
104
106
  const ret = encodeString(arg, view);
105
-
107
+ if (ret.read !== arg.length) throw new Error('failed to pass whole string');
106
108
  offset += ret.written;
107
109
  }
108
110
 
@@ -123,6 +125,18 @@ function getInt32Memory0() {
123
125
  return cachedInt32Memory0;
124
126
  }
125
127
 
128
+ function dropObject(idx) {
129
+ if (idx < 132) return;
130
+ heap[idx] = heap_next;
131
+ heap_next = idx;
132
+ }
133
+
134
+ function takeObject(idx) {
135
+ const ret = getObject(idx);
136
+ dropObject(idx);
137
+ return ret;
138
+ }
139
+
126
140
  let cachedFloat64Memory0 = null;
127
141
 
128
142
  function getFloat64Memory0() {
@@ -132,15 +146,6 @@ function getFloat64Memory0() {
132
146
  return cachedFloat64Memory0;
133
147
  }
134
148
 
135
- let cachedBigInt64Memory0 = null;
136
-
137
- function getBigInt64Memory0() {
138
- if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
139
- cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
140
- }
141
- return cachedBigInt64Memory0;
142
- }
143
-
144
149
  function debugString(val) {
145
150
  // primitive types
146
151
  const type = typeof val;
@@ -205,6 +210,31 @@ function debugString(val) {
205
210
  // TODO we could test for more things here, like `Set`s and `Map`s.
206
211
  return className;
207
212
  }
213
+
214
+ function _assertBigInt(n) {
215
+ if (typeof(n) !== 'bigint') throw new Error('expected a bigint argument');
216
+ }
217
+
218
+ let cachedBigInt64Memory0 = null;
219
+
220
+ function getBigInt64Memory0() {
221
+ if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
222
+ cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
223
+ }
224
+ return cachedBigInt64Memory0;
225
+ }
226
+ /**
227
+ * When the `console_error_panic_hook` feature is enabled, we can call the
228
+ * `set_panic_hook` function at least once during initialization, and then
229
+ * we will get better error messages if our code ever panics.
230
+ *
231
+ * For more details see
232
+ * https://github.com/rustwasm/console_error_panic_hook#readme
233
+ */
234
+ export function set_panic_hook() {
235
+ wasm.set_panic_hook();
236
+ }
237
+
208
238
  /**
209
239
  * @param {string} src
210
240
  * @returns {any}
@@ -270,15 +300,47 @@ export function stringifyQrc(lrc) {
270
300
  }
271
301
 
272
302
  /**
273
- * When the `console_error_panic_hook` feature is enabled, we can call the
274
- * `set_panic_hook` function at least once during initialization, and then
275
- * we will get better error messages if our code ever panics.
276
- *
277
- * For more details see
278
- * https://github.com/rustwasm/console_error_panic_hook#readme
303
+ * @param {any} lrc
304
+ * @returns {string}
279
305
  */
280
- export function set_panic_hook() {
281
- wasm.set_panic_hook();
306
+ export function stringifyAss(lrc) {
307
+ let deferred1_0;
308
+ let deferred1_1;
309
+ try {
310
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
311
+ wasm.stringifyAss(retptr, addHeapObject(lrc));
312
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
313
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
314
+ deferred1_0 = r0;
315
+ deferred1_1 = r1;
316
+ return getStringFromWasm0(r0, r1);
317
+ } finally {
318
+ wasm.__wbindgen_add_to_stack_pointer(16);
319
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
320
+ }
321
+ }
322
+
323
+ /**
324
+ * @param {string} hex_data
325
+ * @returns {string}
326
+ */
327
+ export function decryptQrcHex(hex_data) {
328
+ let deferred2_0;
329
+ let deferred2_1;
330
+ try {
331
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
332
+ const ptr0 = passStringToWasm0(hex_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
333
+ const len0 = WASM_VECTOR_LEN;
334
+ wasm.decryptQrcHex(retptr, ptr0, len0);
335
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
336
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
337
+ deferred2_0 = r0;
338
+ deferred2_1 = r1;
339
+ return getStringFromWasm0(r0, r1);
340
+ } finally {
341
+ wasm.__wbindgen_add_to_stack_pointer(16);
342
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
343
+ }
282
344
  }
283
345
 
284
346
  /**
@@ -345,24 +407,19 @@ export function stringifyLys(lrc) {
345
407
  }
346
408
  }
347
409
 
348
- /**
349
- * @param {any} lrc
350
- * @returns {string}
351
- */
352
- export function stringifyAss(lrc) {
353
- let deferred1_0;
354
- let deferred1_1;
410
+ function logError(f, args) {
355
411
  try {
356
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
357
- wasm.stringifyAss(retptr, addHeapObject(lrc));
358
- var r0 = getInt32Memory0()[retptr / 4 + 0];
359
- var r1 = getInt32Memory0()[retptr / 4 + 1];
360
- deferred1_0 = r0;
361
- deferred1_1 = r1;
362
- return getStringFromWasm0(r0, r1);
363
- } finally {
364
- wasm.__wbindgen_add_to_stack_pointer(16);
365
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
412
+ return f.apply(this, args);
413
+ } catch (e) {
414
+ let error = (function () {
415
+ try {
416
+ return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString();
417
+ } catch(_) {
418
+ return "<failed to stringify thrown value>";
419
+ }
420
+ }());
421
+ console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error);
422
+ throw e;
366
423
  }
367
424
  }
368
425
 
@@ -374,46 +431,35 @@ function handleError(f, args) {
374
431
  }
375
432
  }
376
433
 
377
- export function __wbindgen_object_drop_ref(arg0) {
378
- takeObject(arg0);
379
- };
380
-
381
- export function __wbindgen_is_bigint(arg0) {
382
- const ret = typeof(getObject(arg0)) === 'bigint';
383
- return ret;
384
- };
385
-
386
- export function __wbindgen_bigint_from_u64(arg0) {
387
- const ret = BigInt.asUintN(64, arg0);
388
- return addHeapObject(ret);
389
- };
390
-
391
- export function __wbindgen_jsval_eq(arg0, arg1) {
392
- const ret = getObject(arg0) === getObject(arg1);
393
- return ret;
394
- };
395
-
396
434
  export function __wbindgen_error_new(arg0, arg1) {
397
435
  const ret = new Error(getStringFromWasm0(arg0, arg1));
398
436
  return addHeapObject(ret);
399
437
  };
400
438
 
401
- export function __wbindgen_is_object(arg0) {
402
- const val = getObject(arg0);
403
- const ret = typeof(val) === 'object' && val !== null;
404
- return ret;
405
- };
406
-
407
439
  export function __wbindgen_is_undefined(arg0) {
408
440
  const ret = getObject(arg0) === undefined;
441
+ _assertBoolean(ret);
409
442
  return ret;
410
443
  };
411
444
 
412
445
  export function __wbindgen_in(arg0, arg1) {
413
446
  const ret = getObject(arg0) in getObject(arg1);
447
+ _assertBoolean(ret);
414
448
  return ret;
415
449
  };
416
450
 
451
+ export function __wbindgen_boolean_get(arg0) {
452
+ const v = getObject(arg0);
453
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
454
+ _assertNum(ret);
455
+ return ret;
456
+ };
457
+
458
+ export function __wbindgen_string_new(arg0, arg1) {
459
+ const ret = getStringFromWasm0(arg0, arg1);
460
+ return addHeapObject(ret);
461
+ };
462
+
417
463
  export function __wbindgen_string_get(arg0, arg1) {
418
464
  const obj = getObject(arg1);
419
465
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -423,26 +469,35 @@ export function __wbindgen_string_get(arg0, arg1) {
423
469
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
424
470
  };
425
471
 
426
- export function __wbindgen_boolean_get(arg0) {
427
- const v = getObject(arg0);
428
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
472
+ export function __wbindgen_is_bigint(arg0) {
473
+ const ret = typeof(getObject(arg0)) === 'bigint';
474
+ _assertBoolean(ret);
429
475
  return ret;
430
476
  };
431
477
 
432
- export function __wbg_new_abda76e883ba8a5f() {
433
- const ret = new Error();
478
+ export function __wbindgen_is_object(arg0) {
479
+ const val = getObject(arg0);
480
+ const ret = typeof(val) === 'object' && val !== null;
481
+ _assertBoolean(ret);
482
+ return ret;
483
+ };
484
+
485
+ export function __wbindgen_jsval_eq(arg0, arg1) {
486
+ const ret = getObject(arg0) === getObject(arg1);
487
+ _assertBoolean(ret);
488
+ return ret;
489
+ };
490
+
491
+ export function __wbindgen_bigint_from_u64(arg0) {
492
+ const ret = BigInt.asUintN(64, arg0);
434
493
  return addHeapObject(ret);
435
494
  };
436
495
 
437
- export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
438
- const ret = getObject(arg1).stack;
439
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
440
- const len1 = WASM_VECTOR_LEN;
441
- getInt32Memory0()[arg0 / 4 + 1] = len1;
442
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
496
+ export function __wbindgen_object_drop_ref(arg0) {
497
+ takeObject(arg0);
443
498
  };
444
499
 
445
- export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
500
+ export function __wbg_error_f851667af71bcfc6() { return logError(function (arg0, arg1) {
446
501
  let deferred0_0;
447
502
  let deferred0_1;
448
503
  try {
@@ -452,16 +507,36 @@ export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
452
507
  } finally {
453
508
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
454
509
  }
455
- };
510
+ }, arguments) };
456
511
 
457
- export function __wbindgen_jsval_loose_eq(arg0, arg1) {
458
- const ret = getObject(arg0) == getObject(arg1);
459
- return ret;
460
- };
512
+ export function __wbg_new_abda76e883ba8a5f() { return logError(function () {
513
+ const ret = new Error();
514
+ return addHeapObject(ret);
515
+ }, arguments) };
516
+
517
+ export function __wbg_stack_658279fe44541cf6() { return logError(function (arg0, arg1) {
518
+ const ret = getObject(arg1).stack;
519
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
520
+ const len1 = WASM_VECTOR_LEN;
521
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
522
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
523
+ }, arguments) };
524
+
525
+ export function __wbg_getwithrefkey_5e6d9547403deab8() { return logError(function (arg0, arg1) {
526
+ const ret = getObject(arg0)[getObject(arg1)];
527
+ return addHeapObject(ret);
528
+ }, arguments) };
529
+
530
+ export function __wbg_set_841ac57cff3d672b() { return logError(function (arg0, arg1, arg2) {
531
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
532
+ }, arguments) };
461
533
 
462
534
  export function __wbindgen_number_get(arg0, arg1) {
463
535
  const obj = getObject(arg1);
464
536
  const ret = typeof(obj) === 'number' ? obj : undefined;
537
+ if (!isLikeNone(ret)) {
538
+ _assertNum(ret);
539
+ }
465
540
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
466
541
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
467
542
  };
@@ -471,146 +546,139 @@ export function __wbindgen_number_new(arg0) {
471
546
  return addHeapObject(ret);
472
547
  };
473
548
 
549
+ export function __wbindgen_jsval_loose_eq(arg0, arg1) {
550
+ const ret = getObject(arg0) == getObject(arg1);
551
+ _assertBoolean(ret);
552
+ return ret;
553
+ };
554
+
474
555
  export function __wbindgen_object_clone_ref(arg0) {
475
556
  const ret = getObject(arg0);
476
557
  return addHeapObject(ret);
477
558
  };
478
559
 
479
- export function __wbindgen_string_new(arg0, arg1) {
480
- const ret = getStringFromWasm0(arg0, arg1);
560
+ export function __wbg_new_898a68150f225f2e() { return logError(function () {
561
+ const ret = new Array();
481
562
  return addHeapObject(ret);
482
- };
563
+ }, arguments) };
483
564
 
484
- export function __wbg_getwithrefkey_5e6d9547403deab8(arg0, arg1) {
485
- const ret = getObject(arg0)[getObject(arg1)];
565
+ export function __wbg_get_44be0491f933a435() { return logError(function (arg0, arg1) {
566
+ const ret = getObject(arg0)[arg1 >>> 0];
486
567
  return addHeapObject(ret);
487
- };
568
+ }, arguments) };
488
569
 
489
- export function __wbg_set_841ac57cff3d672b(arg0, arg1, arg2) {
490
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
491
- };
570
+ export function __wbg_set_502d29070ea18557() { return logError(function (arg0, arg1, arg2) {
571
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
572
+ }, arguments) };
492
573
 
493
- export function __wbg_get_44be0491f933a435(arg0, arg1) {
494
- const ret = getObject(arg0)[arg1 >>> 0];
495
- return addHeapObject(ret);
496
- };
574
+ export function __wbg_isArray_4c24b343cb13cfb1() { return logError(function (arg0) {
575
+ const ret = Array.isArray(getObject(arg0));
576
+ _assertBoolean(ret);
577
+ return ret;
578
+ }, arguments) };
497
579
 
498
- export function __wbg_length_fff51ee6522a1a18(arg0) {
580
+ export function __wbg_length_fff51ee6522a1a18() { return logError(function (arg0) {
499
581
  const ret = getObject(arg0).length;
582
+ _assertNum(ret);
500
583
  return ret;
501
- };
502
-
503
- export function __wbg_new_898a68150f225f2e() {
504
- const ret = new Array();
505
- return addHeapObject(ret);
506
- };
584
+ }, arguments) };
507
585
 
508
- export function __wbindgen_is_function(arg0) {
509
- const ret = typeof(getObject(arg0)) === 'function';
586
+ export function __wbg_instanceof_ArrayBuffer_39ac22089b74fddb() { return logError(function (arg0) {
587
+ let result;
588
+ try {
589
+ result = getObject(arg0) instanceof ArrayBuffer;
590
+ } catch {
591
+ result = false;
592
+ }
593
+ const ret = result;
594
+ _assertBoolean(ret);
510
595
  return ret;
511
- };
596
+ }, arguments) };
512
597
 
513
- export function __wbg_next_526fc47e980da008(arg0) {
514
- const ret = getObject(arg0).next;
598
+ export function __wbg_call_cb65541d95d71282() { return handleError(function (arg0, arg1) {
599
+ const ret = getObject(arg0).call(getObject(arg1));
515
600
  return addHeapObject(ret);
516
- };
601
+ }, arguments) };
517
602
 
518
603
  export function __wbg_next_ddb3312ca1c4e32a() { return handleError(function (arg0) {
519
604
  const ret = getObject(arg0).next();
520
605
  return addHeapObject(ret);
521
606
  }, arguments) };
522
607
 
523
- export function __wbg_done_5c1f01fb660d73b5(arg0) {
608
+ export function __wbg_next_526fc47e980da008() { return logError(function (arg0) {
609
+ const ret = getObject(arg0).next;
610
+ return addHeapObject(ret);
611
+ }, arguments) };
612
+
613
+ export function __wbg_done_5c1f01fb660d73b5() { return logError(function (arg0) {
524
614
  const ret = getObject(arg0).done;
615
+ _assertBoolean(ret);
525
616
  return ret;
526
- };
617
+ }, arguments) };
527
618
 
528
- export function __wbg_value_1695675138684bd5(arg0) {
619
+ export function __wbg_value_1695675138684bd5() { return logError(function (arg0) {
529
620
  const ret = getObject(arg0).value;
530
621
  return addHeapObject(ret);
531
- };
532
-
533
- export function __wbg_iterator_97f0c81209c6c35a() {
534
- const ret = Symbol.iterator;
535
- return addHeapObject(ret);
536
- };
537
-
538
- export function __wbg_get_97b561fb56f034b5() { return handleError(function (arg0, arg1) {
539
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
540
- return addHeapObject(ret);
541
622
  }, arguments) };
542
623
 
543
- export function __wbg_call_cb65541d95d71282() { return handleError(function (arg0, arg1) {
544
- const ret = getObject(arg0).call(getObject(arg1));
545
- return addHeapObject(ret);
624
+ export function __wbg_isSafeInteger_bb8e18dd21c97288() { return logError(function (arg0) {
625
+ const ret = Number.isSafeInteger(getObject(arg0));
626
+ _assertBoolean(ret);
627
+ return ret;
546
628
  }, arguments) };
547
629
 
548
- export function __wbg_new_b51585de1b234aff() {
630
+ export function __wbg_new_b51585de1b234aff() { return logError(function () {
549
631
  const ret = new Object();
550
632
  return addHeapObject(ret);
551
- };
552
-
553
- export function __wbg_set_502d29070ea18557(arg0, arg1, arg2) {
554
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
555
- };
633
+ }, arguments) };
556
634
 
557
- export function __wbg_isArray_4c24b343cb13cfb1(arg0) {
558
- const ret = Array.isArray(getObject(arg0));
559
- return ret;
560
- };
635
+ export function __wbg_iterator_97f0c81209c6c35a() { return logError(function () {
636
+ const ret = Symbol.iterator;
637
+ return addHeapObject(ret);
638
+ }, arguments) };
561
639
 
562
- export function __wbg_instanceof_ArrayBuffer_39ac22089b74fddb(arg0) {
640
+ export function __wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4() { return logError(function (arg0) {
563
641
  let result;
564
642
  try {
565
- result = getObject(arg0) instanceof ArrayBuffer;
643
+ result = getObject(arg0) instanceof Uint8Array;
566
644
  } catch {
567
645
  result = false;
568
646
  }
569
647
  const ret = result;
648
+ _assertBoolean(ret);
570
649
  return ret;
571
- };
572
-
573
- export function __wbg_isSafeInteger_bb8e18dd21c97288(arg0) {
574
- const ret = Number.isSafeInteger(getObject(arg0));
575
- return ret;
576
- };
577
-
578
- export function __wbg_buffer_085ec1f694018c4f(arg0) {
579
- const ret = getObject(arg0).buffer;
580
- return addHeapObject(ret);
581
- };
650
+ }, arguments) };
582
651
 
583
- export function __wbg_new_8125e318e6245eed(arg0) {
652
+ export function __wbg_new_8125e318e6245eed() { return logError(function (arg0) {
584
653
  const ret = new Uint8Array(getObject(arg0));
585
654
  return addHeapObject(ret);
586
- };
587
-
588
- export function __wbg_set_5cf90238115182c3(arg0, arg1, arg2) {
589
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
590
- };
655
+ }, arguments) };
591
656
 
592
- export function __wbg_length_72e2208bbc0efc61(arg0) {
657
+ export function __wbg_length_72e2208bbc0efc61() { return logError(function (arg0) {
593
658
  const ret = getObject(arg0).length;
659
+ _assertNum(ret);
594
660
  return ret;
595
- };
661
+ }, arguments) };
596
662
 
597
- export function __wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4(arg0) {
598
- let result;
599
- try {
600
- result = getObject(arg0) instanceof Uint8Array;
601
- } catch {
602
- result = false;
603
- }
604
- const ret = result;
663
+ export function __wbg_set_5cf90238115182c3() { return logError(function (arg0, arg1, arg2) {
664
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
665
+ }, arguments) };
666
+
667
+ export function __wbindgen_is_function(arg0) {
668
+ const ret = typeof(getObject(arg0)) === 'function';
669
+ _assertBoolean(ret);
605
670
  return ret;
606
671
  };
607
672
 
608
- export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
609
- const v = getObject(arg1);
610
- const ret = typeof(v) === 'bigint' ? v : undefined;
611
- getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
612
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
613
- };
673
+ export function __wbg_buffer_085ec1f694018c4f() { return logError(function (arg0) {
674
+ const ret = getObject(arg0).buffer;
675
+ return addHeapObject(ret);
676
+ }, arguments) };
677
+
678
+ export function __wbg_get_97b561fb56f034b5() { return handleError(function (arg0, arg1) {
679
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
680
+ return addHeapObject(ret);
681
+ }, arguments) };
614
682
 
615
683
  export function __wbindgen_debug_string(arg0, arg1) {
616
684
  const ret = debugString(getObject(arg1));
@@ -620,6 +688,16 @@ export function __wbindgen_debug_string(arg0, arg1) {
620
688
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
621
689
  };
622
690
 
691
+ export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
692
+ const v = getObject(arg1);
693
+ const ret = typeof(v) === 'bigint' ? v : undefined;
694
+ if (!isLikeNone(ret)) {
695
+ _assertBigInt(ret);
696
+ }
697
+ getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
698
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
699
+ };
700
+
623
701
  export function __wbindgen_throw(arg0, arg1) {
624
702
  throw new Error(getStringFromWasm0(arg0, arg1));
625
703
  };
Binary file
@@ -0,0 +1,19 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export function set_panic_hook(): void;
5
+ export function parseLrc(a: number, b: number): number;
6
+ export function stringifyLrc(a: number, b: number): void;
7
+ export function parseQrc(a: number, b: number): number;
8
+ export function stringifyQrc(a: number, b: number): void;
9
+ export function stringifyAss(a: number, b: number): void;
10
+ export function decryptQrcHex(a: number, b: number, c: number): void;
11
+ export function parseYrc(a: number, b: number): number;
12
+ export function stringifyYrc(a: number, b: number): void;
13
+ export function parseLys(a: number, b: number): number;
14
+ export function stringifyLys(a: number, b: number): void;
15
+ export function __wbindgen_malloc(a: number, b: number): number;
16
+ export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
+ export function __wbindgen_add_to_stack_pointer(a: number): number;
18
+ export function __wbindgen_free(a: number, b: number, c: number): void;
19
+ export function __wbindgen_exn_store(a: number): void;
package/lyric_bg.wasm DELETED
Binary file
File without changes