]> Untitled Git - lemmy-ui.git/blob - src/shared/interfaces.ts
Merge branch 'rate-limiting-tab' of https://github.com/SleeplessOne1917/lemmy-ui...
[lemmy-ui.git] / src / shared / interfaces.ts
1 import { CommentView, GetSiteResponse, LemmyHttp } from "lemmy-js-client";
2 import type { ParsedQs } from "qs";
3
4 /**
5  * This contains serialized data, it needs to be deserialized before use.
6  */
7 export interface IsoData {
8   path: string;
9   routeData: any[];
10   site_res: GetSiteResponse;
11 }
12
13 export interface ILemmyConfig {
14   wsHost?: string;
15 }
16
17 declare global {
18   interface Window {
19     isoData: IsoData;
20     lemmyConfig?: ILemmyConfig;
21   }
22 }
23
24 export interface InitialFetchRequest<T extends ParsedQs = ParsedQs> {
25   auth?: string;
26   client: LemmyHttp;
27   path: string;
28   query: T;
29   site: GetSiteResponse;
30 }
31
32 export interface PostFormParams {
33   name?: string;
34   url?: string;
35   body?: string;
36 }
37
38 export enum CommentViewType {
39   Tree,
40   Flat,
41 }
42
43 export enum DataType {
44   Post,
45   Comment,
46 }
47
48 export enum BanType {
49   Community,
50   Site,
51 }
52
53 export enum PersonDetailsView {
54   Overview = "Overview",
55   Comments = "Comments",
56   Posts = "Posts",
57   Saved = "Saved",
58 }
59
60 export enum PurgeType {
61   Person,
62   Community,
63   Post,
64   Comment,
65 }
66
67 export interface CommentNodeI {
68   comment_view: CommentView;
69   children: Array<CommentNodeI>;
70   depth: number;
71 }