@applemusic-like-lyrics/react-full 0.4.1 → 0.5.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.
@@ -1,10 +1,8 @@
1
1
  import React$1, { ComponentProps, FC, ForwardRefExoticComponent, HTMLProps, NamedExoticComponent, PropsWithChildren, ReactNode, RefAttributes } from "react";
2
+ import { BaseRenderer, IsolationRendererOptions, LyricLine, LyricLineMouseEvent, LyricPlayerBase, OptimizeLyricOptions } from "@applemusic-like-lyrics/core";
2
3
  import { BackgroundRenderProps, LyricPlayerRef } from "@applemusic-like-lyrics/react";
3
4
  import { PrimitiveAtom, WritableAtom } from "jotai";
4
- import { LyricLine, LyricLineMouseEvent, LyricPlayerBase, OptimizeLyricOptions } from "@applemusic-like-lyrics/core";
5
5
  import { RESET } from "jotai/utils";
6
-
7
- //#region src/components/AudioFFTVisualizer/index.d.ts
8
6
  declare const AudioFFTVisualizer: FC<{
9
7
  fftData: number[];
10
8
  } & HTMLProps<HTMLCanvasElement>>;
@@ -41,8 +39,8 @@ type CoverProps = {
41
39
  pauseShrinkAspect?: number;
42
40
  } & HTMLProps<HTMLDivElement>;
43
41
  /**
44
- * 一个专辑图组件
45
- */
42
+ * 一个专辑图组件
43
+ */
46
44
  declare const Cover: ForwardRefExoticComponent<CoverProps & RefAttributes<HTMLDivElement>>;
47
45
  declare const MediaButton: FC<ComponentProps<"button">>;
48
46
  declare const MenuButton: React.FC<HTMLProps<HTMLButtonElement>>;
@@ -59,8 +57,8 @@ interface PrebuiltLyricPlayerProps extends HTMLProps<HTMLDivElement> {
59
57
  optimizeOptions?: OptimizeLyricOptions;
60
58
  }
61
59
  /**
62
- * 已经部署好所有组件的歌词播放器组件,在正确设置所有的 Jotai 状态后可以开箱即用
63
- */
60
+ * 已经部署好所有组件的歌词播放器组件,在正确设置所有的 Jotai 状态后可以开箱即用
61
+ */
64
62
  declare const PrebuiltLyricPlayer: FC<PrebuiltLyricPlayerProps>;
65
63
  declare const TextMarquee: FC<PropsWithChildren<HTMLProps<HTMLDivElement>>>;
66
64
  declare enum PrebuiltToggleIconButtonType {
@@ -82,8 +80,8 @@ declare const PrebuiltToggleIconButton: FC<{
82
80
  } & Omit<HTMLProps<HTMLButtonElement>, "type">>;
83
81
  declare const VolumeControl: React$1.FC<SliderProps>;
84
82
  /**
85
- * 会根据当前元素的宽高比自动选择横向或者纵向布局的组件
86
- */
83
+ * 会根据当前元素的宽高比自动选择横向或者纵向布局的组件
84
+ */
87
85
  declare const AutoLyricLayout: React$1.FC<{
88
86
  thumbSlot?: React$1.ReactNode;
89
87
  controlsSlot?: React$1.ReactNode;
@@ -122,94 +120,94 @@ interface Callback<Args extends unknown[], Result = void> {
122
120
  onEmit?: (...args: Args) => Result;
123
121
  }
124
122
  /**
125
- * 点击歌曲专辑图上方的控制横条时触发
126
- *
127
- * 通常用于关闭歌词页面
128
- */
123
+ * 点击歌曲专辑图上方的控制横条时触发
124
+ *
125
+ * 通常用于关闭歌词页面
126
+ */
129
127
  declare const onClickControlThumbAtom: PrimitiveAtom<Callback<[], void>>;
130
128
  /**
131
- * 点击音质标签时触发
132
- *
133
- * 通常用于打开音质详情对话框
134
- */
129
+ * 点击音质标签时触发
130
+ *
131
+ * 通常用于打开音质详情对话框
132
+ */
135
133
  declare const onClickAudioQualityTagAtom: PrimitiveAtom<Callback<[], void>>;
136
134
  /**
137
- * 点击菜单按钮时触发
138
- */
135
+ * 点击菜单按钮时触发
136
+ */
139
137
  declare const onRequestOpenMenuAtom: PrimitiveAtom<Callback<[], void>>;
140
138
  /**
141
- * 点击暂停或播放按钮时触发
142
- */
139
+ * 点击暂停或播放按钮时触发
140
+ */
143
141
  declare const onPlayOrResumeAtom: PrimitiveAtom<Callback<[], void>>;
144
142
  /**
145
- * 点击上一首按钮时触发
146
- */
143
+ * 点击上一首按钮时触发
144
+ */
147
145
  declare const onRequestPrevSongAtom: PrimitiveAtom<Callback<[], void>>;
148
146
  /**
149
- * 点击下一首按钮时触发
150
- */
147
+ * 点击下一首按钮时触发
148
+ */
151
149
  declare const onRequestNextSongAtom: PrimitiveAtom<Callback<[], void>>;
152
150
  /**
153
- * 拖动进度条触发跳转时触发
154
- * @param position - 目标播放位置,单位为毫秒
155
- */
151
+ * 拖动进度条触发跳转时触发
152
+ * @param position - 目标播放位置,单位为毫秒
153
+ */
156
154
  declare const onSeekPositionAtom: PrimitiveAtom<Callback<[_position: number], void>>;
157
155
  /**
158
- * 当某个歌词行被左键点击时触发
159
- * @param _evt 歌词行的事件对象,可以访问到对应的歌词行信息和歌词行索引
160
- * @param _playerRef 歌词播放组件的引用
161
- */
156
+ * 当某个歌词行被左键点击时触发
157
+ * @param _evt 歌词行的事件对象,可以访问到对应的歌词行信息和歌词行索引
158
+ * @param _playerRef 歌词播放组件的引用
159
+ */
162
160
  declare const onLyricLineClickAtom: PrimitiveAtom<Callback<[_evt: LyricLineMouseEvent, _playerRef: LyricPlayerRef | null], void>>;
163
161
  /**
164
- * 当某个歌词行被右键点击时触发
165
- * @param _evt 歌词行的事件对象,可以访问到对应的歌词行信息和歌词行索引
166
- * @param _playerRef 歌词播放组件的引用
167
- */
162
+ * 当某个歌词行被右键点击时触发
163
+ * @param _evt 歌词行的事件对象,可以访问到对应的歌词行信息和歌词行索引
164
+ * @param _playerRef 歌词播放组件的引用
165
+ */
168
166
  declare const onLyricLineContextMenuAtom: PrimitiveAtom<Callback<[_evt: LyricLineMouseEvent, _playerRef: LyricPlayerRef | null], void>>;
169
167
  /**
170
- * 通过音量滑块改变音量时触发
171
- * @param volume - 目标音量,取值范围为 [0-1]
172
- */
168
+ * 通过音量滑块改变音量时触发
169
+ * @param volume - 目标音量,取值范围为 [0-1]
170
+ */
173
171
  declare const onChangeVolumeAtom: PrimitiveAtom<Callback<[_volume: number], void>>;
174
172
  /**
175
- * 点击随机按钮时触发
176
- */
173
+ * 点击随机按钮时触发
174
+ */
177
175
  declare const onToggleShuffleAtom: PrimitiveAtom<Callback<[], void>>;
178
176
  /**
179
- * 点击循环按钮时触发
180
- */
177
+ * 点击循环按钮时触发
178
+ */
181
179
  declare const onCycleRepeatModeAtom: PrimitiveAtom<Callback<[], void>>;
182
180
  /**
183
- * 播放器底部控制区域的控制组件类型
184
- * - `Controls`: 播放控制按钮
185
- * - `FFT`: 音频可视化内容
186
- * - `None`: 不显示任何内容
187
- */
181
+ * 播放器底部控制区域的控制组件类型
182
+ * - `Controls`: 播放控制按钮
183
+ * - `FFT`: 音频可视化内容
184
+ * - `None`: 不显示任何内容
185
+ */
188
186
  declare enum PlayerControlsType {
189
187
  Controls = "controls",
190
188
  FFT = "fft",
191
189
  None = "none"
192
190
  }
193
191
  /**
194
- * 在隐藏歌词的情况下专辑图的布局方式:
195
- * - `Auto`: 根据专辑图是否为视频以使用沉浸布局
196
- * - `ForceNormal`: 强制使用默认的专辑图布局
197
- * - `ForceImmersive`: 强制使用沉浸式的专辑图布局
198
- */
192
+ * 在隐藏歌词的情况下专辑图的布局方式:
193
+ * - `Auto`: 根据专辑图是否为视频以使用沉浸布局
194
+ * - `ForceNormal`: 强制使用默认的专辑图布局
195
+ * - `ForceImmersive`: 强制使用沉浸式的专辑图布局
196
+ */
199
197
  declare enum VerticalCoverLayout {
200
198
  Auto = "auto",
201
199
  ForceNormal = "force-normal",
202
200
  ForceImmersive = "force-immersive"
203
201
  }
204
202
  /**
205
- * 可用的歌词渲染器实现
206
- */
203
+ * 可用的歌词渲染器实现
204
+ */
207
205
  declare enum LyricPlayerImplementation {
208
206
  Dom = "dom"
209
207
  }
210
208
  /**
211
- * 可用的预设歌词字体大小
212
- */
209
+ * 可用的预设歌词字体大小
210
+ */
213
211
  declare enum LyricSizePreset {
214
212
  Tiny = "tiny",
215
213
  ExtraSmall = "extra-small",
@@ -225,236 +223,264 @@ type LyricPlayerImplementationObject = {
225
223
  };
226
224
  };
227
225
  /**
228
- * 歌词播放组件的实现类型
229
- * @default DomLyricPlayer
230
- */
226
+ * 歌词播放组件的实现类型
227
+ * @default DomLyricPlayer
228
+ */
231
229
  declare const lyricPlayerImplementationAtom: PrimitiveAtom<LyricPlayerImplementationObject>;
232
230
  /**
233
- * 是否启用歌词行模糊效果
234
- *
235
- * 性能影响:较高
236
- * @default true
237
- */
231
+ * 是否启用歌词行模糊效果
232
+ *
233
+ * 性能影响:较高
234
+ * @default true
235
+ */
238
236
  declare const enableLyricLineBlurEffectAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
239
237
  /**
240
- * 是否启用歌词行缩放效果
241
- *
242
- * 性能影响:无
243
- * @default true
244
- */
238
+ * 是否启用歌词行缩放效果
239
+ *
240
+ * 性能影响:无
241
+ * @default true
242
+ */
245
243
  declare const enableLyricLineScaleEffectAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
246
244
  /**
247
- * 是否使用物理弹簧算法实现歌词动画效果
248
- *
249
- * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行
250
- *
251
- * 如果不启用,则会回退到基于 transition 的过渡效果,对低性能的机器比较友好,但是效果会比较单一
252
- *
253
- * 性能影响:较高
254
- * @default true
255
- */
245
+ * 是否使用物理弹簧算法实现歌词动画效果
246
+ *
247
+ * 如果启用,则会通过弹簧算法实时处理歌词位置,但是需要性能足够强劲的电脑方可流畅运行
248
+ *
249
+ * 如果不启用,则会回退到基于 transition 的过渡效果,对低性能的机器比较友好,但是效果会比较单一
250
+ *
251
+ * 性能影响:较高
252
+ * @default true
253
+ */
256
254
  declare const enableLyricLineSpringAnimationAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
257
255
  /**
258
- * 是否显示翻译歌词行
259
- *
260
- * 性能影响:无
261
- * @default true
262
- */
256
+ * 是否显示翻译歌词行
257
+ *
258
+ * 性能影响:无
259
+ * @default true
260
+ */
263
261
  declare const enableLyricTranslationLineAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
264
262
  /**
265
- * 是否显示音译歌词行
266
- *
267
- * 性能影响:无
268
- * @default true
269
- */
263
+ * 是否显示音译歌词行
264
+ *
265
+ * 性能影响:无
266
+ * @default true
267
+ */
270
268
  declare const enableLyricRomanLineAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
271
269
  /**
272
- * 是否交换音译和翻译歌词行的显示位置
273
- *
274
- * 性能影响:无
275
- * @default false
276
- */
270
+ * 是否交换音译和翻译歌词行的显示位置
271
+ *
272
+ * 性能影响:无
273
+ * @default false
274
+ */
277
275
  declare const enableLyricSwapTransRomanLineAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
278
276
  /**
279
- * 调节逐词歌词时单词的渐变过渡宽度,单位为一个全角字的宽度
280
- * - 如果要模拟 Apple Music for Android 的效果,可以设置为 1
281
- * - 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5
282
- * - 如需关闭逐词歌词时单词的渐变过渡效果,可以设置为 0
283
- * @default 0.5
284
- */
277
+ * 调节逐词歌词时单词的渐变过渡宽度,单位为一个全角字的宽度
278
+ * - 如果要模拟 Apple Music for Android 的效果,可以设置为 1
279
+ * - 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5
280
+ * - 如需关闭逐词歌词时单词的渐变过渡效果,可以设置为 0
281
+ * @default 0.5
282
+ */
285
283
  declare const lyricWordFadeWidthAtom: WritableAtom<number, [number | ((prev: number) => number) | typeof RESET], void>;
286
284
  /**
287
- * 设置歌词组件的字体家族
288
- *
289
- * 以逗号分隔的字体名称组合,等同于 CSS 的 font-family 属性
290
- * @default ""
291
- */
285
+ * 设置歌词组件的字体家族
286
+ *
287
+ * 以逗号分隔的字体名称组合,等同于 CSS 的 font-family 属性
288
+ * @default ""
289
+ */
292
290
  declare const lyricFontFamilyAtom: WritableAtom<string, [string | ((prev: string) => string) | typeof RESET], void>;
293
291
  /**
294
- * 设置歌词组件的字体字重
295
- *
296
- * 等同于 CSS 的 font-weight 属性
297
- * @default 600
298
- */
292
+ * 设置歌词组件的字体字重
293
+ *
294
+ * 等同于 CSS 的 font-weight 属性
295
+ * @default 600
296
+ */
299
297
  declare const lyricFontWeightAtom: WritableAtom<number | string, [number | string | ((prev: number | string) => number | string) | typeof RESET], void>;
300
298
  /**
301
- * 设置歌词组件的字符间距
302
- *
303
- * 等同于 CSS 的 letter-spacing 属性
304
- * @default "normal"
305
- */
299
+ * 设置歌词组件的字符间距
300
+ *
301
+ * 等同于 CSS 的 letter-spacing 属性
302
+ * @default "normal"
303
+ */
306
304
  declare const lyricLetterSpacingAtom: WritableAtom<string, [string | ((prev: string) => string) | typeof RESET], void>;
307
305
  /**
308
- * 设置歌词的字体大小
309
- * @default LyricSizePreset.Medium
310
- */
306
+ * 设置歌词的字体大小
307
+ * @default LyricSizePreset.Medium
308
+ */
311
309
  declare const lyricSizePresetAtom: WritableAtom<LyricSizePreset, [LyricSizePreset | ((prev: LyricSizePreset) => LyricSizePreset) | typeof RESET], void>;
312
310
  /**
313
- * 播放控制组件的显示类型,即歌曲信息下方的组件
314
- */
311
+ * 播放控制组件的显示类型,即歌曲信息下方的组件
312
+ */
315
313
  declare const playerControlsTypeAtom: WritableAtom<PlayerControlsType, [PlayerControlsType | ((prev: PlayerControlsType) => PlayerControlsType) | typeof RESET], void>;
316
314
  /**
317
- * 是否显示歌曲名称
318
- * @default true
319
- */
315
+ * 是否显示歌曲名称
316
+ * @default true
317
+ */
320
318
  declare const showMusicNameAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
321
319
  /**
322
- * 在隐藏歌词的情况下专辑图的布局方式
323
- * @default VerticalCoverLayout.Auto
324
- */
320
+ * 在隐藏歌词的情况下专辑图的布局方式
321
+ * @default VerticalCoverLayout.Auto
322
+ */
325
323
  declare const verticalCoverLayoutAtom: WritableAtom<VerticalCoverLayout, [VerticalCoverLayout | ((prev: VerticalCoverLayout) => VerticalCoverLayout) | typeof RESET], void>;
326
324
  /**
327
- * 是否显示歌曲作者
328
- * @default true
329
- */
325
+ * 是否显示歌曲作者
326
+ * @default true
327
+ */
330
328
  declare const showMusicArtistsAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
331
329
  /**
332
- * 是否显示歌曲专辑名称
333
- *
334
- * 如果同时启用三个,布局上可能不太好看,请酌情调节
335
- * @default false
336
- */
330
+ * 是否显示歌曲专辑名称
331
+ *
332
+ * 如果同时启用三个,布局上可能不太好看,请酌情调节
333
+ * @default false
334
+ */
337
335
  declare const showMusicAlbumAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
338
336
  /**
339
- * 是否显示音量控制条
340
- * @default true
341
- */
337
+ * 是否显示音量控制条
338
+ * @default true
339
+ */
342
340
  declare const showVolumeControlAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
343
341
  /**
344
- * 是否显示底部控制按钮组
345
- *
346
- * 在横向布局里是右下角的几个按钮,在竖向布局里是播放按钮下方的几个按钮
347
- * @default true
348
- */
342
+ * 是否显示底部控制按钮组
343
+ *
344
+ * 在横向布局里是右下角的几个按钮,在竖向布局里是播放按钮下方的几个按钮
345
+ * @default true
346
+ */
349
347
  declare const showBottomControlAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
350
348
  type LyricBackgroundRenderer = {
351
349
  renderer?: BackgroundRenderProps["renderer"] | string;
352
350
  };
353
- /**
354
- * 配置所使用的歌词背景渲染器
355
- */
351
+ /** 一个可选背景渲染器的注册项。 */
352
+ interface BackgroundRendererEntry {
353
+ /** 渲染器类。 */
354
+ readonly renderer: {
355
+ new (canvas: HTMLCanvasElement): BaseRenderer;
356
+ };
357
+ /**
358
+ * 当前环境是否支持,不支持时会按 {@link resolveBackgroundRenderer} 的顺序回落
359
+ */
360
+ readonly isSupported: () => boolean;
361
+ }
362
+ declare const CSS_BACKGROUND_RENDERER_ID = "css-bg";
363
+ declare const DEFAULT_BACKGROUND_RENDERER_ID = "mesh";
364
+ /**
365
+ * 所有可选的背景渲染器。
366
+ *
367
+ * `"css-bg"` 不在表内,因为它不是渲染器,而是固定的纯色 CSS 背景
368
+ */
369
+ declare const BACKGROUND_RENDERERS: Readonly<Record<string, BackgroundRendererEntry>>;
370
+ /** 背景渲染器配置在 localStorage 中的键名。 */
371
+ declare const LYRIC_BACKGROUND_RENDERER_STORAGE_KEY = "amll-react-full.lyricBackgroundRenderer";
372
+ /**
373
+ * {@link resolveBackgroundRenderer} 的结果:可以直接使用的渲染器类,或
374
+ * {@link CSS_BACKGROUND_RENDERER_ID} 表示不需要加载背景渲染器
375
+ */
376
+ type ResolvedBackgroundRenderer = BackgroundRendererEntry["renderer"] | typeof CSS_BACKGROUND_RENDERER_ID;
377
+ /**
378
+ * 把字符串标识解析成渲染器
379
+ *
380
+ * 如果传入的渲染器标识在当前环境不支持,则会依次回退到 Mesh 渲染器和 CSS 背景
381
+ */
382
+ declare const resolveBackgroundRenderer: (id: string) => ResolvedBackgroundRenderer;
383
+ /**
384
+ * 配置所使用的歌词背景渲染器
385
+ */
356
386
  declare const lyricBackgroundRendererAtom: PrimitiveAtom<LyricBackgroundRenderer>;
357
387
  /**
358
- * 当背景渲染器设置为纯色或CSS背景时,使用此值
359
- * @default "#111111"
360
- */
388
+ * Isolation 背景渲染器的专属选项
389
+ *
390
+ * 仅在背景渲染器为 Isolation 时生效
391
+ */
392
+ declare const isolationRendererOptionsAtom: WritableAtom<IsolationRendererOptions, [IsolationRendererOptions | ((prev: IsolationRendererOptions) => IsolationRendererOptions) | typeof RESET], void>;
393
+ /**
394
+ * 当背景渲染器设置为纯色或CSS背景时,使用此值
395
+ * @default "#111111"
396
+ */
361
397
  declare const cssBackgroundPropertyAtom: WritableAtom<string, [string | ((prev: string) => string) | typeof RESET], void>;
362
398
  /**
363
- * 调节背景的最大渲染帧率,较低的值可以提升性能
364
- *
365
- * 性能影响:高
366
- * @default 60
367
- */
399
+ * 调节背景的最大渲染帧率,较低的值可以提升性能
400
+ *
401
+ * 性能影响:高
402
+ * @default 60
403
+ */
368
404
  declare const lyricBackgroundFPSAtom: WritableAtom<number, [number | ((prev: number) => number) | typeof RESET], void>;
369
405
  /**
370
- * 调节背景的渲染倍率,较低的值可以提升性能
371
- *
372
- * 性能影响:高
373
- * @default 1
374
- */
406
+ * 调节背景的渲染倍率,较低的值可以提升性能
407
+ *
408
+ * 性能影响:高
409
+ * @default 1
410
+ */
375
411
  declare const lyricBackgroundRenderScaleAtom: WritableAtom<number, [number | ((prev: number) => number) | typeof RESET], void>;
376
412
  /**
377
- * 是否启用背景静态模式
378
- *
379
- * 让背景会在除了切换歌曲变换封面的情况下保持静止,如果遇到了性能问题,可以考虑开启此项
380
- *
381
- * 注意:启用此项会导致背景跳动效果失效
382
- * @default false
383
- */
413
+ * 是否启用背景静态模式
414
+ *
415
+ * 让背景会在除了切换歌曲变换封面的情况下保持静止,如果遇到了性能问题,可以考虑开启此项
416
+ *
417
+ * 注意:启用此项会导致背景跳动效果失效
418
+ * @default false
419
+ */
384
420
  declare const lyricBackgroundStaticModeAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
385
421
  /**
386
- * 控制歌词播放页面是否可见
387
- */
422
+ * 控制歌词播放页面是否可见
423
+ */
388
424
  declare const isLyricPageOpenedAtom: PrimitiveAtom<boolean>;
389
425
  /**
390
- * 是否隐藏歌词视图(即使有歌词数据)
391
- * @default false
392
- */
426
+ * 是否隐藏歌词视图(即使有歌词数据)
427
+ * @default false
428
+ */
393
429
  declare const hideLyricViewAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
394
430
  /**
395
- * 是否在进度条上显示剩余时间而非当前时间
396
- * @default true
397
- */
431
+ * 是否在进度条上显示剩余时间而非当前时间
432
+ * @default true
433
+ */
398
434
  declare const showRemainingTimeAtom: WritableAtom<boolean, [boolean | ((prev: boolean) => boolean) | typeof RESET], void>;
399
435
  /**
400
- * 音频可视化频域范围
401
- *
402
- * 单位为赫兹(hz),此项会影响音频可视化和背景跳动效果的展示效果
403
- * @default [80, 2000]
404
- */
436
+ * 音频可视化频域范围
437
+ *
438
+ * 单位为赫兹(hz),此项会影响音频可视化和背景跳动效果的展示效果
439
+ * @default [80, 2000]
440
+ */
405
441
  declare const fftDataRangeAtom: WritableAtom<[number, number], [[number, number] | ((prev: [number, number]) => [number, number]) | typeof RESET], void>;
406
442
  /**
407
- * 重复播放的模式
408
- */
443
+ * 重复播放的模式
444
+ */
409
445
  declare enum RepeatMode {
410
446
  Off = "off",
411
447
  One = "one",
412
448
  All = "all"
413
449
  }
414
450
  /**
415
- * 随机播放是否开启
416
- */
451
+ * 随机播放是否开启
452
+ */
417
453
  declare const isShuffleActiveAtom: PrimitiveAtom<boolean>;
418
454
  /**
419
- * 当前的重复播放模式
420
- */
455
+ * 当前的重复播放模式
456
+ */
421
457
  declare const repeatModeAtom: PrimitiveAtom<RepeatMode>;
422
458
  /**
423
- * 随机按钮是否可用
424
- */
459
+ * 随机按钮是否可用
460
+ */
425
461
  declare const isShuffleEnabledAtom: PrimitiveAtom<boolean>;
426
462
  /**
427
- * 重复按钮是否可用
428
- */
463
+ * 重复按钮是否可用
464
+ */
429
465
  declare const isRepeatEnabledAtom: PrimitiveAtom<boolean>;
430
466
  /**
431
- * 切换随机播放模式的动作
432
- */
467
+ * 切换随机播放模式的动作
468
+ */
433
469
  declare const toggleShuffleActionAtom: WritableAtom<null, [], void>;
434
470
  /**
435
- * 切换循环播放模式的动作
436
- */
471
+ * 切换循环播放模式的动作
472
+ */
437
473
  declare const cycleRepeatModeActionAtom: WritableAtom<null, [], void>;
438
- type SongData = {
439
- type: "local";
440
- filePath: string;
441
- origOrder: number;
442
- } | {
443
- type: "custom";
444
- id: string;
445
- songJsonData: string;
446
- origOrder: number;
447
- };
448
474
  /**
449
- * 一位艺术家的信息
450
- */
475
+ * 一位艺术家的信息
476
+ */
451
477
  interface ArtistStateEntry {
452
478
  name: string;
453
479
  id: string;
454
480
  }
455
481
  /**
456
- * 音频质量的类型枚举
457
- */
482
+ * 音频质量的类型枚举
483
+ */
458
484
  declare enum AudioQualityType {
459
485
  None = "none",
460
486
  Standard = "standard",
@@ -463,101 +489,101 @@ declare enum AudioQualityType {
463
489
  DolbyAtmos = "dolby-atmos"
464
490
  }
465
491
  /**
466
- * 描述音频质量信息的接口
467
- */
492
+ * 描述音频质量信息的接口
493
+ */
468
494
  interface MusicQualityState {
469
495
  /**
470
- * 音频质量
471
- */
496
+ * 音频质量
497
+ */
472
498
  type: AudioQualityType;
473
499
  /**
474
- * 音频解码器
475
- */
500
+ * 音频解码器
501
+ */
476
502
  codec: string;
477
503
  /**
478
- * 音频通道数量
479
- */
504
+ * 音频通道数量
505
+ */
480
506
  channels: number;
481
507
  /**
482
- * 采样率
483
- */
508
+ * 采样率
509
+ */
484
510
  sampleRate: number;
485
511
  /**
486
- * 采样格式
487
- */
512
+ * 采样格式
513
+ */
488
514
  sampleFormat: string;
489
515
  }
490
516
  /**
491
- * 当前播放歌曲的 ID
492
- */
517
+ * 当前播放歌曲的 ID
518
+ */
493
519
  declare const musicIdAtom: PrimitiveAtom<string>;
494
520
  /**
495
- * 当前播放的音乐名称
496
- */
521
+ * 当前播放的音乐名称
522
+ */
497
523
  declare const musicNameAtom: PrimitiveAtom<string>;
498
524
  /**
499
- * 当前播放的音乐创作者列表
500
- */
525
+ * 当前播放的音乐创作者列表
526
+ */
501
527
  declare const musicArtistsAtom: PrimitiveAtom<ArtistStateEntry[]>;
502
528
  /**
503
- * 当前播放的音乐所属专辑名称
504
- */
529
+ * 当前播放的音乐所属专辑名称
530
+ */
505
531
  declare const musicAlbumNameAtom: PrimitiveAtom<string>;
506
532
  /**
507
- * 当前播放的音乐专辑封面 URL
508
- *
509
- * 除了图片也可以是视频资源
510
- */
533
+ * 当前播放的音乐专辑封面 URL
534
+ *
535
+ * 除了图片也可以是视频资源
536
+ */
511
537
  declare const musicCoverAtom: PrimitiveAtom<string>;
512
538
  /**
513
- * 当前播放的音乐专辑封面资源是否为视频
514
- */
539
+ * 当前播放的音乐专辑封面资源是否为视频
540
+ */
515
541
  declare const musicCoverIsVideoAtom: PrimitiveAtom<boolean>;
516
542
  /**
517
- * 当前音乐的总时长,单位为毫秒
518
- */
543
+ * 当前音乐的总时长,单位为毫秒
544
+ */
519
545
  declare const musicDurationAtom: PrimitiveAtom<number>;
520
546
  /**
521
- * 当前音乐是否正在播放
522
- */
547
+ * 当前音乐是否正在播放
548
+ */
523
549
  declare const musicPlayingAtom: PrimitiveAtom<boolean>;
524
550
  /**
525
- * 当前音乐的播放进度,单位为毫秒
526
- */
551
+ * 当前音乐的播放进度,单位为毫秒
552
+ */
527
553
  declare const musicPlayingPositionAtom: PrimitiveAtom<number>;
528
554
  /**
529
- * 当前播放的音乐音量大小,范围在 [0.0-1.0] 之间
530
- */
555
+ * 当前播放的音乐音量大小,范围在 [0.0-1.0] 之间
556
+ */
531
557
  declare const musicVolumeAtom: WritableAtom<number, [number | ((prev: number) => number) | typeof RESET], void>;
532
558
  /**
533
- * 当前播放的音乐的歌词数据
534
- */
559
+ * 当前播放的音乐的歌词数据
560
+ */
535
561
  declare const musicLyricLinesAtom: PrimitiveAtom<LyricLine[]>;
536
562
  /**
537
- * 当前音乐的音质信息
538
- */
563
+ * 当前音乐的音质信息
564
+ */
539
565
  declare const musicQualityAtom: PrimitiveAtom<MusicQualityState>;
540
566
  /**
541
- * 根据音质信息生成的、用于UI展示的标签内容
542
- *
543
- * 如果为 null 则不显示标签
544
- */
567
+ * 根据音质信息生成的、用于UI展示的标签内容
568
+ *
569
+ * 如果为 null 则不显示标签
570
+ */
545
571
  declare const musicQualityTagAtom: PrimitiveAtom<{
546
572
  tagIcon: boolean;
547
573
  tagText: string;
548
574
  isDolbyAtmos: boolean;
549
575
  } | null>;
550
576
  /**
551
- * 用于音频可视化频谱图的实时频域数据
552
- */
577
+ * 用于音频可视化频谱图的实时频域数据
578
+ */
553
579
  declare const fftDataAtom: PrimitiveAtom<number[]>;
554
580
  /**
555
- * 设置低频的音量大小,范围在 80hz-120hz 之间为宜,取值范围在 0.0-1.0 之间。
556
- *
557
- * 部分渲染器会根据音量大小调整背景效果(例如根据鼓点跳动)。如果无法获取到类似的数据,请传入 1.0 作为默认值,或不做任何处理。
558
- */
581
+ * 设置低频的音量大小,范围在 80hz-120hz 之间为宜,取值范围在 0.0-1.0 之间。
582
+ *
583
+ * 部分渲染器会根据音量大小调整背景效果(例如根据鼓点跳动)。如果无法获取到类似的数据,请传入 1.0 作为默认值,或不做任何处理。
584
+ */
559
585
  declare const lowFreqVolumeAtom: PrimitiveAtom<number>;
560
586
  declare function toDuration(duration: number): string;
561
587
  //#endregion
562
- export { ArtistStateEntry, AudioFFTVisualizer, AudioQualityTag, AudioQualityTagProps, AudioQualityType, AutoLyricLayout, BouncingSlider, Callback, ControlThumb, Cover, CoverProps, HorizontalLayout, LyricBackgroundRenderer, LyricPlayerImplementation, LyricPlayerImplementationObject, LyricSizePreset, MediaButton, MenuButton, MusicInfo, MusicQualityState, PlayerControlsType, PrebuiltLyricPlayer, PrebuiltLyricPlayerProps, PrebuiltToggleIconButton, PrebuiltToggleIconButtonType, RepeatMode, SliderProps, SongData, TextMarquee, ToggleIconButton, VerticalCoverLayout, VerticalLayout, VolumeControl, cssBackgroundPropertyAtom, cycleRepeatModeActionAtom, enableLyricLineBlurEffectAtom, enableLyricLineScaleEffectAtom, enableLyricLineSpringAnimationAtom, enableLyricRomanLineAtom, enableLyricSwapTransRomanLineAtom, enableLyricTranslationLineAtom, fftDataAtom, fftDataRangeAtom, hideLyricViewAtom, isLyricPageOpenedAtom, isRepeatEnabledAtom, isShuffleActiveAtom, isShuffleEnabledAtom, lowFreqVolumeAtom, lyricBackgroundFPSAtom, lyricBackgroundRenderScaleAtom, lyricBackgroundRendererAtom, lyricBackgroundStaticModeAtom, lyricFontFamilyAtom, lyricFontWeightAtom, lyricLetterSpacingAtom, lyricPlayerImplementationAtom, lyricSizePresetAtom, lyricWordFadeWidthAtom, musicAlbumNameAtom, musicArtistsAtom, musicCoverAtom, musicCoverIsVideoAtom, musicDurationAtom, musicIdAtom, musicLyricLinesAtom, musicNameAtom, musicPlayingAtom, musicPlayingPositionAtom, musicQualityAtom, musicQualityTagAtom, musicVolumeAtom, onChangeVolumeAtom, onClickAudioQualityTagAtom, onClickControlThumbAtom, onCycleRepeatModeAtom, onLyricLineClickAtom, onLyricLineContextMenuAtom, onPlayOrResumeAtom, onRequestNextSongAtom, onRequestOpenMenuAtom, onRequestPrevSongAtom, onSeekPositionAtom, onToggleShuffleAtom, playerControlsTypeAtom, repeatModeAtom, showBottomControlAtom, showMusicAlbumAtom, showMusicArtistsAtom, showMusicNameAtom, showRemainingTimeAtom, showVolumeControlAtom, toDuration, toggleShuffleActionAtom, verticalCoverLayoutAtom };
588
+ export { ArtistStateEntry, AudioFFTVisualizer, AudioQualityTag, AudioQualityTagProps, AudioQualityType, AutoLyricLayout, BACKGROUND_RENDERERS, BackgroundRendererEntry, BouncingSlider, CSS_BACKGROUND_RENDERER_ID, Callback, ControlThumb, Cover, CoverProps, DEFAULT_BACKGROUND_RENDERER_ID, HorizontalLayout, LYRIC_BACKGROUND_RENDERER_STORAGE_KEY, LyricBackgroundRenderer, LyricPlayerImplementation, LyricPlayerImplementationObject, LyricSizePreset, MediaButton, MenuButton, MusicInfo, MusicQualityState, PlayerControlsType, PrebuiltLyricPlayer, PrebuiltLyricPlayerProps, PrebuiltToggleIconButton, PrebuiltToggleIconButtonType, RepeatMode, ResolvedBackgroundRenderer, SliderProps, TextMarquee, ToggleIconButton, VerticalCoverLayout, VerticalLayout, VolumeControl, cssBackgroundPropertyAtom, cycleRepeatModeActionAtom, enableLyricLineBlurEffectAtom, enableLyricLineScaleEffectAtom, enableLyricLineSpringAnimationAtom, enableLyricRomanLineAtom, enableLyricSwapTransRomanLineAtom, enableLyricTranslationLineAtom, fftDataAtom, fftDataRangeAtom, hideLyricViewAtom, isLyricPageOpenedAtom, isRepeatEnabledAtom, isShuffleActiveAtom, isShuffleEnabledAtom, isolationRendererOptionsAtom, lowFreqVolumeAtom, lyricBackgroundFPSAtom, lyricBackgroundRenderScaleAtom, lyricBackgroundRendererAtom, lyricBackgroundStaticModeAtom, lyricFontFamilyAtom, lyricFontWeightAtom, lyricLetterSpacingAtom, lyricPlayerImplementationAtom, lyricSizePresetAtom, lyricWordFadeWidthAtom, musicAlbumNameAtom, musicArtistsAtom, musicCoverAtom, musicCoverIsVideoAtom, musicDurationAtom, musicIdAtom, musicLyricLinesAtom, musicNameAtom, musicPlayingAtom, musicPlayingPositionAtom, musicQualityAtom, musicQualityTagAtom, musicVolumeAtom, onChangeVolumeAtom, onClickAudioQualityTagAtom, onClickControlThumbAtom, onCycleRepeatModeAtom, onLyricLineClickAtom, onLyricLineContextMenuAtom, onPlayOrResumeAtom, onRequestNextSongAtom, onRequestOpenMenuAtom, onRequestPrevSongAtom, onSeekPositionAtom, onToggleShuffleAtom, playerControlsTypeAtom, repeatModeAtom, resolveBackgroundRenderer, showBottomControlAtom, showMusicAlbumAtom, showMusicArtistsAtom, showMusicNameAtom, showRemainingTimeAtom, showVolumeControlAtom, toDuration, toggleShuffleActionAtom, verticalCoverLayoutAtom };
563
589
  //# sourceMappingURL=amll-react-framework.d.mts.map