twist-aplayer
Version:
A shadui theme aplayer
125 lines (116 loc) • 3.12 kB
TypeScript
import { JSX as JSX_2 } from 'react/jsx-runtime';
export declare interface ArtistInfo {
name?: string;
url?: string;
}
export declare interface AudioInfo {
name?: string;
artist?: string | ArtistInfo;
url: string;
cover?: string;
lrc?: string;
theme?: string;
type?: 'auto' | 'hls' | 'normal';
}
export declare type NullableType<T> = {
[P in keyof T]: T[P] | null;
};
/**
* @type all
* @description List loop, when the last songs is ended the first songs will played.
*
* @type one
* @description Single song loop.
*
* @type none
* @description Not loop, when the last song plays, jump to the first song, but not played.
*/
declare type PlaylistLoop = 'all' | 'one' | 'none';
/**
* @type list
* @description Play sequentially, in the original order of the song list.
*
* @type random
* @description Play randomly, shuffle the song order and then play.
*/
declare type PlaylistOrder = 'list' | 'random';
export declare function TwistAPlayer(props: TwistAPlayerProps): JSX_2.Element;
/**
* @see https://aplayer.js.org/#/home?id=options
*/
export declare interface TwistAPlayerProps {
/**
* @description audio info, should be an object or object array
*/
audio: AudioInfo | readonly AudioInfo[];
/**
* Initial volume
* @description default volume
* @default 0.7
*/
volume?: number;
/**
* @description values: 'normal', 'fixed'
* @default "normal"
*/
appearance?: 'normal' | 'fixed';
/**
* @description values: 'all' | 'one' | 'none'
* @default "all"
*/
initialLoop?: PlaylistLoop;
/**
* @description values: 'list' | 'random'
* @default "list"
*/
initialOrder?: PlaylistOrder;
/**
* @description audio autoplay
* @default false
*/
autoPlay?: boolean;
/**
* @description list max height
* @default 250
*/
listMaxHeight?: number;
/**
* @description enable mini mode
* @default false
*/
mini?: boolean;
/**
* @description enable super mini mode for mobile devices, only shows miniswitcher initially
* @default false
*/
superMini?: boolean;
/**
* @default prevent to play multiple player at the same time, pause other players when this player start play
* @default true
*/
mutex?: boolean;
/**
* @description indicate whether list should folded at first render
* @default false
*/
listFolded?: boolean;
/**
* @description player theme, values: light, dark
* @default light
*/
theme?: 'light' | 'dark';
/**
* @description user border, it can accent border if use dark mode.
* @default false
*/
border?: boolean;
/**
* @description custom class name for the player container
*/
className?: string;
/**
* @description custom inline styles for the player container
*/
style?: React.CSSProperties;
}
export { }