Feliday-UI/src/shared/interfaces.ts

65 lines
982 B
TypeScript
Raw Normal View History

import { Either, Option } from "@sniptt/monads";
import { GetSiteResponse, LemmyHttp } from "lemmy-js-client";
/**
* This contains serialized data, it needs to be deserialized before use.
*/
export interface IsoData {
path: string;
routeData: any[];
2020-12-24 01:58:27 +00:00
site_res: GetSiteResponse;
}
export interface ILemmyConfig {
wsHost?: string;
}
declare global {
interface Window {
isoData: IsoData;
lemmyConfig?: ILemmyConfig;
}
}
export interface InitialFetchRequest {
auth: Option<string>;
client: LemmyHttp;
path: string;
}
2020-12-24 01:58:27 +00:00
export interface PostFormParams {
name: Option<string>;
url: Option<string>;
body: Option<string>;
nameOrId: Option<Either<string, number>>;
2020-12-24 01:58:27 +00:00
}
export enum CommentViewType {
Tree,
Flat,
}
export enum DataType {
Post,
Comment,
}
export enum BanType {
Community,
Site,
}
2021-03-15 18:09:31 +00:00
export enum PersonDetailsView {
Overview,
Comments,
Posts,
Saved,
}
export enum PurgeType {
Person,
Community,
Post,
Comment,
}