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