import type { ConnectionOptimizedStep, ExecutionDetails } from "../index.ts"; import type { GrafastResultsList, Maybe, PromiseOrDirect, Thunk } from "../interfaces.ts"; import type { Multistep, UnwrapMultistep } from "../multistep.ts"; import { Step } from "../step.ts"; import { type IOEquivalence } from "./_loadCommon.ts"; import type { PaginationFeatures, PaginationParams } from "./connection.ts"; import { LoadedRecordStep } from "./loadedRecord.ts"; export interface LoadManyInfo, TShared = never> { shared: TShared; attributes: ReadonlyArray; params: Partial; /** @deprecated Please use `shared` instead (it's simply renamed) */ unary: TShared; } export type LoadManyCallback>> = Maybe>>, TParams extends Record = Record, TShared = never> = { (lookups: ReadonlyArray, info: LoadManyInfo): PromiseOrDirect>; displayName?: string; }; /** * A TypeScript Identity Function to help you strongly type your * LoadManyCallback. */ export declare function loadManyCallback>> = Maybe>>, TParams extends Record = Record, TShared = never>(load: LoadManyCallback): LoadManyCallback; /** * A TypeScript Identity Function to help you strongly type your * LoadManyLoader. */ export declare function loadManyLoader>> = Maybe>>, TParams extends Record = Record, const TShared extends Multistep = never>(load: LoadManyLoader): LoadManyLoader; interface LoadManyBaseParams { [key: string]: Maybe; reverse?: Maybe; after?: Maybe; offset?: Maybe; limit?: Maybe; } export declare class LoadManyStep>>, // loadMany TParams extends LoadManyBaseParams = any, const TShared extends Multistep = never> extends Step implements Partial> { static $$export: { moduleName: string; exportName: string; }; isSyncAndSafe: boolean; loadInfo: Omit>, "shared" | "unary" | "params"> | null; loadInfoKey: string; attributes: Set; paramDepIdByKey: { [TKey in keyof TParams]: number; }; sharedDepId: number | null; private ioEquivalence; private load; paginationSupport?: PaginationFeatures; private name; constructor(lookup: TLookup, loader: LoadManyLoader, TItem, TData, TParams, TShared>); toStringMeta(): string | null; private _accessMap; private getAccessMap; listItem($item: Step): LoadedRecordStep> ? U extends Maybe ? U : never : never, TParams>; setParam(paramKey: TParamKey, value: TParams[TParamKey] | Step>): void; addAttributes(attributes: Set): void; deduplicate(peers: readonly LoadManyStep[]): LoadManyStep[]; deduplicatedWith(replacement: LoadManyStep): void; _paramSig?: string; getParamSignature(): string; finalize(): void; execute(details: ExecutionDetails): PromiseOrDirect>; applyPagination?($params: Step>): void; connectionClone(): LoadManyStep & ConnectionOptimizedStep; } export interface LoadManyLoader>> = Maybe>>, TParams extends LoadManyBaseParams = LoadManyBaseParams, TShared extends Multistep = never> { /** * The function that actually loads data from the backend */ load: LoadManyCallback>; /** Name your function (for plan diagrams/debugging) */ name?: string; /** * Details of anything your `load` function will need access to, for example * database connections, API clients, etc. */ shared?: Thunk; /** * Details of which attributes on the output are equivalent to those on the * input (if any), useful for reducing unnecessary fetches (e.g. load the * friends of a user by their id without ever loading the user). */ ioEquivalence?: IOEquivalence; /** * Describes the feature the `load` function supports relating to pagination. * Even an empty object indicates that the load function supports `limit`, so * if this is not supported do not set this attribute. */ paginationSupport?: PaginationFeatures; } export declare function loadMany>> = Maybe>>, TParams extends Record = Record, const TShared extends Multistep = never>(lookup: TLookup, loader: LoadManyCallback, TItem, TData, TParams, TShared> | LoadManyLoader, TItem, TData, TParams, TShared>): LoadManyStep, TItem, TData, TParams, UnwrapMultistep>; type ReadonlyArrayOrAsyncIterable = ReadonlyArray | AsyncIterable; export {}; //# sourceMappingURL=loadMany.d.ts.map