UNPKG

@dossierhq/core

Version:

The core Dossier library used by clients and server alike, used to interact with schema and entities directly, as well as remotely through a client.

10 lines (9 loc) 917 B
import { type ErrorType, type PromiseResult, type Result } from '../ErrorResult.js'; import type { Connection, Edge, Paging } from '../Types.js'; export interface PagingInfo { forwards: boolean; count: number | null; } export declare function getPagingInfo(paging: Paging | undefined): Result<PagingInfo, typeof ErrorType.BadRequest>; export declare function getAllPagesForConnection<TEdge extends Edge<unknown, ErrorType>, TError extends ErrorType>(initialPaging: Paging | undefined, pageGenerator: (paging: Paging) => PromiseResult<Connection<TEdge> | null, TError>): AsyncGenerator<Result<Connection<TEdge>, TError>, undefined>; export declare function getAllNodesForConnection<TEdge extends Edge<unknown, ErrorType>, TError extends ErrorType>(initialPaging: Paging | undefined, pageGenerator: (paging: Paging) => PromiseResult<Connection<TEdge> | null, TError>): AsyncGenerator<TEdge['node'], undefined>;