-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
147 lines (120 loc) · 3.53 KB
/
Copy pathtypes.ts
File metadata and controls
147 lines (120 loc) · 3.53 KB
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
import { StaticImageData } from 'next/image';
import { Database} from './database.types';
// It's convenient to have shorthands for your most-used types.
export type Song = Database['public']['Tables']['songs']['Row'];
export type Host = Database['public']['Tables']['hosts']['Row'];
export type USong = Database['public']['Tables']['uSongs']['Row'];
// ----
export type SongInsert = Database['public']['Tables']['songs']['Insert'];
export type HostInsert = Database['public']['Tables']['hosts']['Insert'];
export type USongInsert = Database['public']['Tables']['uSongs']['Insert'];
export type SongUpdate = Database['public']['Tables']['songs']['Update'];
export type HostUpdate = Database['public']['Tables']['hosts']['Update'];
export type USongUpdate = Database['public']['Tables']['uSongs']['Update'];
export type SongRelationships =
Database['public']['Tables']['songs']['Relationships'];
export type HostRelationships =
Database['public']['Tables']['hosts']['Relationships'];
export type USongRelationships =
Database['public']['Tables']['uSongs']['Relationships'];
export type UPartySong = Database['public']['Tables']['uPartySongs']['Row'];
export interface ISong {
title: string;
artist: string;
duration: number;
votesPlus?: number;
votesMinus?: number;
id: number;
url: string;
thumbnail?: string;
}
export interface IActionMSG {
title: string;
message: string;
type: 'info' | 'error' | 'success';
status: number;
}
// *** *** **
export interface IUserActions {
postedSongs: number;
votedSongs: Array<string>;
}
// export interface IPartySong extends UPartySong {
// uSongInfo: USong;
// }
export interface IPartySong extends UPartySong {
addedTimes: number | null;
artist: string | null;
dailyVotesMinus?: number;
dailyVotesPlus?: number;
duration: string | null;
explicit: boolean | null;
thumbnail: string | null;
title: string | null;
url: string;
USongId: string;
}
export interface GetSongsParams {
limit?: number;
asc?: boolean;
order?: string;
status?: string | Array<string>;
staringIndex?: number;
dateOlderThan?: string;
partyId?: number;
id?: string;
USongId?: string;
}
export interface IAdUnit{
image: string | StaticImageData;
url: string;
description?: string;
name: string;
}
export interface IpartyMessageRequest {
partyId: number | string;
limit?: number;
startingIndex?: number;
asc?: boolean;
order?: 'created_at' | string;
}
export type PartyMessage = Database["public"]["Tables"]["messages"]["Row"]
export type TTimeTable = Database["public"]["Tables"]["timeTable"]["Row"]
export type THost = Database["public"]["Tables"]["hosts"]["Row"]
export type Playlists = Database["public"]["Tables"]["playlists"]["Row"]
// export type TTimeTable = ITimeTableRow[];
export type TimeSlot = {
start: string;
end: string;
};
export type Rules = {
[key: number]: TimeSlot[];
};
export type ApplyRule = {
[day: string]: number;
};
export type TimeRules = {
rules: Rules;
applyRule: ApplyRule;
};
export interface ITimeTableRow {
created_at: string;
currentPlaylistId: number;
hostid: number;
id: string;
isOn: boolean;
timeRules: TimeRules | null;
}
export interface Cookie {
name: string,
value?: string,
option?: {
maxAge: number,
path: string,
domain: string,
expires: Date,
httpOnly: boolean,
secure: boolean,
sameSite: string
}
}