lemmy-ui/src/shared/interfaces.ts
SleeplessOne1917 d9fe7d1488
Remote follow (#1875)
* Redirect to page user was trying to access on login

* Make modal

* Make modal look better

* Forgot to include in merge

* Get rid of modal

* Add external interaction page

* Tweak success page

* Add loading screen for remote fetch and refactor loading ellipses

* Add error state for remote fetch page

* Add card to federation success page

* Bring back remote fetch modal

* Add autofocus to remote fetch modal input

* Redirect for remote fetch

* Remove dummy data

* Remove duplicate functions

* Update translations

* Update translations

* Fix linting error

* Fix linting errors

* feat: Add toasts for remote follow error conditions
2023-09-25 23:32:37 -04:00

86 lines
1.5 KiB
TypeScript

import { ErrorPageData } from "@utils/types";
import { CommentView, GetSiteResponse } from "lemmy-js-client";
import type { ParsedQs } from "qs";
import { RequestState, WrappedLemmyHttp } 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;
}
}
export interface InitialFetchRequest<T extends ParsedQs = ParsedQs> {
client: WrappedLemmyHttp;
path: string;
query: T;
site: GetSiteResponse;
auth?: 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>>;