Create snapshot, track, and user models

This commit is contained in:
Maciej Pędzich 2023-01-07 22:23:17 +01:00
parent 4844c85b59
commit ef2641c897
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import type { User } from './user';
import type { Track } from './track';
export interface PlaylistSnapshot {
description: string;
num_followers: number;
original_name: string;
owner: User;
snapshot_id: string;
tracks: Track[];
unique_name: string;
url: string;
}

18
src/models/track.ts Normal file
View File

@ -0,0 +1,18 @@
import type { User } from './user';
export interface Track {
added_at: string;
album: {
name: string;
url: string;
};
artists: User[];
duration_ms: number;
name: string;
url: string;
date_added: string;
date_added_asterisk: boolean;
date_removed: string | null;
position?: string;
retention?: number;
}

4
src/models/user.ts Normal file
View File

@ -0,0 +1,4 @@
export interface User {
name: string;
url: string;
}