types.ts 2.2 KB

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