team-4/backend/types/api.ts
2025-08-02 13:28:10 +02:00

47 lines
761 B
TypeScript

import { SpotifyTrack } from "./spotify.ts";
export interface GetSongsTextParams {
prompt: string;
rules: string;
}
export type GetSongsTextOutput = {
type: "success";
songs: SpotifyTrack[];
} | {
type: "error";
error: string;
};
export interface GetYoutubeInput {
title: string;
artist: string;
}
export interface GetYoutubeOutput {
videoId?: string;
}
export interface GetTrackInput {
trackId: string;
}
export interface GetTrackOutput {
track: SpotifyTrack;
}
export type GetNewSuggestInput =
& {
rules: string;
}
& ({
type: "scratch-suggestion";
room_name: string;
} | {
type: "from-songs-suggestion";
songs: { song: string }[];
});
export type GetNewSuggestOutput = {
songs: SpotifyTrack[];
};