lemmy-ui/src/shared/interfaces.ts

71 lines
979 B
TypeScript
Raw Normal View History

2020-12-24 01:58:27 +00:00
import {
CommentView,
GetSiteResponse,
LemmyHttp,
UserMentionView,
} from 'lemmy-js-client';
export interface IsoData {
path: string;
routeData: any[];
2020-12-24 01:58:27 +00:00
site_res: GetSiteResponse;
// Lang and theme
lang: string;
// communities?: ListCommunitiesResponse;
}
declare global {
interface Window {
isoData: IsoData;
}
}
export interface InitialFetchRequest {
auth: string;
path: string;
client: LemmyHttp;
}
2020-12-24 01:58:27 +00:00
export interface CommentNode {
comment_view: CommentView | UserMentionView;
children?: CommentNode[];
depth?: number;
}
export interface PostFormParams {
name: string;
url?: string;
body?: string;
community_name?: string;
community_id?: number;
}
export enum CommentSortType {
Hot,
Top,
New,
Old,
}
export enum CommentViewType {
Tree,
Chat,
}
export enum DataType {
Post,
Comment,
}
export enum BanType {
Community,
Site,
}
export enum UserDetailsView {
Overview,
Comments,
Posts,
Saved,
}