DIYgod / APlayer

:lollipop: Wow, such a beautiful HTML5 music player
http://aplayer.js.org
MIT License
7.32k stars 1.03k forks source link

Can we add a `d.ts` type hint file #649

Open oovm opened 4 years ago

oovm commented 4 years ago

Define the following interface to facilitate the ts project:

type Audio = {
    name: String,
    url: String,
    artist: String,
    cover: String,
    lrc: String,
    theme: String,
    type: 'auto' | 'hls' | 'normal'
}

type AplayerOptions = {
    container: HTMLElement,
    fixed: Boolean,
    mini: Boolean,
    autoplay: Boolean,
    theme: String,
    loop: 'all' | 'one' | 'none',
    order: 'list' | 'random',
    preload: 'none' | 'metadata' | 'auto',
    volume: number,
    mutex: Boolean,
    listFolded: Boolean,
    listMaxHeight: number,
    lrcType: 0 | 1 | 2 | 3,
    audio: Audio[],
    storageName: String
}

And include the source files when publishing the project on npm

oovm commented 4 years ago

The currently released version does not include the src folder, in this case js.map will not work