import { z } from "zod"; import { GetPageParamSchema, PageIpfsSchema, PostSortNameSchema, PostsPagesIpfsSchema, RepliesPagesIpfsSchema, ReplySortNameSchema } from "./schema.js"; import type { CommentIpfsType, CommentUpdateForChallengeVerification, CommentUpdateType, CommentWithinModQueuePageJson, CommentWithinRepliesPostsPageJson } from "../publications/comment/types.js"; import { JsonOfClass } from "../types.js"; import { PostsPages, RepliesPages } from "./pages.js"; export type PageIpfs = z.infer; export type RepliesPagesTypeIpfs = z.infer; export type PostsPagesTypeIpfs = z.infer; export type PagesTypeIpfs = RepliesPagesTypeIpfs | PostsPagesTypeIpfs; export type PostSortName = z.infer; export type ReplySortName = z.infer; export type AllPageCids = Record[]>; export type ModQueueSortName = "pendingApproval"; export type Timeframe = "HOUR" | "DAY" | "WEEK" | "MONTH" | "YEAR" | "ALL"; export type SortProps = { score: (comment: { comment: CommentIpfsType; commentUpdate: CommentUpdateType; }) => number; timeframe?: Timeframe; flat?: boolean; }; export type PostSort = Record; export type ReplySort = Record; export interface PageTypeJson extends Omit { comments: CommentWithinRepliesPostsPageJson[]; } export type PostsPagesTypeJson = JsonOfClass; export type RepliesPagesTypeJson = JsonOfClass; export type PagesTypeJson = PostsPagesTypeJson | RepliesPagesTypeJson; export type ModQueueCommentInPage = { comment: CommentIpfsType; commentUpdate: CommentUpdateForChallengeVerification & { pendingApproval: true; }; }; export type ModQueuePageIpfs = { comments: ModQueueCommentInPage[]; nextCid?: string; }; export type ModQueuePageTypeJson = { comments: CommentWithinModQueuePageJson[]; nextCid?: string; }; export type GetPageParam = z.infer & { abortSignal?: AbortSignal; };