47 lines
		
	
	
		
			928 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			928 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| // types.ts
 | |
| export interface Box {
 | |
|   id: string
 | |
|   type: 'playlist' | 'compilation'
 | |
|   name: string
 | |
|   duration: number
 | |
|   tracks?: Track[]
 | |
|   description: string
 | |
|   color2: string
 | |
|   color1: string
 | |
|   color3: string
 | |
|   state: BoxState
 | |
| }
 | |
| 
 | |
| export interface Artist {
 | |
|   id: number
 | |
|   name: string
 | |
|   url: string
 | |
|   coverId: string
 | |
| }
 | |
| export interface Track {
 | |
|   id: number
 | |
|   order?: number
 | |
|   boxId: string
 | |
|   title: string
 | |
|   artist?: Artist | number | string
 | |
|   start?: number
 | |
|   url: string
 | |
|   coverId?: string
 | |
|   date?: Date
 | |
|   card?: { suit: CardSuit; rank: CardRank }
 | |
|   link?: string
 | |
|   type: 'playlist' | 'compilation'
 | |
| }
 | |
| 
 | |
| export interface Playlist {
 | |
|   id: number
 | |
|   date: Date
 | |
|   title: string
 | |
|   url: string
 | |
|   filename: string
 | |
| }
 | |
| 
 | |
| export type BoxState = 'box-hidden' | 'box-list' | 'box-selected'
 | |
| export type CardSuit = '♠' | '♣' | '♦' | '♥'
 | |
| export type CardRank = 'A' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | 'J' | 'Q' | 'K'
 |