-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
62 lines (52 loc) · 1.17 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
interface Song {
id?: string;
username: string;
yt_id: string;
title: string;
url: string;
artist?: string;
imgUrl?: string;
duration: number;
}
interface CurrentSong extends Song {
durationRemaining: number;
isPlaying: boolean;
}
interface Channel {
current: CurrentSong;
list: Song[];
}
interface IChannels {
[key: string]: Channel;
}
type Skip = SkipWithPlaylist | SkipWithNoPlaylist;
interface SkipWithPlaylist {
type: "playlist";
current: CurrentSong;
}
interface SkipWithNoPlaylist {
type: "noplaylist";
}
interface ServerToClientEvents {
song: (data: Channel) => void;
songUpdate: (data: Channel) => void;
songSync: (data: number) => void;
playlistUpdate: (data: Channel) => void;
playlistAdd: (data: Song) => void;
skip: (data: Skip) => void;
pause: () => void;
play: () => void;
clear: () => void;
no42fm: () => void;
yes42fm: () => void;
userCount: (data: number) => void;
}
interface ClientToServerEvents {
joinRoom: ({ room }: { room: string }) => void;
sync: ({ room }: { room: string }) => void;
couldNotLoad: (room: string) => void;
}
interface InterServerEvents {
ping: () => void;
}
interface SocketData {}