@applemusic-like-lyrics/lyric 0.3.0 → 0.4.1

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/package.json CHANGED
@@ -4,16 +4,22 @@
4
4
  "SteveXMH <39523898+Steve-xmh@users.noreply.github.com>"
5
5
  ],
6
6
  "description": "一个歌词解析/生成模块,着重于歌词内容解析,支持多种格式",
7
- "version": "0.3.0",
7
+ "version": "0.4.1",
8
8
  "license": "GPL-3.0",
9
9
  "nx": {
10
10
  "tags": [
11
11
  "library"
12
- ]
12
+ ],
13
+ "targets": {
14
+ "nx-release-publish": {
15
+ "executor": "@nx/js:release-publish",
16
+ "dependsOn": []
17
+ }
18
+ }
13
19
  },
14
20
  "repository": {
15
21
  "type": "git",
16
- "url": "https://github.com/Steve-xmh/applemusic-like-lyrics"
22
+ "url": "https://github.com/amll-dev/applemusic-like-lyrics"
17
23
  },
18
24
  "files": [
19
25
  "pkg/*.wasm",
@@ -1,14 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * When the `console_error_panic_hook` feature is enabled, we can call the
5
- * `set_panic_hook` function at least once during initialization, and then
6
- * we will get better error messages if our code ever panics.
7
- *
8
- * For more details see
9
- * https://github.com/rustwasm/console_error_panic_hook#readme
10
- */
11
- export function wasm_start(): void;
12
3
  /**
13
4
  * 解析 LyRiC 格式的歌词字符串
14
5
  * @param src 歌词字符串
@@ -96,14 +87,14 @@ export function stringifyAss(lines: LyricLine[]): string;
96
87
  * 一个歌词单词
97
88
  */
98
89
  export interface LyricWord {
99
- /** 单词的起始时间 */
100
- startTime: number;
101
- /** 单词的结束时间 */
102
- endTime: number;
103
- /** 单词 */
104
- word: string;
105
- /** 单词的音译 */
106
- romanWord: string;
90
+ /** 单词的起始时间 */
91
+ startTime: number;
92
+ /** 单词的结束时间 */
93
+ endTime: number;
94
+ /** 单词 */
95
+ word: string;
96
+ /** 单词的音译 */
97
+ romanWord?: string;
107
98
  }
108
99
 
109
100
  /**
@@ -111,41 +102,41 @@ export interface LyricWord {
111
102
  * 如果是 LyRiC 等只能表达一行歌词的格式,则会将整行当做一个单词存储起来
112
103
  */
113
104
  export interface LyricLine {
114
- /**
115
- * 该行的所有单词
116
- * 如果是 LyRiC 等只能表达一行歌词的格式,这里就只会有一个单词
117
- */
118
- words: LyricWord[];
119
- /**
120
- * 该行的翻译
121
- */
122
- translatedLyric: string;
123
- /**
124
- * 该行的音译
125
- */
126
- romanLyric: string;
127
- /**
128
- * 该行是否为背景歌词行
129
- * 此选项只有作为 Lyricify Syllable 文件格式导入导出时才有意义
130
- */
131
- isBG: boolean;
132
- /**
133
- * 该行是否为对唱歌词行(即歌词行靠右对齐)
134
- * 此选项只有作为 Lyricify Syllable 文件格式导入导出时才有意义
135
- */
136
- isDuet: boolean;
137
- /**
138
- * 该行的开始时间
139
- *
140
- * **并不总是等于第一个单词的开始时间**
141
- */
142
- startTime: number;
143
- /**
144
- * 该行的结束时间
145
- *
146
- * **并不总是等于最后一个单词的开始时间**
147
- */
148
- endTime: number;
105
+ /**
106
+ * 该行的所有单词
107
+ * 如果是 LyRiC 等只能表达一行歌词的格式,这里就只会有一个单词
108
+ */
109
+ words: LyricWord[];
110
+ /**
111
+ * 该行的翻译
112
+ */
113
+ translatedLyric: string;
114
+ /**
115
+ * 该行的音译
116
+ */
117
+ romanLyric: string;
118
+ /**
119
+ * 该行是否为背景歌词行
120
+ * 此选项只有作为 Lyricify Syllable 文件格式导入导出时才有意义
121
+ */
122
+ isBG: boolean;
123
+ /**
124
+ * 该行是否为对唱歌词行(即歌词行靠右对齐)
125
+ * 此选项只有作为 Lyricify Syllable 文件格式导入导出时才有意义
126
+ */
127
+ isDuet: boolean;
128
+ /**
129
+ * 该行的开始时间
130
+ *
131
+ * **并不总是等于第一个单词的开始时间**
132
+ */
133
+ startTime: number;
134
+ /**
135
+ * 该行的结束时间
136
+ *
137
+ * **并不总是等于最后一个单词的开始时间**
138
+ */
139
+ endTime: number;
149
140
  }
150
141
 
151
142
  /**
@@ -160,14 +151,14 @@ export function decryptQrcHex(hexData: string): string;
160
151
  * 一个 TTML 歌词行对象,存储了歌词行信息和 AMLL 元数据信息
161
152
  */
162
153
  export interface TTMLLyric {
163
- /**
164
- * TTML 中存储的歌词行信息
165
- */
166
- lines: LyricLine[];
167
- /**
168
- * 一个元数据表,以 `[键, 值数组]` 的形式存储
169
- */
170
- metadata: [string, string[]][];
154
+ /**
155
+ * TTML 中存储的歌词行信息
156
+ */
157
+ lines: LyricLine[];
158
+ /**
159
+ * 一个元数据表,以 `[键, 值数组]` 的形式存储
160
+ */
161
+ metadata: [string, string[]][];
171
162
  }
172
163
 
173
164
  /**
@@ -184,3 +175,13 @@ export function parseTTML(src: string): TTMLLyric;
184
175
  export function stringifyTTML(lyric: TTMLLyric): string;
185
176
 
186
177
 
178
+
179
+ /**
180
+ * When the `console_error_panic_hook` feature is enabled, we can call the
181
+ * `set_panic_hook` function at least once during initialization, and then
182
+ * we will get better error messages if our code ever panics.
183
+ *
184
+ * For more details see
185
+ * https://github.com/rustwasm/console_error_panic_hook#readme
186
+ */
187
+ export function wasm_start(): void;
package/pkg/amll_lyric.js CHANGED
@@ -1,5 +1,9 @@
1
+ /* @ts-self-types="./amll_lyric.d.ts" */
2
+
1
3
  import * as wasm from "./amll_lyric_bg.wasm";
2
- export * from "./amll_lyric_bg.js";
3
4
  import { __wbg_set_wasm } from "./amll_lyric_bg.js";
4
5
  __wbg_set_wasm(wasm);
5
6
  wasm.__wbindgen_start();
7
+ export {
8
+ decryptQrcHex, parseEslrc, parseLrc, parseLys, parseQrc, parseTTML, parseYrc, stringifyAss, stringifyEslrc, stringifyLrc, stringifyLys, stringifyQrc, stringifyTTML, stringifyYrc, wasm_start
9
+ } from "./amll_lyric_bg.js";