forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imgur-rest-api.d.ts
252 lines (228 loc) · 5.62 KB
/
imgur-rest-api.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// Type definitions for Imgur REST API v3
// Project: https://api.imgur.com/
// Definitions by: Luke William Westby <http://github.com/lukewestby>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ImgurRestApi {
interface Response<T> {
data: any; //T|Error;
status: number;
success: boolean;
}
interface Account {
id: number;
url: string;
bio: string;
reputation: number;
created: number;
pro_expiration: any; //number|boolean;
}
interface AccountSettings {
email: string;
high_quality: boolean;
public_images: boolean;
album_privacy: string;
pro_expiration: any; //number|boolean;
accepted_gallery_terms: boolean;
active_emails: Array<string>;
messaging_enabled: boolean;
blocked_users: Array<BlockedUser>;
}
interface Album {
id: string;
title: string;
description: string;
datetime: number;
cover: string;
cover_width: number;
cover_height: number;
account_url?: string;
account_id?: number;
privacy: string;
layout: string;
views: number;
link: string;
favorite: boolean;
nsfw?: boolean;
section: string;
order: number;
deletehash?: string;
images_count: number;
images: Array<Image>;
}
interface BlockedUser {
blocked_id: number;
blocked_url: string;
}
interface Comment {
id: number;
image_id: string;
comment: string;
author: string;
author_id: number;
on_album: boolean;
album_cover: string;
ups: number;
downs: number;
points: number;
datetime: number;
parent_id: number;
deleted: boolean;
vote?: string;
children: Array<Comment>
}
interface Conversation {
id: number;
last_message_preview: string;
datetime: number;
with_account_id: number;
with_account: string;
message_count: number;
messages?: Array<Message>;
done?: boolean;
page?: number;
}
interface CustomGallery {
account_url: string;
link: string;
tags: Array<string>
item_count: number;
items: Array<GalleryItem>;
}
interface GalleryItem {
id: string;
title: string;
description: string;
datetime: number;
account_url?: string;
account_id?: number;
ups: number;
downs: number;
score: number;
is_album: boolean;
views: number;
link: string;
vote?: string;
favorite: boolean;
nsfw?: boolean;
comment_count: number;
topic: string;
topic_id: number;
}
interface GalleryAlbum extends GalleryItem {
cover: string;
cover_width: number;
cover_height: number;
privacy: string;
layout: string;
images_count: number;
images: Array<Image>;
}
interface GalleryImage extends GalleryItem {
type: string;
animated: boolean;
width: number;
height: number;
size: number;
bandwidth: number;
deletehash?: string;
gifv?: string;
mp4?: string;
webm?: string;
looping?: boolean;
section: string;
}
interface GalleryProfile {
total_gallery_comments: number;
total_gallery_favorites: number;
total_gallery_submissions: number;
trophies: Array<Trophy>;
}
interface Trophy {
id: number;
name: string;
name_clean: string;
description: string;
data: string;
data_link: string;
datetime: number;
image: string;
}
interface Image {
id: string;
title: string;
description: string;
datetime: number;
type: string;
animated: boolean;
width: number;
height: number;
size: number;
views: number;
bandwidth: number;
deletehash?: string;
name?: string;
section: string;
link: string;
gifv?: string;
mp4?: string;
webm?: string;
looping?: boolean;
vote?: string;
favorite: boolean;
nsfw?: boolean;
account_url?: string;
account_id?: number;
}
interface MemeMetadata {
meme_name: string;
top_text: string;
bottom_text: string;
bg_image: string;
}
interface Message {
id: number;
from: string;
account_id: number;
sender_id: number;
body: string;
conversation_id: number;
datetime: number;
}
interface Notification<T> {
id: number;
account_id: number;
viewed: boolean;
content: T;
}
interface AccountNotifications {
replies: Array<Notification<Comment>>;
messages: Array<Notification<Conversation>>;
}
interface Tag {
name: string;
followers: number;
total_items: number;
following?: boolean;
items: Array<GalleryItem>
}
interface TagVote {
ups: number;
downs: number;
name: string;
author: string;
}
interface Topic {
id: number;
name: string;
description: string;
}
interface Vote {
ups: number;
downs: number;
}
interface Error {
error: string;
request: string;
method: string;
}
}