-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
86 lines (79 loc) · 2.16 KB
/
types.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
export interface SocketData {
app?: string;
type?: string;
request?: string;
payload?: any
}
export type AppTypes = 'client' | 'server' | string;
export type EventTypes = 'get' | 'set' | 'message' | 'log' | 'error' | 'data' | 'apps' | 'message' | 'music' | 'settings' | string;
export type SongData = {
album: string | null
artist: string | null
playlist: string | null
playlist_id: string | null
track_name: string
shuffle_state: boolean | null
repeat_state: 'off' | 'all' | 'track' //off, all, track
is_playing: boolean
can_fast_forward: boolean // Whether or not there an an option to 'fastforward 30 sec'
can_skip: boolean
can_like: boolean
can_change_volume: boolean
can_set_output: boolean
track_duration: number | null
track_progress: number | null
volume: number // percentage 0-100
thumbnail: string | null //base64 encoding that includes data:image/png;base64, at the beginning
device: string | null // Name of device that is playing the audio
id: string | null // A way to identify the current song (is used for certain actions)
device_id: string | null // a way to identify the current device if needed
}
export enum AUDIO_REQUESTS {
NEXT = "next",
PREVIOUS = "previous",
REWIND = "rewind",
FAST_FORWARD = "fast_forward",
PLAY = "play",
PAUSE = "pause",
SEEK = "seek",
LIKE = "like",
SONG = "song",
VOLUME = "volume",
REPEAT = "repeat",
SHUFFLE = "shuffle",
}
export interface Manifest {
isAudioSource: boolean
requires: Array<string>
label: string
version: string
description?: string
author?: string
id: string
isWebApp: boolean
isLocalApp: boolean
platforms: Array<string>
homepage?: string
repository?: string
}
export interface App {
name: string
enabled: boolean
running: boolean
prefIndex: number
manifest?: Manifest
}
export interface Settings {
[key: string]: {
[setting: string]: {
value: string | number;
label: string;
options: [
{
value: string | number;
label: string;
}
]
};
};
}