initiation librodrome
This commit is contained in:
24
app/types/book.ts
Normal file
24
app/types/book.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export interface ChapterMeta {
|
||||
slug: string
|
||||
title: string
|
||||
description?: string
|
||||
order: number
|
||||
readingTime?: string
|
||||
}
|
||||
|
||||
export interface ChapterSongLink {
|
||||
chapterSlug: string
|
||||
songId: string
|
||||
primary: boolean
|
||||
}
|
||||
|
||||
export interface BookConfig {
|
||||
title: string
|
||||
author: string
|
||||
description: string
|
||||
coverImage?: string
|
||||
chapters: ChapterMeta[]
|
||||
songs: import('./song').Song[]
|
||||
chapterSongs: ChapterSongLink[]
|
||||
defaultPlaylistOrder: string[]
|
||||
}
|
||||
18
app/types/player.ts
Normal file
18
app/types/player.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { Song } from './song'
|
||||
|
||||
export type PlayerMode = 'guided' | 'free'
|
||||
export type RepeatMode = 'none' | 'one' | 'all'
|
||||
|
||||
export interface PlayerState {
|
||||
isPlaying: boolean
|
||||
currentSong: Song | null
|
||||
currentTime: number
|
||||
duration: number
|
||||
volume: number
|
||||
mode: PlayerMode
|
||||
repeatMode: RepeatMode
|
||||
isShuffled: boolean
|
||||
playlist: Song[]
|
||||
queue: Song[]
|
||||
isExpanded: boolean
|
||||
}
|
||||
10
app/types/song.ts
Normal file
10
app/types/song.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface Song {
|
||||
id: string
|
||||
title: string
|
||||
artist: string
|
||||
file: string
|
||||
duration: number // seconds
|
||||
coverImage?: string
|
||||
lyrics?: string
|
||||
tags: string[]
|
||||
}
|
||||
Reference in New Issue
Block a user