mirror of
https://github.com/janishutz/musickitjs-v3-types.git
synced 2026-10-08 20:56:23 +02:00
feat: improved types, changes coming
This commit is contained in:
1 parent
abbd0b48c5
commit
95338f676e
6 files changed
+142
-3
No files matched your search
Vendored
+78
-1
@@ -1,3 +1,80 @@
|
||||
declare namespace MusicKit {
|
||||
interface MusicKitInstance {}
|
||||
type MediaItem = object;
|
||||
|
||||
interface Queue {
|
||||
'currentItem': MediaItem;
|
||||
'isEmpty': boolean;
|
||||
'items': MediaItem[];
|
||||
'length': number;
|
||||
'nextPlayableItem': MediaItem;
|
||||
'position': number;
|
||||
'previousPlayableItem': MediaItem;
|
||||
}
|
||||
|
||||
interface QueueOptions {
|
||||
'album'?: string;
|
||||
'albums'?: string[];
|
||||
'musicVideo'?: string;
|
||||
'musicVideos'?: string[];
|
||||
'playlist'?: string;
|
||||
'playlists'?: string[];
|
||||
'song'?: string;
|
||||
'songs'?: string[];
|
||||
}
|
||||
|
||||
interface SeekSeconds {
|
||||
'BACK': number;
|
||||
'FORWARD': number;
|
||||
}
|
||||
|
||||
interface MusicKitInstance {
|
||||
'api': Readonly<MusicKitAPI>;
|
||||
'bitrate': Readonly<PlaybackBitrate>;
|
||||
'currentPlaybackDuration': Readonly<number>;
|
||||
'currentPlaybackProgress': Readonly<number>;
|
||||
'currentPlaybackTime': Readonly<number>;
|
||||
'currentPlaybackTimeRemaining': Readonly<number>;
|
||||
'isAuthorized': Readonly<boolean>;
|
||||
'isPlaying': Readonly<boolean>;
|
||||
'nowPlayingItem': Readonly<MediaItem>;
|
||||
'nowPlayingItemIndex': Readonly<number>;
|
||||
'playbackRate': Readonly<number>;
|
||||
'playbackState': Readonly<PlaybackStates>;
|
||||
'previewOnly': Readonly<boolean>;
|
||||
'queue': Readonly<Queue>;
|
||||
'queueIsEmpty': Readonly<boolean>;
|
||||
'repeatMode': Readonly<PlayerRepeatMode>;
|
||||
'seekSeconds': Readonly<SeekSeconds | undefined>;
|
||||
'shuffleMode': Readonly<PlayerShuffleMode>;
|
||||
'storefrontCountryCode': Readonly<string>;
|
||||
'storefrontId': Readonly<string>;
|
||||
'videoContainerElement': Readonly<HTMLVideoElement | undefined>;
|
||||
'volume': Readonly<number>;
|
||||
'addEventListener': ( name: string, callback: CallableFunction, options: {
|
||||
'once': boolean
|
||||
} ) => void;
|
||||
'authorize': () => Promise<string | void>;
|
||||
'changeToMediaAtIndex': ( index: number ) => Promise<void>;
|
||||
'changeToMediaItem': ( descriptor: MediaItem | string ) => Promise<void>;
|
||||
'changeUserStorefront': ( storefrontId: string ) => Promise<void>;
|
||||
'clearQueue': () => Promise<Queue>;
|
||||
'exitFullscreen': () => void;
|
||||
'mute': () => void;
|
||||
'pause': () => void;
|
||||
'play': () => void;
|
||||
'playAt': ( position: number, options: QueueOptions ) => Promise<Queue | void>;
|
||||
'playLater': ( options: QueueOptions ) => Promise<Queue | void>;
|
||||
'playNext': ( options: QueueOptions, clear: boolean ) => Promise<Queue | void>;
|
||||
'removeEventListener': ( name: string, callback: CallableFunction ) => void;
|
||||
'requestFullscreen': () => void;
|
||||
'seekBackward': () => Promise<void>;
|
||||
'seekForward': () => Promise<void>;
|
||||
'seekToTime': ( time: number ) => Promise<void>;
|
||||
'setQueue': ( options: QueueOptions ) => Promise<Queue | void>;
|
||||
'skipToNextItem': () => Promise<void>;
|
||||
'skipToPreviousItem': () => Promise<void>;
|
||||
'stop': () => void;
|
||||
'unauthorize': () => Promise<void>;
|
||||
'unmute': () => void;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user