53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
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 interface SongBookDetailed {
|
|
id: number;
|
|
title: string;
|
|
language: string;
|
|
songs?: {
|
|
songNumber: string;
|
|
song: Song;
|
|
}[]
|
|
}
|
|
|
|
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>;
|