New interfaces defined

This commit is contained in:
2022-08-06 16:12:47 +02:00
parent d13d883db9
commit d279298dec
6 changed files with 98 additions and 20 deletions

View File

@@ -0,0 +1,5 @@
export default interface IErrorMessage {
title: string;
message: string;
type: "error" | "success" | "warning";
}

View File

@@ -1,10 +1,27 @@
export interface IList {
results: Array<IMovie | IShow | IPerson | IRequest>;
results: ListResults;
page: number;
total_results: number;
total_pages: number;
}
export interface IMediaCredits {
cast: Array<ICast>;
crew: Array<ICrew>;
id: number;
}
export interface IPersonCredits {
cast: Array<IMovie | IShow>;
crew: Array<ICrew>;
id: number;
type?: string;
}
export type MediaTypes = IMovie | IShow | IPerson | IRequest;
export type CreditTypes = ICast | ICrew;
export type ListResults = Array<MediaTypes>;
export enum ListTypes {
Movie = "movie",
Show = "show",
@@ -25,6 +42,7 @@ export interface IMovie {
backdrop: string;
release_date: string | Date;
rating: number;
popularity?: number;
type: ListTypes.Movie;
}
@@ -35,17 +53,25 @@ export interface IShow {
overview: string;
poster: string;
backdrop: string;
seasons?: number;
episodes?: number;
popularity?: number;
genres?: Array<string>;
production_status?: string;
runtime?: Array<number>;
exists_in_plex?: boolean;
type: ListTypes.Show;
}
export interface IPerson {
id: number;
title: string;
name: string;
poster: string;
birthday: string | null;
deathday: string | null;
known_for_department: string;
adult: boolean;
type: ListTypes.Person;
}
export interface IRequest extends IMovie {
@@ -54,3 +80,22 @@ export interface IRequest extends IMovie {
status: string | RequestTypes;
user_agent: string;
}
export interface ICast {
character: string;
gender: number;
id: number;
name: string;
profile_path: string | null;
type: string;
}
export interface ICrew {
department: string;
gender: number;
id: number;
job: string;
name: string;
profile_path: string | null;
type: string;
}

View File

@@ -0,0 +1,6 @@
export default interface INavigationIcon {
title: string;
route: string;
icon: any;
requiresAuth?: boolean;
}

View File

@@ -0,0 +1,6 @@
import type { IList } from "./IList";
export default interface ISection {
title: string;
apiFunction: (page: number) => Promise<IList>;
}

View File

@@ -1,8 +1,9 @@
export enum PopupTypes {
Movie = "movie",
Show = "show",
Person = "person"
}
import type { MediaTypes } from "./IList";
// export enum PopupTypes {
// Movie = "movie",
// Show = "show",
// Person = "person"
// }
// export interface IPopupOpen {
// id: string | number;
@@ -11,6 +12,6 @@ export enum PopupTypes {
export interface IStatePopup {
id: number | null;
type: PopupTypes | null;
type: MediaTypes | null;
open: boolean;
}