-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
77 lines (72 loc) · 1.51 KB
/
types.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
export type Sort = "hot" | "new" | "top" | "controversial";
export type Time = "hour" | "day" | "week" | "month" | "year" | "all";
export type RedditPost = {
kind: string;
data: {
id: string;
url: string;
is_video: boolean;
is_gallery?: boolean;
media_metadata?: {
[key: string]: {
e?: string;
status: "valid" | "failed";
id?: string;
s?: {
mp4?: string;
gif?: string;
u?: string;
};
};
};
preview?: {
images?: {
source: {
url: string;
};
}[];
reddit_video_preview?: {
bitrate_kbps: number;
dash_url: string;
duration: number;
fallback_url: string;
height: number;
hls_url: string;
is_gif: boolean;
scrubber_media_url: string;
transcoding_status: string;
width: number;
};
};
permalink: string;
author: string;
title: string;
ups: number;
number: number;
created_utc: number;
over_18: boolean;
media: {
reddit_video?: {
fallback_url: string;
};
} | null;
};
};
export type RedditComment = {
kind: string;
data: {
author: string;
id: string;
body: string;
ups: number;
created_utc: number;
};
};
export type CommentTree = [
{ kind: string; data: { children: RedditPost[] } },
{ kind: string; data: { children: RedditComment[] } },
];
export type ErrorComponent = {
error: Error;
reset: () => void;
};