forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
moviedb.d.ts
94 lines (82 loc) · 2.34 KB
/
moviedb.d.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
// Type definitions for MovieDB
// Project: https://github.com/danzajdband/moviedb
// Definitions by: Basarat Ali Syed <https://github.com/basarat>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Ghost module for Types
declare module MovieDB {
export interface IMovieDB {
searchMovie(params: SearchOptions, callback: (err: any, movies: SearchResults) => void): void;
movieInfo(options: InfoOptions, callback: (err: any, curMovie: Movie) => void): void;
// More methods TBD:
// https://github.com/danzajdband/moviedb#available-methods
}
export interface SearchOptions {
query: string;
}
export interface InfoOptions {
id: number;
}
export interface SearchResults {
page: number;
results: SearchResult[];
total_Pages: number;
total_results: number;
}
export interface SearchResult {
adult: boolean;
backdrop_path: string;
id: number;
original_title: string;
release_date: Date;
poster_path: string;
popularity: number;
title: string;
vote_average: number;
vote_count: number;
}
export interface Movie {
adult: boolean;
backdrop_path: string;
belongs_to_collection: any;
budget: number;
genres: Genre[];
homepage: string;
id: number;
imdb_id: number;
original_title: string;
overview: string;
popularity: number;
poster_path: string;
production_companies: ProductionCompany[];
production_countries: ProductionCountry[];
release_date: Date;
revenue: number;
runtime: number;
spoken_languages: SpokenLanguage[];
status: string;
tagline: string;
title: string;
vote_average: number;
vote_count: number;
}
export interface Genre {
id: number;
name: string;
}
export interface ProductionCompany {
id: number;
name: string;
}
export interface ProductionCountry {
iso_3166_1: number;
name: string;
}
export interface SpokenLanguage {
iso_639_1: number;
name: string;
}
}
declare module 'moviedb' {
function apiKeyAcceptor(key: string): MovieDB.IMovieDB;
export = apiKeyAcceptor;
}