source: frontend/src/utils/types.ts

main
Last change on this file was d1ee039, checked in by Dimitar Arsov <dimitararsov04@…>, 5 months ago

create new playlist, delete playlists and add song to playlist on playlist creation

  • Property mode set to 100644
File size: 2.6 KB
Line 
1export interface User {
2 username: string;
3 fullName: string;
4 email?: string;
5 profilePhoto?: string | null;
6 isAdmin: boolean;
7 isArtist: boolean;
8}
9
10export interface ArtistContribution {
11 id: number;
12 title: string;
13 genre: string;
14 role: string;
15 entityType: string;
16 isLikedByCurrentUser: boolean;
17 cover?: string | null;
18 link?: string | null;
19}
20
21export interface MusicalEntity {
22 id: number;
23 title: string;
24 genre: string;
25 type: string;
26 releasedBy: string;
27 artistUsername?: string;
28 cover?: string | null;
29 isLikedByCurrentUser?: boolean;
30}
31
32export interface Song extends MusicalEntity {
33 type: "SONG";
34 album?: string;
35 albumId?: number;
36 link?: string;
37}
38
39export interface Album extends MusicalEntity {
40 type: "ALBUM";
41 songs: Song[];
42}
43
44export interface Playlist {
45 id: number;
46 name: string;
47 cover: string;
48 creatorName: string;
49 creatorUsername: string;
50 songsInPlaylist: Song[];
51 isSavedByCurrentUser: boolean;
52}
53
54export interface BaseNonAdminUser {
55 username: string;
56 fullName: string;
57 userType: string;
58 profilePhoto: string;
59 followers: number;
60 following: number;
61 isFollowedByCurrentUser: boolean;
62}
63
64export type UserRegisterType = "ARTIST" | "LISTENER";
65
66export type SearchCategory = "songs" | "albums" | "artists" | "users";
67
68export interface SidebarProps {
69 isOpen: boolean;
70 onClose: () => void;
71}
72
73export interface CreatePlaylistModalProps {
74 isOpen: boolean;
75 onClose: () => void;
76 onSuccess: () => void | Promise<void>;
77 songId?: number | null;
78}
79
80export interface SongContribution {
81 artistName: string;
82 role: string;
83}
84
85export interface SongReview {
86 id: {
87 listenerId: number;
88 musicalEntityId: number;
89 };
90 author: string;
91 authorUsername: string;
92 grade: number;
93 comment: string;
94}
95
96export interface SongDetail extends MusicalEntity {
97 type: "SONG";
98 album?: string | null;
99 link?: string | null;
100 contributions: SongContribution[];
101 reviews: SongReview[];
102}
103
104export interface BasicSong {
105 id: number;
106 title: string;
107 artist: string;
108 artistUsername?: string;
109 cover?: string;
110 link?: string;
111 album?: string;
112 albumId?: number;
113}
114
115export interface BasicPlaylist {
116 id: number;
117 name: string;
118 songCount: number;
119}
120
121export interface CatalogItem {
122 id: number;
123 title: string;
124 genre: string;
125 cover: string | null;
126 type: "SONG" | "ALBUM";
127 releaseDate: string;
128}
129
130export interface Contributor {
131 id: number;
132 fullName: string;
133 role: string;
134}
135
136export interface ArtistSearchResult {
137 id: number;
138 username: string;
139 fullName: string;
140 profilePhoto?: string;
141}
142
143export interface SongEntry {
144 title: string;
145 link: string;
146 contributors: Contributor[];
147}
Note: See TracBrowser for help on using the repository browser.