-
Notifications
You must be signed in to change notification settings - Fork 331
/
interfaces.ts
86 lines (72 loc) · 1.5 KB
/
interfaces.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
import { ErrorPageData } from "@utils/types";
import { CommentView, GetSiteResponse } from "lemmy-js-client";
import type { ParsedQs } from "qs";
import { RequestState } from "./services/HttpService";
/**
* This contains serialized data, it needs to be deserialized before use.
*/
export interface IsoData<T extends RouteData = any> {
path: string;
routeData: T;
site_res: GetSiteResponse;
errorPageData?: ErrorPageData;
}
export type IsoDataOptionalSite<T extends RouteData = any> = Partial<
IsoData<T>
> &
Pick<IsoData<T>, Exclude<keyof IsoData<T>, "site_res">>;
declare global {
interface Window {
isoData: IsoData;
checkLazyScripts?: () => void;
}
}
export interface InitialFetchRequest<T extends ParsedQs = ParsedQs> {
path: string;
query: T;
site: GetSiteResponse;
headers: { [key: string]: string };
}
export interface PostFormParams {
name?: string;
url?: string;
body?: string;
}
export enum CommentViewType {
Tree,
Flat,
}
export enum DataType {
Post,
Comment,
}
export enum BanType {
Community,
Site,
}
export enum PersonDetailsView {
Overview = "Overview",
Comments = "Comments",
Posts = "Posts",
Saved = "Saved",
}
export enum PurgeType {
Person,
Community,
Post,
Comment,
}
export enum VoteType {
Upvote,
Downvote,
}
export enum VoteContentType {
Post,
Comment,
}
export interface CommentNodeI {
comment_view: CommentView;
children: Array<CommentNodeI>;
depth: number;
}
export type RouteData = Record<string, RequestState<any>>;