/
watch.ts
42 lines (38 loc) · 1.11 KB
/
watch.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
import { jikanGet, jikanUrl, queryJoin } from "./index";
import urljoin from "url-join";
import * as Types from "./types";
/** @category Watch*/
export function watchRecentEpisodes(params?: {
page?: number;
limit?: number;
}): Promise<Types.WatchEpisodes> {
const url = urljoin(jikanUrl, "watch", "episodes") + queryJoin({ ...params });
return jikanGet(url);
}
/** @category Watch*/
export function watchPopularEpisodes(params?: {
page?: number;
limit?: number;
}): Promise<Types.WatchEpisodes> {
const url =
urljoin(jikanUrl, "watch", "episodes", "popular") +
queryJoin({ ...params });
return jikanGet(url);
}
/** @category Watch*/
export function watchRecentPromos(params?: {
page?: number;
limit?: number;
}): Promise<Types.WatchPromos> {
const url = urljoin(jikanUrl, "watch", "promos") + queryJoin({ ...params });
return jikanGet(url);
}
/** @category Watch*/
export function watchPopularPromos(params?: {
page?: number;
limit?: number;
}): Promise<Types.WatchPromos> {
const url =
urljoin(jikanUrl, "watch", "promos", "popular") + queryJoin({ ...params });
return jikanGet(url);
}