import { ErrorPageData } from "@utils/types"; import { CommentReply, CommentView, GetSiteResponse, PersonMention, } from "lemmy-js-client"; import { RequestState } from "./services/HttpService"; import { Match } from "inferno-router/dist/Route"; /** * This contains serialized data, it needs to be deserialized before use. */ export interface IsoData { path: string; routeData: T; site_res: GetSiteResponse; errorPageData?: ErrorPageData; showAdultConsentModal: boolean; } export type IsoDataOptionalSite = Partial< IsoData > & Pick, Exclude, "site_res">>; declare global { interface Window { isoData: IsoData; checkLazyScripts?: () => void; } } export interface InitialFetchRequest< P extends Record = Record, T extends Record = Record, > { path: string; query: T; match: Match

; site: GetSiteResponse; headers: { [key: string]: 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", Uploads = "Uploads", } export enum PurgeType { Person, Community, Post, Comment, } export enum VoteType { Upvote, Downvote, } export enum VoteContentType { Post, Comment, } export type CommentNodeView = Omit & Partial> & { person_mention?: PersonMention; comment_reply?: CommentReply; }; export interface CommentNodeI { comment_view: CommentNodeView; children: Array; depth: number; } export type RouteData = Record>;