mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Improve typing of PlaylistTrack
This commit is contained in:
parent
83303f9e0e
commit
614d5f0ca0
3 changed files with 9 additions and 8 deletions
|
|
@ -5,8 +5,8 @@ import { DeepPartial } from "redux";
|
|||
|
||||
interface Config {
|
||||
initialTracks?: Track[];
|
||||
audioUrl?: string | URL;
|
||||
skinUrl?: string | URL;
|
||||
audioUrl?: string;
|
||||
skinUrl?: string;
|
||||
disableMarquee?: boolean;
|
||||
initialState?: DeepPartial<AppState>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ const playlist = (
|
|||
[action.id]: {
|
||||
id: action.id,
|
||||
selected: false,
|
||||
defaultName: action.defaultName,
|
||||
defaultName: action.defaultName || null,
|
||||
duration: action.duration == null ? null : action.duration,
|
||||
url: action.url,
|
||||
mediaTagsRequestStatus: MEDIA_TAG_REQUEST_STATUS.NOT_REQUESTED
|
||||
|
|
|
|||
11
js/types.ts
11
js/types.ts
|
|
@ -97,7 +97,7 @@ export type Action =
|
|||
id: number;
|
||||
defaultName?: string;
|
||||
duration?: number;
|
||||
url: string | URL;
|
||||
url: string;
|
||||
}
|
||||
| {
|
||||
type: "SET_MEDIA";
|
||||
|
|
@ -461,7 +461,7 @@ export interface URLTrack extends TrackInfo {
|
|||
*
|
||||
* Example: `'https://example.com/song.mp3'`
|
||||
*/
|
||||
url: string | URL;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface BlobTrack extends TrackInfo {
|
||||
|
|
@ -479,10 +479,11 @@ export interface BlobTrack extends TrackInfo {
|
|||
export type Track = URLTrack | BlobTrack;
|
||||
|
||||
export interface PlaylistTrack {
|
||||
artist: string;
|
||||
title: string;
|
||||
id: number;
|
||||
artist?: string;
|
||||
title?: string;
|
||||
url: string;
|
||||
defaultName: string;
|
||||
defaultName: string | null;
|
||||
albumArtUrl?: string | null;
|
||||
selected: boolean;
|
||||
mediaTagsRequestStatus: MediaTagRequestStatus;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue