Основные типы
ApiResponse<T>
interface ApiResponse<T> {
data?: T;
error?: string;
status: number;
}
PaginationParams
interface PaginationParams {
page?: number;
limit?: number;
}
IncludeExcludeParams
interface IncludeExcludeParams {
include?: string | string[];
exclude?: string | string[];
}
Релизы
Release
interface Release {
id: string;
code: string;
title: ReleaseTitle;
description?: string;
poster?: string;
screenshots?: string[];
type?: ReleaseType;
genres?: Genre[];
season?: Season;
status?: ReleaseStatus;
rating?: Rating;
franchise?: Franchise;
episodes_total?: number;
episodes_released?: number;
team?: Team;
torrents?: Torrent[];
created_at: string;
updated_at: string;
}
ReleaseTitle
interface ReleaseTitle {
ru: string;
en: string;
jp?: string;
}
Поиск и фильтрация
SearchParams
interface SearchParams extends PaginationParams, IncludeExcludeParams {
query: string;
types?: string[];
genres?: string[];
seasons?: string[];
statuses?: string[];
ratings?: string[];
}
CatalogFilters
interface CatalogFilters extends PaginationParams, IncludeExcludeParams {
types?: string[];
genres?: string[];
seasons?: string[];
statuses?: string[];
ratings?: string[];
sort?: 'created_at' | 'updated_at' | 'title' | 'rating';
order?: 'asc' | 'desc';
}
Пользователь
User
interface User {
id: string;
login: string;
email: string;
avatar?: string;
created_at: string;
updated_at: string;
}
UserProfile
interface UserProfile extends User {
description?: string;
settings?: UserSettings;
}
Полный список всех 50+ интерфейсов смотрите в файле dist/index.d.ts