Converted utils & api to typescript. Webpack setup

This commit is contained in:
2022-07-26 22:09:41 +02:00
parent 8308a7231a
commit a4a669e774
10 changed files with 142 additions and 25 deletions

View File

@@ -0,0 +1,5 @@
export default interface IConfig {
SEASONED_URL: string;
ELASTIC_URL: string;
ELASTIC_INDEX: string;
}

56
src/interfaces/IList.ts Normal file
View File

@@ -0,0 +1,56 @@
export interface IList {
results: Array<IMovie | IShow | IPerson | IRequest>;
page: number;
total_results: number;
total_pages: number;
}
export enum ListTypes {
Movie = "movie",
Show = "show",
Person = "person",
Request = "request"
}
export enum RequestTypes {
Requested = "requested"
}
export interface IMovie {
id: number;
title: string;
year: number;
overview: string;
poster: string;
backdrop: string;
release_date: string | Date;
rating: number;
type: ListTypes.Movie;
}
export interface IShow {
id: number;
title: string;
year: number;
overview: string;
poster: string;
backdrop: string;
type: ListTypes.Show;
}
export interface IPerson {
id: number;
title: string;
poster: string;
birthday: string | null;
deathday: string | null;
known_for_department: string;
adult: boolean;
}
export interface IRequest extends IMovie {
requested_by: string;
ip: string;
status: string | RequestTypes;
user_agent: string;
}