-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
186 lines (167 loc) · 4.34 KB
/
index.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
declare module "nana-api" {
interface nHentaiAPI {
id: string;
media_id: string;
title: nHentaiTitle;
images: nHentaiImages;
scanlator: string;
upload_date: number;
tags: Array<nHentaiTags>;
num_pages: number;
num_favorites: number;
}
interface nHentaiListObject {
num_results: number;
num_pages: number;
results: Array<nHentaiListRes>;
}
interface nHentaiRelatedAPI {
result: Array<nHentaiAPI>;
}
interface nHentaiTitle {
english: string;
japanese: string;
pretty: string;
}
interface nHentaiImages {
pages: Array<nHentaiImageAttr>;
cover: nHentaiImageAttr;
thumbnail: nHentaiImageAttr;
}
interface nHentaiImageAttr {
t: string;
w: number;
h: number;
}
interface nHentaiTags {
id: number;
type: string;
name: string;
url: string;
count: number;
}
interface nHentaiListRes {
id: string;
title: string;
language: string;
thumbnail: nHentaiResThumb;
}
interface nHentaiResThumb {
s: string;
w: string;
h: string;
}
export default class NanaApi {
/**
* Get book API from book ID or book Link
*
* @param {string} query nHentai book ID
* @returns {object|null} nHentai book object
*/
g(query: string | number): Promise<nHentaiAPI|null>;
/**
* Get random book API
*
* @returns {object} nHentai book object
*/
random(): Promise<nHentaiAPI>;
/**
* Get related book API from book ID or book Link
*
* @param {string | number} query nHentai book ID
* @returns {object|null} nHentai book object
*/
related(query: string | number): Promise<nHentaiRelatedAPI|null>;
/**
* Get book list from homepage
*
* @param {number} [page=1] page number
* @returns {object} nHentai list object
*/
homepage(page?: number): Promise<nHentaiListObject>;
/**
* Get book list from popular section
*
* @returns {object} nHentai popular list object
*/
popular(): Promise<nHentaiListObject>;
/**
* Get search list from keyword provided
*
* @param {string} keyword search keyword
* @param {number} [page=1] page number
* @param {string} [popular=false] get from popular page
* @returns {object} nHentai list object
*/
search(
keyword: string,
page?: number,
popular?: boolean | string
): Promise<nHentaiListObject>;
/**
* Get tags list from keyword provided
*
* @param {string} keyword tag keyword
* @param {number} [page=1] page number
* @param {boolean} [popular=false] get from popular page
* @returns {object} nHentai list object
*/
tag(
keyword: string,
page?: number,
popular?: boolean | string
): Promise<nHentaiListObject>;
/**
* Get artist list from keyword provided
*
* @param {string} keyword artist keyword
* @param {number} [page=1] page number
* @param {boolean} [popular=false] get from popular page
* @returns {object} nHentai list object
*/
artist(
keyword: string,
page?: number,
popular?: boolean | string
): Promise<nHentaiListObject>;
/**
* Get character list from keyword provided
*
* @param {string} keyword character keyword
* @param {number} [page=1] page number
* @param {boolean} [popular=false] get from popular page
* @returns {object} nHentai list object
*/
character(
keyword: string,
page?: number,
popular?: boolean | string
): Promise<nHentaiListObject>;
/**
* Get parody list from keyword provided
*
* @param {string} keyword parody keyword
* @param {number} [page=1] page number
* @param {boolean} [popular=false] get from popular page
* @returns {object} nHentai list object
*/
parody(
keyword: string,
page?: number,
popular?: boolean | string
): Promise<nHentaiListObject>;
/**
* Get group list from keyword provided
*
* @param {string} keyword group keyword
* @param {number} [page=1] page number
* @param {boolean} [popular=false] get from popular page
* @returns {object} nHentai list object
*/
group(
keyword: string,
page?: number,
popular?: boolean | string
): Promise<nHentaiListObject>;
}
}