X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Finterfaces.ts;h=dbba70406b1314037691fa5b6add9b023138b76d;hb=9265fc58948341856513c06ba44e1a0c0d5a4241;hp=dc4490cbdc7701f61eda5b3dd525e9143a362977;hpb=72b4d14b47dd8501597b15cc0cf5713ff86aaca9;p=lemmy-ui.git diff --git a/src/shared/interfaces.ts b/src/shared/interfaces.ts index dc4490c..dbba704 100644 --- a/src/shared/interfaces.ts +++ b/src/shared/interfaces.ts @@ -1,18 +1,21 @@ -import { CommentView, GetSiteResponse, LemmyHttp } from "lemmy-js-client"; +import { CommentView, GetSiteResponse } from "lemmy-js-client"; import type { ParsedQs } from "qs"; +import { RequestState, WrappedLemmyHttp } from "./services/HttpService"; import { ErrorPageData } from "./utils"; /** * This contains serialized data, it needs to be deserialized before use. */ -export interface IsoData { +export interface IsoData> = any> { path: string; routeData: T; site_res: GetSiteResponse; errorPageData?: ErrorPageData; } -export type IsoDataOptionalSite = Partial> & +export type IsoDataOptionalSite< + T extends Record> = any +> = Partial> & Pick, Exclude, "site_res">>; export interface ILemmyConfig { @@ -28,7 +31,7 @@ declare global { export interface InitialFetchRequest { auth?: string; - client: LemmyHttp; + client: WrappedLemmyHttp; path: string; query: T; site: GetSiteResponse; @@ -69,6 +72,11 @@ export enum PurgeType { Comment, } +export enum VoteType { + Upvote, + Downvote, +} + export interface CommentNodeI { comment_view: CommentView; children: Array;