Files
clean-architecture-frontend…/src/adapters/query-cache/cursor-pagination-contract.ts
T

24 lines
576 B
TypeScript

import type { Result } from "../../contracts/result.ts";
export type CursorPage<Value> = Readonly<{
items: readonly Value[];
nextCursor: string | null;
hasMore: boolean;
snapshotToken: string | null;
}>;
export type CursorPaginationProfile = Readonly<{
profileId: string;
maxPages: number;
maxTotalItems: number;
maxEstimatedBytes: number;
maxCursorBytes: number;
allowSparsePage: boolean;
}>;
export type CursorPaginationRuntime<Value> = Readonly<{
loadAll(context: Readonly<{ signal?: AbortSignal }>): Promise<
Result<readonly Value[]>
>;
}>;