@ifunny/ifunny-api-types 1.0.4 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/.devenv/bootstrap/bootstrapLib.nix +650 -0
  2. package/.devenv/bootstrap/default.nix +22 -0
  3. package/.devenv/bootstrap/lock-sources.nix +123 -0
  4. package/.devenv/bootstrap/resolve-input-paths.nix +34 -0
  5. package/.devenv/bootstrap/resolve-lock.nix +116 -0
  6. package/.devenv/changelog-cache.json +13 -0
  7. package/.devenv/devenv.fish +252 -0
  8. package/.devenv/imports.txt +0 -0
  9. package/.devenv/input-paths.txt +8 -0
  10. package/.devenv/load-exports +1 -0
  11. package/.devenv/nix-eval-cache.db +0 -0
  12. package/.devenv/nix-eval-cache.db.init.lock +0 -0
  13. package/.devenv/nixpkgs-config-99f33fda17d41bc9.nix +17 -0
  14. package/.devenv/nixpkgs-config-c46eff8321b73149.nix +29 -0
  15. package/.devenv/profiles/nix/bootstrap/bootstrapLib.nix +571 -0
  16. package/.devenv/profiles/nix/bootstrap/default.nix +19 -0
  17. package/.devenv/profiles/nix/bootstrap/resolve-lock.nix +157 -0
  18. package/.devenv/profiles/nix/imports.txt +0 -0
  19. package/.devenv/profiles/nix/input-paths.txt +4 -0
  20. package/.devenv/profiles/nix/load-exports +1 -0
  21. package/.devenv/profiles/nix/nix-eval-cache.db +0 -0
  22. package/.devenv/profiles/nix/nix-eval-cache.db-shm +0 -0
  23. package/.devenv/profiles/nix/nix-eval-cache.db-wal +0 -0
  24. package/.devenv/profiles/nix/nixpkgs-config-99f33fda17d41bc9.nix +17 -0
  25. package/.devenv/profiles/nix/shell-0d722b4fe4724c8e.sh +2270 -0
  26. package/.devenv/profiles/nix/shell-314b72302fb2c916.sh +2270 -0
  27. package/.devenv/profiles/nix/shell-6a4b00b5ca837a3b.sh +2270 -0
  28. package/.devenv/profiles/nix/shell-956adc1e664f64c3.sh +2270 -0
  29. package/.devenv/profiles/nix/shell-9dbff87fad44e8d9.sh +2270 -0
  30. package/.devenv/profiles/nix/shell-b1e9e1f82076662f.sh +2270 -0
  31. package/.devenv/profiles/nix/shell-b4f4bbfa36797bee.sh +2270 -0
  32. package/.devenv/profiles/nix/shell-c4b190d331c48d67.sh +2270 -0
  33. package/.devenv/profiles/nix/state/files.json +1 -0
  34. package/.devenv/profiles/nix/state/tasks.db +0 -0
  35. package/.devenv/profiles/nix/state/tasks.db-shm +0 -0
  36. package/.devenv/profiles/nix/state/tasks.db-wal +0 -0
  37. package/.devenv/profiles/nix/task-names.txt +5 -0
  38. package/.devenv/shell-086ca2c39799e6a6.sh +2270 -0
  39. package/.devenv/shell-2c06a35dd99be3d1.sh +2270 -0
  40. package/.devenv/shell-36f1fe0faec08873.sh +2270 -0
  41. package/.devenv/shell-676361065bda5b43.sh +2270 -0
  42. package/.devenv/shell-9f6cb513d1721fef.sh +2270 -0
  43. package/.devenv/shell-c0e4459b4f5922d7.sh +2270 -0
  44. package/.devenv/shell-c862a0db6e9ad5f4.sh +2270 -0
  45. package/.devenv/shell-d71ade933a43e837.sh +2270 -0
  46. package/.devenv/shell-dd73aac05b182946.sh +2270 -0
  47. package/.devenv/shell-e39d0b30a7e0eb13.sh +2270 -0
  48. package/.devenv/shell-env.sh +2275 -0
  49. package/.devenv/shell-f924d749ff8c17ee.sh +2270 -0
  50. package/.devenv/shell-rcfile.sh +152 -0
  51. package/.devenv/state/files.json +5 -0
  52. package/.devenv/state/git-hooks-install/hooks +1 -0
  53. package/.devenv/state/git-hooks-install/key +4 -0
  54. package/.devenv/state/prek/.lock +0 -0
  55. package/.devenv/state/prek/README +2 -0
  56. package/.devenv/state/prek/config-tracking.json +3 -0
  57. package/.devenv/state/prek/patches/1793595918715-562072.patch +26 -0
  58. package/.devenv/state/prek/patches/1793596283854-574354.patch +22881 -0
  59. package/.devenv/state/prek/patches/1793596332255-574728.patch +22870 -0
  60. package/.devenv/state/prek/patches/1793597557669-617911.patch +284 -0
  61. package/.devenv/state/prek/patches/1793856046749-331249.patch +2906 -0
  62. package/.devenv/state/prek/patches/1793856096552-331868.patch +2998 -0
  63. package/.devenv/state/prek/patches/1793856146786-332328.patch +3009 -0
  64. package/.devenv/state/prek/patches/1793856181490-332981.patch +11401 -0
  65. package/.devenv/state/prek/patches/1793856203087-333510.patch +11388 -0
  66. package/.devenv/state/prek/patches/1793856277935-334258.patch +11372 -0
  67. package/.devenv/state/prek/patches/1793856646955-337912.patch +8488 -0
  68. package/.devenv/state/prek/patches/1793856682905-338572.patch +8260 -0
  69. package/.devenv/state/prek/patches/1793857035751-356215.patch +8295 -0
  70. package/.devenv/state/tasks.db +0 -0
  71. package/.devenv/state/tasks.db.init.lock +0 -0
  72. package/.devenv/task-names.txt +7 -0
  73. package/.github/workflows/codeql.yml +72 -72
  74. package/.github/workflows/test.yml +31 -31
  75. package/.prettierignore +9 -0
  76. package/CHANGELOG.md +609 -427
  77. package/LICENSE +121 -121
  78. package/README.md +2 -2
  79. package/devenv.lock +103 -0
  80. package/devenv.nix +35 -0
  81. package/devenv.yaml +23 -0
  82. package/dist/errors/bad_request.js +7 -7
  83. package/dist/errors/bad_request.js.map +1 -1
  84. package/dist/errors/captcha_required.js +18 -18
  85. package/dist/errors/captcha_required.js.map +1 -1
  86. package/dist/errors/email_exists.js +7 -7
  87. package/dist/errors/email_exists.js.map +1 -1
  88. package/dist/errors/error.js +2 -2
  89. package/dist/errors/error_base.js +42 -42
  90. package/dist/errors/error_base.js.map +1 -1
  91. package/dist/errors/index.js +28 -28
  92. package/dist/errors/invalid_client.js +7 -7
  93. package/dist/errors/invalid_client.js.map +1 -1
  94. package/dist/errors/invalid_email.js +7 -7
  95. package/dist/errors/invalid_email.js.map +1 -1
  96. package/dist/errors/invalid_grant.js +7 -7
  97. package/dist/errors/invalid_grant.js.map +1 -1
  98. package/dist/errors/not_found.js +2 -2
  99. package/dist/errors/permission_denied.js +7 -7
  100. package/dist/errors/permission_denied.js.map +1 -1
  101. package/dist/errors/unauthorized.js +7 -7
  102. package/dist/errors/unauthorized.js.map +1 -1
  103. package/dist/errors/wrong_params.js +7 -7
  104. package/dist/errors/wrong_params.js.map +1 -1
  105. package/dist/index.js +20 -20
  106. package/dist/payloads/activity.js +49 -49
  107. package/dist/payloads/activity.js.map +1 -1
  108. package/dist/payloads/app.js +2 -2
  109. package/dist/payloads/appeal.js +13 -13
  110. package/dist/payloads/appeal.js.map +1 -1
  111. package/dist/payloads/ban.js +35 -35
  112. package/dist/payloads/ban.js.map +1 -1
  113. package/dist/payloads/base.js +2 -2
  114. package/dist/payloads/chat.js +37 -0
  115. package/dist/payloads/chat.js.map +1 -0
  116. package/dist/payloads/client.js +12 -12
  117. package/dist/payloads/client.js.map +1 -1
  118. package/dist/payloads/comment.js +41 -41
  119. package/dist/payloads/comment.js.map +1 -1
  120. package/dist/payloads/content.js +175 -175
  121. package/dist/payloads/content.js.map +1 -1
  122. package/dist/payloads/index.js +28 -26
  123. package/dist/payloads/index.js.map +1 -1
  124. package/dist/payloads/strike.js +2 -2
  125. package/dist/payloads/topics.js +72 -0
  126. package/dist/payloads/topics.js.map +1 -0
  127. package/dist/payloads/user.js +214 -214
  128. package/dist/payloads/user.js.map +1 -1
  129. package/dist/rest/account.js +2 -2
  130. package/dist/rest/content.js +53 -53
  131. package/dist/rest/content.js.map +1 -1
  132. package/dist/rest/counters.js +2 -2
  133. package/dist/rest/endpoints.js +198 -198
  134. package/dist/rest/endpoints.js.map +1 -1
  135. package/dist/rest/explore.js +81 -81
  136. package/dist/rest/explore.js.map +1 -1
  137. package/dist/rest/feeds.js +2 -2
  138. package/dist/rest/index.js +24 -24
  139. package/dist/rest/issues.js +2 -2
  140. package/dist/rest/oauth2.js +8 -8
  141. package/dist/rest/oauth2.js.map +1 -1
  142. package/dist/utils/index.js +18 -18
  143. package/dist/utils/rest.js +2 -2
  144. package/dist/utils/util.js +2 -2
  145. package/eslint.config.mjs +18 -0
  146. package/package.json +66 -50
  147. package/prettier.config.js +15 -0
  148. package/tag-check.sh +111 -0
  149. package/types/errors/bad_request.d.ts +11 -11
  150. package/types/errors/bad_request.d.ts.map +1 -1
  151. package/types/errors/captcha_required.d.ts +32 -32
  152. package/types/errors/captcha_required.d.ts.map +1 -1
  153. package/types/errors/email_exists.d.ts +14 -14
  154. package/types/errors/email_exists.d.ts.map +1 -1
  155. package/types/errors/error.d.ts +28 -28
  156. package/types/errors/error.d.ts.map +1 -1
  157. package/types/errors/error_base.d.ts +60 -60
  158. package/types/errors/error_base.d.ts.map +1 -1
  159. package/types/errors/index.d.ts +12 -12
  160. package/types/errors/invalid_client.d.ts +14 -14
  161. package/types/errors/invalid_client.d.ts.map +1 -1
  162. package/types/errors/invalid_email.d.ts +14 -14
  163. package/types/errors/invalid_email.d.ts.map +1 -1
  164. package/types/errors/invalid_grant.d.ts +11 -11
  165. package/types/errors/invalid_grant.d.ts.map +1 -1
  166. package/types/errors/not_found.d.ts +7 -7
  167. package/types/errors/permission_denied.d.ts +11 -11
  168. package/types/errors/permission_denied.d.ts.map +1 -1
  169. package/types/errors/unauthorized.d.ts +11 -11
  170. package/types/errors/unauthorized.d.ts.map +1 -1
  171. package/types/errors/wrong_params.d.ts +10 -10
  172. package/types/errors/wrong_params.d.ts.map +1 -1
  173. package/types/index.d.ts +4 -4
  174. package/types/payloads/activity.d.ts +113 -113
  175. package/types/payloads/activity.d.ts.map +1 -1
  176. package/types/payloads/app.d.ts +265 -265
  177. package/types/payloads/appeal.d.ts +21 -21
  178. package/types/payloads/appeal.d.ts.map +1 -1
  179. package/types/payloads/ban.d.ts +84 -84
  180. package/types/payloads/ban.d.ts.map +1 -1
  181. package/types/payloads/base.d.ts +4 -4
  182. package/types/payloads/chat.d.ts +117 -0
  183. package/types/payloads/chat.d.ts.map +1 -0
  184. package/types/payloads/client.d.ts +107 -107
  185. package/types/payloads/client.d.ts.map +1 -1
  186. package/types/payloads/comment.d.ts +123 -123
  187. package/types/payloads/comment.d.ts.map +1 -1
  188. package/types/payloads/content.d.ts +676 -677
  189. package/types/payloads/content.d.ts.map +1 -1
  190. package/types/payloads/index.d.ts +12 -10
  191. package/types/payloads/index.d.ts.map +1 -1
  192. package/types/payloads/strike.d.ts +14 -14
  193. package/types/payloads/topics.d.ts +45 -0
  194. package/types/payloads/topics.d.ts.map +1 -0
  195. package/types/payloads/user.d.ts +522 -522
  196. package/types/payloads/user.d.ts.map +1 -1
  197. package/types/rest/account.d.ts +3 -3
  198. package/types/rest/account.d.ts.map +1 -1
  199. package/types/rest/content.d.ts +95 -95
  200. package/types/rest/content.d.ts.map +1 -1
  201. package/types/rest/counters.d.ts +9 -9
  202. package/types/rest/counters.d.ts.map +1 -1
  203. package/types/rest/endpoints.d.ts +152 -152
  204. package/types/rest/explore.d.ts +112 -112
  205. package/types/rest/explore.d.ts.map +1 -1
  206. package/types/rest/feeds.d.ts +16 -16
  207. package/types/rest/index.d.ts +8 -8
  208. package/types/rest/issues.d.ts +15 -15
  209. package/types/rest/oauth2.d.ts +36 -36
  210. package/types/rest/oauth2.d.ts.map +1 -1
  211. package/types/utils/index.d.ts +2 -2
  212. package/types/utils/rest.d.ts +49 -49
  213. package/types/utils/rest.d.ts.map +1 -1
  214. package/types/utils/util.d.ts +79 -79
  215. package/types/utils/util.d.ts.map +1 -1
@@ -1,678 +1,677 @@
1
- import { APIUser } from "./user";
2
- import { HexCode, Size, EpochSec } from "../utils/util";
3
- /**
4
- * JSON data of an iFunny Post
5
- */
6
- export interface APIContentBase {
7
- gif?: APIGifCaptionContentData | APIGifContentData;
8
- coub?: APICoubContentData;
9
- video?: APIVideoContentData;
10
- video_clip?: APIVideoClipContentData;
11
- vine?: APIVineContentData;
12
- pic?: APIPicContentData;
13
- mem?: APIMemeContentData;
14
- comics?: APIComicsContentData;
15
- caption?: APICaptionContentData;
16
- app?: APIAppContentData;
17
- dem?: unknown;
18
- old?: unknown;
19
- /**
20
- * Unique id of the Content.\
21
- * Typically 9 characters long
22
- */
23
- id: string;
24
- /**
25
- * The type of the Content
26
- */
27
- type: APIContentType;
28
- /**
29
- * Content url of the Content
30
- */
31
- url: string;
32
- /**
33
- * Seems to be the same as {@link url APIContentBase#url}
34
- * ? Not always present on gifs and gif captions
35
- */
36
- share_url?: string;
37
- /**
38
- * If the Content uses the old watermark or the new one
39
- */
40
- old_watermark: boolean;
41
- /**
42
- * In-app share url.
43
- * @example
44
- * `https://ifunny.co/picture/${content.id}`
45
- * `https://ifunny.co/video/${content.id}`
46
- */
47
- link: string;
48
- /**
49
- * The title of the Content
50
- */
51
- title: string;
52
- /**
53
- * Fixed title of the Content
54
- * @example
55
- * `Gif memes ${content.id} by ${content.creator.nick}`
56
- * `Picture memes ${content.id} by ${content.creator.nick}: ${content.num.comments} comments`
57
- */
58
- fixed_title?: string;
59
- description?: string;
60
- /**
61
- * Array of tags on the Content
62
- */
63
- tags: string[];
64
- /**
65
- * The publish state of the Content
66
- */
67
- state: APIContentState;
68
- /**
69
- * EpochSec of when the Content was created (or repubbed if a repub) in seconds
70
- */
71
- date_create: EpochSec;
72
- /**
73
- * EpochSec of when the Content was published in seconds
74
- */
75
- publish_at: EpochSec;
76
- /**
77
- * Is the Content smiled by the Client
78
- */
79
- is_smiled: boolean;
80
- /**
81
- * Is the Content unsmiled by the Client
82
- */
83
- is_unsmiled: boolean;
84
- /**
85
- * Was the Content removed by iFunny
86
- */
87
- is_abused: boolean;
88
- /**
89
- * Is the Content featured
90
- */
91
- is_featured: boolean;
92
- /**
93
- * Is the Content republished by the Client
94
- */
95
- is_republished: boolean;
96
- /**
97
- * Is the Content pinned by the creator
98
- */
99
- is_pinned: boolean;
100
- /**
101
- * Background color of the Content.
102
- * @example
103
- * '55ff00'
104
- */
105
- bg_color?: HexCode;
106
- /**
107
- * The {@link APIContentThumbnail thumbnail} of the Content
108
- */
109
- thumb: APIContentThumbnail;
110
- /**
111
- * The Content's {@link APIContentCopyright copyright} data
112
- */
113
- copyright?: APIContentCopyright;
114
- /**
115
- * The {@link APIContentNums numbers} on the Content
116
- */
117
- num: APIContentNums;
118
- /**
119
- * The author of the Content
120
- */
121
- creator?: APIContentCreator;
122
- /**
123
- * Size of the Content
124
- */
125
- size: Size;
126
- /**
127
- * EpochSec of when the Content was featured if it was featured
128
- */
129
- issue_at?: EpochSec;
130
- /**
131
- * Url of the original source
132
- * ? Only seen on Coubs
133
- */
134
- traceback_url?: string;
135
- /**
136
- * ? Decompiled, not observed
137
- */
138
- engagement_rate?: number;
139
- /**
140
- * ? Decompiled, not observed
141
- */
142
- engagement_rate_explain?: string;
143
- /**
144
- * The Content's visibility
145
- */
146
- visibility: APIContentVisibility;
147
- /**
148
- * TODO: ShotStatus description
149
- */
150
- shot_status: APIContentShotStatus;
151
- /**
152
- * TODO: fast_start description
153
- */
154
- fast_start: boolean;
155
- subtitles?: APIContentSubtitles[];
156
- /**
157
- * The risk level of the Content\
158
- * `1` Default
159
- */
160
- risk: number;
161
- /**
162
- * @example
163
- * `https://ifunny.co/picture/${content.id}`
164
- */
165
- canonical_url: string;
166
- /**
167
- * Text generated from iFunny's OCR
168
- */
169
- ocr_text?: string;
170
- /**
171
- * Can the Content still be boosted
172
- */
173
- can_be_boosted: boolean;
174
- /**
175
- * Latitude Coordinate
176
- */
177
- lat?: number;
178
- /**
179
- * Longitude Coordinate
180
- */
181
- lon?: number;
182
- /**
183
- * Only seen present on videos and gifs
184
- */
185
- has_header?: boolean;
186
- /**
187
- * The source of the Content if it's a republish
188
- */
189
- source?: APIContentSource;
190
- /**
191
- * From Tag (maybe?)\
192
- * ? Only seems to appear in feature feed. Possibly incorrect documentation
193
- */
194
- ftag?: APIFeedFrom;
195
- }
196
- /**
197
- * Content visibility types
198
- */
199
- export declare enum ContentVisibility {
200
- /**
201
- * Anyone can see the Content
202
- */
203
- PUBLIC = "public",
204
- /**
205
- * Content is hidden from collective and explore
206
- */
207
- SUBSCRIBERS = "subscribers",
208
- /**
209
- * Only the creator can see the Content
210
- */
211
- CLOSED = "closed",
212
- /**
213
- * Only visible in Chats
214
- */
215
- CHATS = "chats"
216
- }
217
- export declare type APIContentVisibility = `${ContentVisibility}`;
218
- /**
219
- * Content shot status types
220
- */
221
- export declare enum ShotStatus {
222
- /**
223
- * The Content was approved for upload and comment attachments are enabled
224
- */
225
- APPROVED = "approved",
226
- /**
227
- * The Content was deleted by the automoderation system
228
- */
229
- HARD_SHOT = "hardShot",
230
- /**
231
- * Content was approved for upload, but can't be used in comments
232
- */
233
- SHOT = "shot"
234
- }
235
- /**
236
- * Possible shot statuses
237
- */
238
- export declare type APIContentShotStatus = `${ShotStatus}`;
239
- /**
240
- * All currently known Content types
241
- */
242
- export declare enum ContentType {
243
- /**
244
- * Most common video Content type\
245
- * Data key: `video_clip`
246
- */
247
- VIDEO_CLIP = "video_clip",
248
- /**
249
- * A video uploaded from a url like YouTube\
250
- * Data key: `video`
251
- */
252
- VIDEO = "video",
253
- /**
254
- * A video uploaded from vine\
255
- * Data key: `vine`
256
- */
257
- VINE = "vine",
258
- /**
259
- * Video meme from {@link https://coub.com Coub}\
260
- * Data key: `coub`
261
- */
262
- COUB = "coub",
263
- /**
264
- * A Gif Content\
265
- * Data key: `gif`
266
- */
267
- GIF = "gif",
268
- /**
269
- * A Gif Content with a custom caption\
270
- * Data key: `gif`
271
- */
272
- GIF_CAPTION = "gif_caption",
273
- /**
274
- * An image meme with a custom caption\
275
- * Data key: `caption`
276
- */
277
- CAPTION = "caption",
278
- /**
279
- * An image meme\
280
- * Data key: `pic`
281
- */
282
- PIC = "pic",
283
- /**
284
- * Image uploaded from iFunny's old "Meme" creator.\
285
- * Data key: `mem`
286
- */
287
- MEME = "mem",
288
- /**
289
- * Image uploaded from iFunny's old "Comic" creator.\
290
- * Data key: `comics`
291
- */
292
- COMICS = "comics",
293
- /**
294
- * An interactive Content from iFunny\
295
- * Data key: `app`\
296
- * Deprecated by iFunny. This Content type has been removed from iFunny
297
- */
298
- APP = "app",
299
- /**
300
- * Unknown Content type\
301
- * Data key: `old` (Unknown due to deprecation)\
302
- * TODO: Document what ContentType.OLD is
303
- */
304
- OLD = "old",
305
- /**
306
- * Unknown Content type\
307
- * Data key: `dem` (Unknown due to deprecation)\
308
- * TODO: Document what ContentType.DEM is
309
- */
310
- DEM = "dem",
311
- /**
312
- * Unknown Content type\
313
- * Data key: `special` (unknown due to being observed)
314
- */
315
- SPECIAL = "special"
316
- }
317
- /**
318
- * Possible Content types
319
- */
320
- export declare type APIContentType = `${ContentType}`;
321
- export declare enum ContentState {
322
- /**
323
- * Content that was scheduled to be published later
324
- */
325
- DELAYED = "delayed",
326
- /**
327
- * Content was deleted
328
- */
329
- DELETED = "deleted",
330
- /**
331
- * Content is a draft that hasn't been published
332
- */
333
- DRAFT = "draft",
334
- /**
335
- * The Content is published. Default
336
- */
337
- PUBLISHED = "published"
338
- }
339
- /**
340
- * Possible Content states
341
- */
342
- export declare type APIContentState = `${ContentState}`;
343
- /**
344
- * Where an action was completed
345
- * @example
346
- * PUT /v4/reads/:contentId?from=:ACTION_LOCATION
347
- */
348
- export declare enum FeedFrom {
349
- ATTACHMENT = "attach",
350
- CHANNEL = "channel",
351
- COLLECTIVE = "coll",
352
- FEATURES = "feat",
353
- MONOFEED = "monofeed",
354
- MYSMILES = "mySmiles",
355
- MY_SMILES = "my-smiles",
356
- MY_COMMENTS = "mycomms",
357
- PROFILE = "prof",
358
- REC = "rec",
359
- SEAR = "sear",
360
- SUBS = "subs",
361
- USER_FEATURES = "userfeat",
362
- READS = "reads",
363
- TAG = "tag"
364
- }
365
- /**
366
- * Possible `from` locations
367
- */
368
- export declare type APIFeedFrom = `${FeedFrom}`;
369
- export declare type APIFTag = APIFeedFrom;
370
- /**
371
- * The creator object for the Content
372
- */
373
- export declare type APIContentCreator = APIUser;
374
- /**
375
- * Alias for {@link APIContentCreator}
376
- */
377
- export declare type APIContentAuthor = APIContentCreator;
378
- /**
379
- * Numbers attached to the Content
380
- */
381
- export interface APIContentNums {
382
- /**
383
- * The amount of smiles the Content has
384
- */
385
- smiles: number;
386
- /**
387
- * The amount of unsmiles the Content has
388
- */
389
- unsmiles: number;
390
- /**
391
- * How many smiles came from users not signed in to iFunny
392
- * ? Not possible in-app but possible in the API by using a basic token
393
- */
394
- guest_smiles: number;
395
- /**
396
- * How many comments are on the Content
397
- */
398
- comments: number;
399
- /**
400
- * How many views the Content has
401
- */
402
- views: number;
403
- /**
404
- * How many republishes the Content has
405
- */
406
- republished: number;
407
- /**
408
- * How many shares the Content has
409
- */
410
- shares: number;
411
- }
412
- /**
413
- * Copyright data for the Content
414
- */
415
- export interface APIContentCopyright {
416
- /**
417
- * Note about the copyright
418
- */
419
- note?: string;
420
- /**
421
- * URL of original source
422
- */
423
- url?: string;
424
- }
425
- /**
426
- * The Thumbnail object returned from the API\
427
- * @example
428
- * ```ts
429
- * APIContentThumbnail.url = `https://imageproxy.ifunny.co/${params}/images/${content_id}.jpg`
430
- * APIContentThumbnail.webp_url = `https://imageproxy.ifunny.co/${params}/images/${content_id}.webp
431
- * ```
432
- * Content URL params:\
433
- * `crop:x-{number}` crops `number` pixels from bottom of the image\
434
- * `crop:x+{number}` leaves `number` pixels at the top, and crops the rest\
435
- * `crop:square` makes the image a square aspect ratio\
436
- * `resize:{number}` changes the size of the image\
437
- * `quality:{number}` changes the image quality
438
- *
439
- *
440
- * ? Bottom iFunny watermarks are 20 pixels tall\
441
- * ? `crop:x-20` crops the watermark from an image
442
- */
443
- export interface APIContentThumbnail {
444
- /**
445
- * crop:x-20,crop:square,resize:65x,quality:90x75\
446
- * `jpg`
447
- */
448
- small_url?: string;
449
- /**
450
- * crop:x-20,crop:square,resize:160x,quality:90x75\
451
- * `jpg`
452
- */
453
- url: string;
454
- /**
455
- * crop:x-20,crop:square,resize:320x,quality:90x75\
456
- * `jpg`
457
- */
458
- large_url: string;
459
- /**
460
- * crop:x-20,resize:640x,quality:90x75\
461
- * `jpg`
462
- */
463
- x640_url: string;
464
- /**
465
- * crop:x-20,resize:640x,quality:90x75
466
- */
467
- webp_url: string;
468
- /**
469
- * crop:x-20,crop:square,resize:320x,quality:90
470
- */
471
- large_webp_url: string;
472
- /**
473
- * crop:x-20,resize:640x,quality:90
474
- */
475
- x640_webp_url: string;
476
- /**
477
- * crop:x-20,resize:320x,crop:x800,quality:90x75
478
- */
479
- proportional_url: string;
480
- /**
481
- * crop:x-20,resize:320x,crop:x800,quality:90
482
- */
483
- proportional_webp_url: string;
484
- /**
485
- * The proportional size of the image
486
- */
487
- proportional_size: Size;
488
- }
489
- /**
490
- * Decompiled, not observed
491
- */
492
- export interface APIContentSubtitles {
493
- /**
494
- * ? Possibly Language Code
495
- * @example
496
- * "en-US"
497
- */
498
- lang: string;
499
- /**
500
- * ? Must end in .srt or .vtt
501
- */
502
- url: string;
503
- }
504
- export declare enum VideoSource {
505
- USER = "user",
506
- INSTAGRAM = "instagram"
507
- }
508
- export declare type APIVideoSourceType = `${VideoSource}`;
509
- export interface APICoubContentData {
510
- /**
511
- * WebP thumbnail of the Coub
512
- */
513
- screen_url: string;
514
- bytes: number;
515
- /**
516
- * Original Coub source
517
- */
518
- trackback_url: string;
519
- /**
520
- * Length in seconds
521
- */
522
- duration: number;
523
- }
524
- export interface APIVideoContentData {
525
- /**
526
- * Url of original video
527
- */
528
- url: string;
529
- /**
530
- * Length in seconds
531
- */
532
- duration: number;
533
- /**
534
- * Length in seconds
535
- */
536
- length: number;
537
- }
538
- export interface APIVideoClipContentData {
539
- /**
540
- * JPEG image of the video clip
541
- */
542
- screen_url: string;
543
- bytes: number;
544
- source_type: APIVideoSourceType;
545
- /**
546
- * Logo url to the source if not 'user'
547
- */
548
- logo_url?: string;
549
- /**
550
- * In seconds
551
- */
552
- duration: EpochSec;
553
- }
554
- export interface APIVineContentData {
555
- screen_url: string;
556
- bytes: number;
557
- }
558
- /**
559
- * Pic Data
560
- */
561
- export interface APIPicContentData {
562
- /**
563
- * webp format url of the Content
564
- */
565
- webp_url: string;
566
- }
567
- export interface APICaptionContentData {
568
- /**
569
- * The caption of the Content
570
- */
571
- caption_text: string;
572
- }
573
- export declare type APIComicsContentData = APIPicContentData;
574
- export declare type APIMemeContentData = APIPicContentData;
575
- export interface APIGifContentData {
576
- /**
577
- * JPEG url of the Content
578
- */
579
- screen_url: string;
580
- /**
581
- * How many bytes the Content is
582
- */
583
- bytes: number;
584
- /**
585
- * Url of the Content in MP4 format
586
- */
587
- mp4_url: string;
588
- /**
589
- * How many bytes the mp4 version is
590
- */
591
- mp4_bytes: number;
592
- webm_url?: string;
593
- webm_bytes: number;
594
- }
595
- export declare type APIGifCaptionContentData = APIGifContentData & APICaptionContentData;
596
- export interface APIAppContentData {
597
- url: string;
598
- is_scroll_allowed: boolean;
599
- }
600
- /**
601
- * The content data for content from Content.pic, Content.video_clip, etc.
602
- */
603
- export declare type APIContentData = APIAppContentData | APICaptionContentData | APIComicsContentData | APICoubContentData | APIGifCaptionContentData | APIGifContentData | APIMemeContentData | APIPicContentData | APIVideoClipContentData | APIVideoContentData | APIVineContentData | UnknownContentData;
604
- export interface UnknownContentData extends JSON {
605
- }
606
- export interface APICoubContent extends APIContentBase {
607
- type: ContentType.COUB;
608
- coub: APICoubContentData;
609
- }
610
- export interface APIVideoClipContent extends APIContentBase {
611
- type: ContentType.VIDEO_CLIP;
612
- video_clip: APIVideoClipContentData;
613
- }
614
- export interface APIVideoContent extends APIContentBase {
615
- type: ContentType.VIDEO;
616
- video: APIVideoContentData;
617
- }
618
- export interface APIVineContent extends APIContentBase {
619
- type: ContentType.VINE;
620
- vine: APIVineContentData;
621
- }
622
- export interface APICaptionContent extends APIContentBase {
623
- type: ContentType.CAPTION;
624
- caption: APICaptionContentData;
625
- }
626
- export interface APIComicsContent extends APIContentBase {
627
- type: ContentType.COMICS;
628
- comics: APIComicsContentData;
629
- }
630
- export interface APIMemeContent extends APIContentBase {
631
- type: ContentType.MEME;
632
- mem: APIMemeContentData;
633
- }
634
- export interface APIPicContent extends APIContentBase {
635
- type: ContentType.PIC;
636
- pic?: APIPicContentData;
637
- }
638
- export interface APIGifContent extends APIContentBase {
639
- type: ContentType.GIF;
640
- gif: APIGifContentData;
641
- }
642
- export interface APIGifCaptionContent extends APIContentBase {
643
- type: ContentType.GIF_CAPTION;
644
- gif: APIGifCaptionContentData;
645
- }
646
- export interface APIAppContent extends APIContentBase {
647
- type: ContentType.APP;
648
- app: APIAppContentData;
649
- }
650
- export interface APIUnknownContent extends APIContentBase {
651
- type: ContentType.OLD | ContentType.DEM | ContentType.SPECIAL;
652
- }
653
- /**
654
- * The source of the original content
655
- */
656
- export declare type APIContentSource = Pick<APIContent, "id" | "date_create" | "creator">;
657
- /**
658
- * Any possible Content type
659
- */
660
- export declare type APIContent = APIContentVideo | APIContentPic | APIContentGif | APIContentSpecial;
661
- /**
662
- * All video/mp4 Content types
663
- */
664
- export declare type APIContentVideo = APICoubContent | APIVideoClipContent | APIVideoContent | APIVineContent;
665
- /**
666
- * All picture/jpg Content types
667
- */
668
- export declare type APIContentPic = APICaptionContent | APIPicContent | APIComicsContent | APIMemeContent;
669
- /**
670
- * All Gif Content types
671
- */
672
- export declare type APIContentGif = APIGifContent | APIGifCaptionContent;
673
- /**
674
- * All currently undocumented Content types. Once documented, these may move into the appropriate Content types above.\
675
- * ? Currently: 'dem', 'old', 'app'
676
- */
677
- export declare type APIContentSpecial = APIUnknownContent | APIAppContent;
1
+ import { APIUser } from "./user";
2
+ import { HexCode, Size, EpochSec } from "../utils/util";
3
+ /**
4
+ * JSON data of an iFunny Post
5
+ */
6
+ export interface APIContentBase {
7
+ gif?: APIGifCaptionContentData | APIGifContentData;
8
+ coub?: APICoubContentData;
9
+ video?: APIVideoContentData;
10
+ video_clip?: APIVideoClipContentData;
11
+ vine?: APIVineContentData;
12
+ pic?: APIPicContentData;
13
+ mem?: APIMemeContentData;
14
+ comics?: APIComicsContentData;
15
+ caption?: APICaptionContentData;
16
+ app?: APIAppContentData;
17
+ dem?: unknown;
18
+ old?: unknown;
19
+ /**
20
+ * Unique id of the Content.\
21
+ * Typically 9 characters long
22
+ */
23
+ id: string;
24
+ /**
25
+ * The type of the Content
26
+ */
27
+ type: APIContentType;
28
+ /**
29
+ * Content url of the Content
30
+ */
31
+ url: string;
32
+ /**
33
+ * Seems to be the same as {@link url APIContentBase#url}
34
+ * ? Not always present on gifs and gif captions
35
+ */
36
+ share_url?: string;
37
+ /**
38
+ * If the Content uses the old watermark or the new one
39
+ */
40
+ old_watermark: boolean;
41
+ /**
42
+ * In-app share url.
43
+ * @example
44
+ * `https://ifunny.co/picture/${content.id}`
45
+ * `https://ifunny.co/video/${content.id}`
46
+ */
47
+ link: string;
48
+ /**
49
+ * The title of the Content
50
+ */
51
+ title: string;
52
+ /**
53
+ * Fixed title of the Content
54
+ * @example
55
+ * `Gif memes ${content.id} by ${content.creator.nick}`
56
+ * `Picture memes ${content.id} by ${content.creator.nick}: ${content.num.comments} comments`
57
+ */
58
+ fixed_title?: string;
59
+ description?: string;
60
+ /**
61
+ * Array of tags on the Content
62
+ */
63
+ tags: string[];
64
+ /**
65
+ * The publish state of the Content
66
+ */
67
+ state: APIContentState;
68
+ /**
69
+ * EpochSec of when the Content was created (or repubbed if a repub) in seconds
70
+ */
71
+ date_create: EpochSec;
72
+ /**
73
+ * EpochSec of when the Content was published in seconds
74
+ */
75
+ publish_at: EpochSec;
76
+ /**
77
+ * Is the Content smiled by the Client
78
+ */
79
+ is_smiled: boolean;
80
+ /**
81
+ * Is the Content unsmiled by the Client
82
+ */
83
+ is_unsmiled: boolean;
84
+ /**
85
+ * Was the Content removed by iFunny
86
+ */
87
+ is_abused: boolean;
88
+ /**
89
+ * Is the Content featured
90
+ */
91
+ is_featured: boolean;
92
+ /**
93
+ * Is the Content republished by the Client
94
+ */
95
+ is_republished: boolean;
96
+ /**
97
+ * Is the Content pinned by the creator
98
+ */
99
+ is_pinned: boolean;
100
+ /**
101
+ * Background color of the Content.
102
+ * @example
103
+ * '55ff00'
104
+ */
105
+ bg_color?: HexCode;
106
+ /**
107
+ * The {@link APIContentThumbnail thumbnail} of the Content
108
+ */
109
+ thumb: APIContentThumbnail;
110
+ /**
111
+ * The Content's {@link APIContentCopyright copyright} data
112
+ */
113
+ copyright?: APIContentCopyright;
114
+ /**
115
+ * The {@link APIContentNums numbers} on the Content
116
+ */
117
+ num: APIContentNums;
118
+ /**
119
+ * The author of the Content
120
+ */
121
+ creator?: APIContentCreator;
122
+ /**
123
+ * Size of the Content
124
+ */
125
+ size: Size;
126
+ /**
127
+ * EpochSec of when the Content was featured if it was featured
128
+ */
129
+ issue_at?: EpochSec;
130
+ /**
131
+ * Url of the original source
132
+ * ? Only seen on Coubs
133
+ */
134
+ traceback_url?: string;
135
+ /**
136
+ * ? Decompiled, not observed
137
+ */
138
+ engagement_rate?: number;
139
+ /**
140
+ * ? Decompiled, not observed
141
+ */
142
+ engagement_rate_explain?: string;
143
+ /**
144
+ * The Content's visibility
145
+ */
146
+ visibility: APIContentVisibility;
147
+ /**
148
+ * TODO: ShotStatus description
149
+ */
150
+ shot_status: APIContentShotStatus;
151
+ /**
152
+ * TODO: fast_start description
153
+ */
154
+ fast_start: boolean;
155
+ subtitles?: APIContentSubtitles[];
156
+ /**
157
+ * The risk level of the Content\
158
+ * `1` Default
159
+ */
160
+ risk: number;
161
+ /**
162
+ * @example
163
+ * `https://ifunny.co/picture/${content.id}`
164
+ */
165
+ canonical_url: string;
166
+ /**
167
+ * Text generated from iFunny's OCR
168
+ */
169
+ ocr_text?: string;
170
+ /**
171
+ * Can the Content still be boosted
172
+ */
173
+ can_be_boosted: boolean;
174
+ /**
175
+ * Latitude Coordinate
176
+ */
177
+ lat?: number;
178
+ /**
179
+ * Longitude Coordinate
180
+ */
181
+ lon?: number;
182
+ /**
183
+ * Only seen present on videos and gifs
184
+ */
185
+ has_header?: boolean;
186
+ /**
187
+ * The source of the Content if it's a republish
188
+ */
189
+ source?: APIContentSource;
190
+ /**
191
+ * From Tag (maybe?)\
192
+ * ? Only seems to appear in feature feed. Possibly incorrect documentation
193
+ */
194
+ ftag?: APIFeedFrom;
195
+ }
196
+ /**
197
+ * Content visibility types
198
+ */
199
+ export declare enum ContentVisibility {
200
+ /**
201
+ * Anyone can see the Content
202
+ */
203
+ PUBLIC = "public",
204
+ /**
205
+ * Content is hidden from collective and explore
206
+ */
207
+ SUBSCRIBERS = "subscribers",
208
+ /**
209
+ * Only the creator can see the Content
210
+ */
211
+ CLOSED = "closed",
212
+ /**
213
+ * Only visible in Chats
214
+ */
215
+ CHATS = "chats"
216
+ }
217
+ export type APIContentVisibility = `${ContentVisibility}`;
218
+ /**
219
+ * Content shot status types
220
+ */
221
+ export declare enum ShotStatus {
222
+ /**
223
+ * The Content was approved for upload and comment attachments are enabled
224
+ */
225
+ APPROVED = "approved",
226
+ /**
227
+ * The Content was deleted by the automoderation system
228
+ */
229
+ HARD_SHOT = "hardShot",
230
+ /**
231
+ * Content was approved for upload, but can't be used in comments
232
+ */
233
+ SHOT = "shot"
234
+ }
235
+ /**
236
+ * Possible shot statuses
237
+ */
238
+ export type APIContentShotStatus = `${ShotStatus}`;
239
+ /**
240
+ * All currently known Content types
241
+ */
242
+ export declare enum ContentType {
243
+ /**
244
+ * Most common video Content type\
245
+ * Data key: `video_clip`
246
+ */
247
+ VIDEO_CLIP = "video_clip",
248
+ /**
249
+ * A video uploaded from a url like YouTube\
250
+ * Data key: `video`
251
+ */
252
+ VIDEO = "video",
253
+ /**
254
+ * A video uploaded from vine\
255
+ * Data key: `vine`
256
+ */
257
+ VINE = "vine",
258
+ /**
259
+ * Video meme from {@link https://coub.com Coub}\
260
+ * Data key: `coub`
261
+ */
262
+ COUB = "coub",
263
+ /**
264
+ * A Gif Content\
265
+ * Data key: `gif`
266
+ */
267
+ GIF = "gif",
268
+ /**
269
+ * A Gif Content with a custom caption\
270
+ * Data key: `gif`
271
+ */
272
+ GIF_CAPTION = "gif_caption",
273
+ /**
274
+ * An image meme with a custom caption\
275
+ * Data key: `caption`
276
+ */
277
+ CAPTION = "caption",
278
+ /**
279
+ * An image meme\
280
+ * Data key: `pic`
281
+ */
282
+ PIC = "pic",
283
+ /**
284
+ * Image uploaded from iFunny's old "Meme" creator.\
285
+ * Data key: `mem`
286
+ */
287
+ MEME = "mem",
288
+ /**
289
+ * Image uploaded from iFunny's old "Comic" creator.\
290
+ * Data key: `comics`
291
+ */
292
+ COMICS = "comics",
293
+ /**
294
+ * An interactive Content from iFunny\
295
+ * Data key: `app`\
296
+ * Deprecated by iFunny. This Content type has been removed from iFunny
297
+ */
298
+ APP = "app",
299
+ /**
300
+ * Unknown Content type\
301
+ * Data key: `old` (Unknown due to deprecation)\
302
+ * TODO: Document what ContentType.OLD is
303
+ */
304
+ OLD = "old",
305
+ /**
306
+ * Unknown Content type\
307
+ * Data key: `dem` (Unknown due to deprecation)\
308
+ * TODO: Document what ContentType.DEM is
309
+ */
310
+ DEM = "dem",
311
+ /**
312
+ * Unknown Content type\
313
+ * Data key: `special` (unknown due to being observed)
314
+ */
315
+ SPECIAL = "special"
316
+ }
317
+ /**
318
+ * Possible Content types
319
+ */
320
+ export type APIContentType = `${ContentType}`;
321
+ export declare enum ContentState {
322
+ /**
323
+ * Content that was scheduled to be published later
324
+ */
325
+ DELAYED = "delayed",
326
+ /**
327
+ * Content was deleted
328
+ */
329
+ DELETED = "deleted",
330
+ /**
331
+ * Content is a draft that hasn't been published
332
+ */
333
+ DRAFT = "draft",
334
+ /**
335
+ * The Content is published. Default
336
+ */
337
+ PUBLISHED = "published"
338
+ }
339
+ /**
340
+ * Possible Content states
341
+ */
342
+ export type APIContentState = `${ContentState}`;
343
+ /**
344
+ * Where an action was completed
345
+ * @example
346
+ * PUT /v4/reads/:contentId?from=:ACTION_LOCATION
347
+ */
348
+ export declare enum FeedFrom {
349
+ ATTACHMENT = "attach",
350
+ CHANNEL = "channel",
351
+ COLLECTIVE = "coll",
352
+ FEATURES = "feat",
353
+ MONOFEED = "monofeed",
354
+ MYSMILES = "mySmiles",
355
+ MY_SMILES = "my-smiles",
356
+ MY_COMMENTS = "mycomms",
357
+ PROFILE = "prof",
358
+ REC = "rec",
359
+ SEAR = "sear",
360
+ SUBS = "subs",
361
+ USER_FEATURES = "userfeat",
362
+ READS = "reads",
363
+ TAG = "tag"
364
+ }
365
+ /**
366
+ * Possible `from` locations
367
+ */
368
+ export type APIFeedFrom = `${FeedFrom}`;
369
+ export type APIFTag = APIFeedFrom;
370
+ /**
371
+ * The creator object for the Content
372
+ */
373
+ export type APIContentCreator = APIUser;
374
+ /**
375
+ * Alias for {@link APIContentCreator}
376
+ */
377
+ export type APIContentAuthor = APIContentCreator;
378
+ /**
379
+ * Numbers attached to the Content
380
+ */
381
+ export interface APIContentNums {
382
+ /**
383
+ * The amount of smiles the Content has
384
+ */
385
+ smiles: number;
386
+ /**
387
+ * The amount of unsmiles the Content has
388
+ */
389
+ unsmiles: number;
390
+ /**
391
+ * How many smiles came from users not signed in to iFunny
392
+ * ? Not possible in-app but possible in the API by using a basic token
393
+ */
394
+ guest_smiles: number;
395
+ /**
396
+ * How many comments are on the Content
397
+ */
398
+ comments: number;
399
+ /**
400
+ * How many views the Content has
401
+ */
402
+ views: number;
403
+ /**
404
+ * How many republishes the Content has
405
+ */
406
+ republished: number;
407
+ /**
408
+ * How many shares the Content has
409
+ */
410
+ shares: number;
411
+ }
412
+ /**
413
+ * Copyright data for the Content
414
+ */
415
+ export interface APIContentCopyright {
416
+ /**
417
+ * Note about the copyright
418
+ */
419
+ note?: string;
420
+ /**
421
+ * URL of original source
422
+ */
423
+ url?: string;
424
+ }
425
+ /**
426
+ * The Thumbnail object returned from the API\
427
+ * @example
428
+ * ```ts
429
+ * APIContentThumbnail.url = `https://imageproxy.ifunny.co/${params}/images/${content_id}.jpg`
430
+ * APIContentThumbnail.webp_url = `https://imageproxy.ifunny.co/${params}/images/${content_id}.webp
431
+ * ```
432
+ * Content URL params:\
433
+ * `crop:x-{number}` crops `number` pixels from bottom of the image\
434
+ * `crop:x+{number}` leaves `number` pixels at the top, and crops the rest\
435
+ * `crop:square` makes the image a square aspect ratio\
436
+ * `resize:{number}` changes the size of the image\
437
+ * `quality:{number}` changes the image quality
438
+ *
439
+ *
440
+ * ? Bottom iFunny watermarks are 20 pixels tall\
441
+ * ? `crop:x-20` crops the watermark from an image
442
+ */
443
+ export interface APIContentThumbnail {
444
+ /**
445
+ * crop:x-20,crop:square,resize:65x,quality:90x75\
446
+ * `jpg`
447
+ */
448
+ small_url?: string;
449
+ /**
450
+ * crop:x-20,crop:square,resize:160x,quality:90x75\
451
+ * `jpg`
452
+ */
453
+ url: string;
454
+ /**
455
+ * crop:x-20,crop:square,resize:320x,quality:90x75\
456
+ * `jpg`
457
+ */
458
+ large_url: string;
459
+ /**
460
+ * crop:x-20,resize:640x,quality:90x75\
461
+ * `jpg`
462
+ */
463
+ x640_url: string;
464
+ /**
465
+ * crop:x-20,resize:640x,quality:90x75
466
+ */
467
+ webp_url: string;
468
+ /**
469
+ * crop:x-20,crop:square,resize:320x,quality:90
470
+ */
471
+ large_webp_url: string;
472
+ /**
473
+ * crop:x-20,resize:640x,quality:90
474
+ */
475
+ x640_webp_url: string;
476
+ /**
477
+ * crop:x-20,resize:320x,crop:x800,quality:90x75
478
+ */
479
+ proportional_url: string;
480
+ /**
481
+ * crop:x-20,resize:320x,crop:x800,quality:90
482
+ */
483
+ proportional_webp_url: string;
484
+ /**
485
+ * The proportional size of the image
486
+ */
487
+ proportional_size: Size;
488
+ }
489
+ /**
490
+ * Decompiled, not observed
491
+ */
492
+ export interface APIContentSubtitles {
493
+ /**
494
+ * ? Possibly Language Code
495
+ * @example
496
+ * "en-US"
497
+ */
498
+ lang: string;
499
+ /**
500
+ * ? Must end in .srt or .vtt
501
+ */
502
+ url: string;
503
+ }
504
+ export declare enum VideoSource {
505
+ USER = "user",
506
+ INSTAGRAM = "instagram"
507
+ }
508
+ export type APIVideoSourceType = `${VideoSource}`;
509
+ export interface APICoubContentData {
510
+ /**
511
+ * WebP thumbnail of the Coub
512
+ */
513
+ screen_url: string;
514
+ bytes: number;
515
+ /**
516
+ * Original Coub source
517
+ */
518
+ trackback_url: string;
519
+ /**
520
+ * Length in seconds
521
+ */
522
+ duration: number;
523
+ }
524
+ export interface APIVideoContentData {
525
+ /**
526
+ * Url of original video
527
+ */
528
+ url: string;
529
+ /**
530
+ * Length in seconds
531
+ */
532
+ duration: number;
533
+ /**
534
+ * Length in seconds
535
+ */
536
+ length: number;
537
+ }
538
+ export interface APIVideoClipContentData {
539
+ /**
540
+ * JPEG image of the video clip
541
+ */
542
+ screen_url: string;
543
+ bytes: number;
544
+ source_type: APIVideoSourceType;
545
+ /**
546
+ * Logo url to the source if not 'user'
547
+ */
548
+ logo_url?: string;
549
+ /**
550
+ * In seconds
551
+ */
552
+ duration: EpochSec;
553
+ }
554
+ export interface APIVineContentData {
555
+ screen_url: string;
556
+ bytes: number;
557
+ }
558
+ /**
559
+ * Pic Data
560
+ */
561
+ export interface APIPicContentData {
562
+ /**
563
+ * webp format url of the Content
564
+ */
565
+ webp_url: string;
566
+ }
567
+ export interface APICaptionContentData {
568
+ /**
569
+ * The caption of the Content
570
+ */
571
+ caption_text: string;
572
+ }
573
+ export type APIComicsContentData = APIPicContentData;
574
+ export type APIMemeContentData = APIPicContentData;
575
+ export interface APIGifContentData {
576
+ /**
577
+ * JPEG url of the Content
578
+ */
579
+ screen_url: string;
580
+ /**
581
+ * How many bytes the Content is
582
+ */
583
+ bytes: number;
584
+ /**
585
+ * Url of the Content in MP4 format
586
+ */
587
+ mp4_url: string;
588
+ /**
589
+ * How many bytes the mp4 version is
590
+ */
591
+ mp4_bytes: number;
592
+ webm_url?: string;
593
+ webm_bytes: number;
594
+ }
595
+ export type APIGifCaptionContentData = APIGifContentData & APICaptionContentData;
596
+ export interface APIAppContentData {
597
+ url: string;
598
+ is_scroll_allowed: boolean;
599
+ }
600
+ /**
601
+ * The content data for content from Content.pic, Content.video_clip, etc.
602
+ */
603
+ export type APIContentData = APIAppContentData | APICaptionContentData | APIComicsContentData | APICoubContentData | APIGifCaptionContentData | APIGifContentData | APIMemeContentData | APIPicContentData | APIVideoClipContentData | APIVideoContentData | APIVineContentData | UnknownContentData;
604
+ export type UnknownContentData = JSON;
605
+ export interface APICoubContent extends APIContentBase {
606
+ type: ContentType.COUB;
607
+ coub: APICoubContentData;
608
+ }
609
+ export interface APIVideoClipContent extends APIContentBase {
610
+ type: ContentType.VIDEO_CLIP;
611
+ video_clip: APIVideoClipContentData;
612
+ }
613
+ export interface APIVideoContent extends APIContentBase {
614
+ type: ContentType.VIDEO;
615
+ video: APIVideoContentData;
616
+ }
617
+ export interface APIVineContent extends APIContentBase {
618
+ type: ContentType.VINE;
619
+ vine: APIVineContentData;
620
+ }
621
+ export interface APICaptionContent extends APIContentBase {
622
+ type: ContentType.CAPTION;
623
+ caption: APICaptionContentData;
624
+ }
625
+ export interface APIComicsContent extends APIContentBase {
626
+ type: ContentType.COMICS;
627
+ comics: APIComicsContentData;
628
+ }
629
+ export interface APIMemeContent extends APIContentBase {
630
+ type: ContentType.MEME;
631
+ mem: APIMemeContentData;
632
+ }
633
+ export interface APIPicContent extends APIContentBase {
634
+ type: ContentType.PIC;
635
+ pic?: APIPicContentData;
636
+ }
637
+ export interface APIGifContent extends APIContentBase {
638
+ type: ContentType.GIF;
639
+ gif: APIGifContentData;
640
+ }
641
+ export interface APIGifCaptionContent extends APIContentBase {
642
+ type: ContentType.GIF_CAPTION;
643
+ gif: APIGifCaptionContentData;
644
+ }
645
+ export interface APIAppContent extends APIContentBase {
646
+ type: ContentType.APP;
647
+ app: APIAppContentData;
648
+ }
649
+ export interface APIUnknownContent extends APIContentBase {
650
+ type: ContentType.OLD | ContentType.DEM | ContentType.SPECIAL;
651
+ }
652
+ /**
653
+ * The source of the original content
654
+ */
655
+ export type APIContentSource = Pick<APIContent, "id" | "date_create" | "creator">;
656
+ /**
657
+ * Any possible Content type
658
+ */
659
+ export type APIContent = APIContentVideo | APIContentPic | APIContentGif | APIContentSpecial;
660
+ /**
661
+ * All video/mp4 Content types
662
+ */
663
+ export type APIContentVideo = APICoubContent | APIVideoClipContent | APIVideoContent | APIVineContent;
664
+ /**
665
+ * All picture/jpg Content types
666
+ */
667
+ export type APIContentPic = APICaptionContent | APIPicContent | APIComicsContent | APIMemeContent;
668
+ /**
669
+ * All Gif Content types
670
+ */
671
+ export type APIContentGif = APIGifContent | APIGifCaptionContent;
672
+ /**
673
+ * All currently undocumented Content types. Once documented, these may move into the appropriate Content types above.\
674
+ * ? Currently: 'dem', 'old', 'app'
675
+ */
676
+ export type APIContentSpecial = APIUnknownContent | APIAppContent;
678
677
  //# sourceMappingURL=content.d.ts.map