-
Notifications
You must be signed in to change notification settings - Fork 285
/
types.ts
129 lines (120 loc) · 2.15 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
export type MediaType = 'movie' | 'tv'
export interface Media {
adult: boolean
backdrop_path: string
genre_ids: number[]
id: string
original_language: string
original_title: string
overview: string
popularity: number
poster_path: string
release_date?: string
first_air_date?: string
title: string
name?: string
video: boolean
vote_average: number
vote_count: number
media_type?: MediaType
// details
homepage?: string
runtime?: number
budget?: number
revenue?: number
status?: string
genres?: Genre[]
production_companies?: any[]
videos?: {
results: Video[]
}
credits?: {
cast: Person[]
crew: Person[]
}
images?: {
backdrops: Image[]
posters: Image[]
}
external_ids?: ExternalIds
// cast
character?: string
}
export interface Person {
adult: boolean
gender: number
id: number
known_for_department: string
name: string
original_name: string
profile_path: string
popularity: number
cast_id?: number
job?: string
character?: string
credit_id: string
order: number
// details
also_known_as?: string[]
birthday?: string
place_of_birth?: string
homepage?: string
biography?: string
external_ids?: ExternalIds
combined_credits?: {
cast?: Media[]
crew?: Media[]
}
images?: {
profiles: Image[]
}
}
export interface Video {
iso_639_1: string
iso_3166_1: string
name: string
key: string
site: string
size: number
type: string
official: boolean
published_at: string
id: string
}
export interface Image {
aspect_ratio: number
height: number
iso_639_1: string
file_path: string
vote_average: number
vote_count: number
width: number
}
export interface ExternalIds {
imdb_id?: string
facebook_id?: string
instagram_id?: string
twitter_id?: string
linkedin_id?: string
github_id?: string
email?: string
homepage?: string
}
export interface PageResult<T> {
page: number
results: T[]
total_pages: number
total_results: number
}
export interface Genre {
id: number
name: string
}
export interface QueryItem {
type: MediaType
title: string
query: string
}
export interface Credits {
cast: Media[]
}