-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
23 lines (21 loc) · 889 Bytes
/
Copy pathindex.d.ts
File metadata and controls
23 lines (21 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
type GlobalState = {
isPlaying: boolean;
filename: string | null;
time: number;
activeClientID: string | null;
};
interface ServerToClientEvents {
clientList: (clientID: string[]) => void;
globalState: (state: GlobalState) => void;
filesList: (files: string[]) => void;
requestCurrentState: (requestingClientID: string) => void;
musicMetadata: (metadata: { title?: string; artist?: string; album?: string; lyrics?: ILyricsTag[] }) => void;
}
interface ClientToServerEvents {
register: (groupID: string) => void;
play: (data: { filename: string; time: number }) => void;
pause: (data: { filename: string; time: number }) => void;
seeked: (data: { filename: string; time: number }) => void;
transferRequest: (data: { targetClientID: string; state: { filename: string; time: number; isPlaying: boolean } }) => void;
pullRequest: (data: { sourceClientID: string }) => void;
}