X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Futils.ts;fp=src%2Fshared%2Futils.ts;h=83cc6f1adf645b4389d70b7f5367ebcb646af9f9;hb=9265fc58948341856513c06ba44e1a0c0d5a4241;hp=46e8601be08e5ff4895d6b9335f24fe765cb7168;hpb=d75e0506daeb460fa4952211a46ded944d57aa88;p=lemmy-ui.git diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 46e8601..83cc6f1 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -45,6 +45,7 @@ import { getHttpBase } from "./env"; import { i18n, languages } from "./i18next"; import { CommentNodeI, DataType, IsoData, VoteType } from "./interfaces"; import { HttpService, UserService } from "./services"; +import { RequestState } from "./services/HttpService"; let Tribute: any; if (isBrowser()) { @@ -1161,7 +1162,9 @@ export function isBrowser() { return typeof window !== "undefined"; } -export function setIsoData(context: any): IsoData { +export function setIsoData>>( + context: any +): IsoData { // If its the browser, you need to deserialize the data from the window if (isBrowser()) { return window.isoData; @@ -1490,3 +1493,7 @@ export function newVote(voteType: VoteType, myVote?: number): number { return myVote == -1 ? 0 : -1; } } + +export type RouteDataResponse> = { + [K in keyof T]: RequestState>; +};