43 lines
865 B
TypeScript
43 lines
865 B
TypeScript
export interface Song {
|
|
id: number;
|
|
title: string;
|
|
}
|
|
|
|
export interface SongBook {
|
|
id: number;
|
|
title: string;
|
|
language?: string;
|
|
}
|
|
|
|
export interface SongDetailed {
|
|
song: {
|
|
id: number;
|
|
title: string;
|
|
songBooks?:{songNumber: number; book:SongBook}[]
|
|
|
|
};
|
|
}
|
|
|
|
export type APIResponse<T> =
|
|
| { success: true; status: number; data: T }
|
|
| { success: false; status: number; error: string };
|
|
|
|
export type GetSongsResponse = APIResponse<Song[]>;
|
|
export type GetSongDetailedResponse =
|
|
| {
|
|
success: true;
|
|
status: number;
|
|
song: SongDetailed
|
|
}
|
|
| { success: false; status: number; error: string };
|
|
|
|
export type GetSongsDelailedResponse =
|
|
| {
|
|
success: true;
|
|
status: number;
|
|
songs: SongDetailed[]
|
|
}
|
|
| { success: false; status: number; error: string };
|
|
|
|
export type CreateSongsResponse = APIResponse<Song>;
|