]> Untitled Git - lemmy-ui.git/blob - src/shared/interfaces.ts
Don't restore scroll position on page refresh. Fixes #186
[lemmy-ui.git] / src / shared / interfaces.ts
1 import {
2   CommentView,
3   GetSiteResponse,
4   LemmyHttp,
5   PersonMentionView,
6 } from "lemmy-js-client";
7
8 export interface IsoData {
9   path: string;
10   routeData: any[];
11   site_res: GetSiteResponse;
12   // Lang and theme
13   lang: string;
14   // communities?: ListCommunitiesResponse;
15 }
16
17 export interface ILemmyConfig {
18   wsHost?: string;
19 }
20
21 declare global {
22   interface Window {
23     isoData: IsoData;
24     lemmyConfig?: ILemmyConfig;
25   }
26 }
27
28 export interface InitialFetchRequest {
29   auth: string;
30   path: string;
31   client: LemmyHttp;
32 }
33
34 export interface CommentNode {
35   comment_view: CommentView | PersonMentionView;
36   children?: CommentNode[];
37   depth?: number;
38 }
39
40 export interface PostFormParams {
41   name: string;
42   url?: string;
43   body?: string;
44   community_name?: string;
45   community_id?: number;
46 }
47
48 export enum CommentSortType {
49   Hot,
50   Top,
51   New,
52   Old,
53 }
54
55 export enum CommentViewType {
56   Tree,
57   Chat,
58 }
59
60 export enum DataType {
61   Post,
62   Comment,
63 }
64
65 export enum BanType {
66   Community,
67   Site,
68 }
69
70 export enum PersonDetailsView {
71   Overview,
72   Comments,
73   Posts,
74   Saved,
75 }