-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
270 lines (227 loc) · 4.83 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
import * as React from 'react';
import { MenuId } from 'react-contexify';
import {
ContextMenuChildName,
APPLE_MUSIC_TYPE,
SPOTIFY_TYPE,
DEEZER_TYPE
} from './utils/constants';
import {
ContactFormReducerEnum,
ANNIE_TYPE,
SPOTIFY_TYPE,
DEEZER_TYPE,
APPLE_MUSIC_TYPE,
} from './utils/constants';
export interface NavProps {
isHomePage: boolean;
}
export interface SpacerProps {
h: string;
mh: string;
}
export interface AnnieLogoProps {
height?: string;
width?: string;
}
interface Platform {
name: string;
url: string;
color: string;
buttonColor: string;
icon: string | null;
darkIcon: string | null;
shortUrl: string | null;
}
interface Track {
id: number;
isrc: string;
title: string;
artiste: string;
image_url: string;
genre: string | null;
year: string | null;
preview_url: string;
platforms: Platform[];
}
interface PlaylistInfo {
id: number;
owner: string;
origin: string;
origin_id: string;
description: string;
image_url: string;
title: string;
apple_url: string;
total: number;
count: number;
next: string;
originalUrl: string;
}
interface Playlist extends PlaylistInfo {
tracks: PlaylistTrackMetaData[];
}
export interface TrackPageProps {
trackDetails: Track;
trackId: string;
error?: string;
}
export interface PlaylistPageProps {
playlistDetails: Playlist;
playlistId: string;
error?: string;
}
export interface SEOProps {
title: string;
keywords: string;
description?: string;
url: string;
imageUrl?: string;
resourceId?: number;
previewUrl?: string;
}
interface TrackInfoProps {
title: string;
artiste: string;
year: string | null;
genre: string | null;
imageUrl: string;
}
export interface TrackInfoCardProps extends TrackInfoProps {
previewUrl: string | null;
}
export interface PlatformGroup extends TrackInfoProps {
platforms: Platform[];
}
export interface PlatformCardProps extends TrackInfoProps, Platform {}
export interface AudioPlayerProps {
previewUrl: string;
title: string;
artiste: string;
}
export interface Faq {
question: string;
answer: string;
}
export interface AccordionProps extends Faq {}
export interface ContactFormState {
email: string;
complaint: string;
name: string;
formSubmitted: boolean;
loading: boolean;
errorMessage: string;
}
type ContactFormReducerAction = {
type: ContactFormReducerEnum;
payload: string;
};
export type ComplaintFormPayload = {
name?: string;
email?: string;
issue: string;
};
export interface IFrameLoaderProps {
url: string;
}
type GTagEvent = {
action: string;
category: string;
label: string;
value: number;
};
export interface OembedProps {
trackId: string;
title: string;
type: 'track' | 'playlist';
}
export interface PlatformModalProps {
title: string;
url: string;
artiste: string;
closeFn: () => void;
platformName: ANNIE_TYPE | SPOTIFY_TYPE | DEEZER_TYPE | APPLE_MUSIC_TYPE;
shortUrl: string | null;
}
export interface Storefront {
id: string;
name: string;
}
export interface SelectableStorefront {
label: string;
value: string;
}
export interface StorefrontSelectorProps {
setUserStorefront: Dispatch<SetStateAction<SelectableStorefront | undefined>>;
userStorefront: SelectableStorefront | undefined;
}
export interface PlaylistInfoCard {
info: PlaylistInfo;
}
export interface PlaylistTrack {
track: PlaylistTrackMetaData;
}
export interface PlaylistTrackMetaData {
id: number;
title: string;
artiste: string;
image_url: string;
annieUrl: string;
}
export interface TrackDisplayProps extends PlaylistTrack {}
export interface LoadMoreProps {
fetchMore: (event: MouseEvent<HTMLButtonElement, MouseEvent>) => void;
isLoading: boolean;
}
export interface ActiveTrack {
id: number;
previewUrl: string;
analyticsLabel: string;
}
export interface ClonePlaylistProps {
playlistId: number;
}
export interface PlaylistContextProps {
url: string;
artiste: string;
title: string;
linkProps: {
className: string;
target: string;
rel: string;
};
getClientRect: () => DOMRect | undefined;
}
export interface ContextMenuOpts {
id: MenuId;
props?: any;
position?: {
x: number;
y: number;
} | null;
}
export interface ContextMenuClickEvent {
props?: { url: string };
data?: { name: ContextMenuChildName },
event: any
}
export interface LoginPlatform {
id: PlatformOptions;
name: PlatformOptions;
borderColor: string;
}
export interface CheckIconProps {
className?: string;
}
export type RadioGroupRenderProps = { active: boolean, checked: boolean };
export type PlatformOptions = typeof SPOTIFY_TYPE | typeof DEEZER_TYPE | typeof APPLE_MUSIC_TYPE;
export interface ModalProps {
children: React.ReactNode;
onClose: () => void;
isOpen: boolean;
title: string;
description?: string;
}
export interface TrackAudioPreviewProps {
track: Track;
}