import { $$deepDepSkip } from "../constants.ts"; import type { ExecutionDetails } from "../index.ts"; import type { GrafastResultsList, Maybe } from "../interfaces.ts"; import type { ListCapableStep } from "../step.ts"; import { Step } from "../step.ts"; import { __ItemStep } from "./__item.ts"; import type { ConnectionOptimizedStep, ItemsStep, StepRepresentingList } from "./connection.ts"; export type ListTransformReduce = (memo: TMemo, entireItemValue: unknown, itemPlanData: TItemPlanData) => TMemo; export type ListTransformItemPlanCallback>, TDepsStep extends Step> = (listItemPlan: ItemsStep extends ListCapableStep ? ReturnType["listItem"]> : __ItemStep) => TDepsStep; export interface ListTransformOptions, TDepsStep extends Step, TMemo, TItemStep extends Step | undefined = undefined> { listStep: TListStep; itemPlanCallback: ListTransformItemPlanCallback, TDepsStep>; initialState(): TMemo; reduceCallback: ListTransformReduce ? U : never>; listItem?(itemPlan: Step): TItemStep; finalizeCallback?(data: TMemo): TMemo; meta?: string; optimize?: (this: __ListTransformStep) => Step; connectionClone?: ConnectionOptimizedStep["connectionClone"]; } /** * **Experimental.** * * A "special" plan that has custom handling in Grafast. Used for turning lists * into other things (or maybe more lists!). * * It's recommended that you don't use this directly, please use one of the * functions that uses this under the hood such as `filter()`. */ export declare class __ListTransformStep = StepRepresentingList, TDepsStep extends Step = Step, TMemo = any, TItemStep extends Step | undefined = Step | undefined> extends Step { static $$export: { moduleName: string; exportName: string; }; isSyncAndSafe: boolean; private listStepDepId; private rawListStepRefId; itemPlanCallback: ListTransformItemPlanCallback, TDepsStep>; initialState: () => TMemo; reduceCallback: ListTransformReduce ? U : never>; finalizeCallback?: (data: TMemo) => TMemo; listItem?: (itemPlan: __ItemStep) => TItemStep; private meta; connectionClone?: ConnectionOptimizedStep["connectionClone"]; /** Set during query planning. */ itemStepId: number; constructor(options: ListTransformOptions); toStringMeta(): string | null; getListStep(): TListStep; [$$deepDepSkip](): TListStep; dangerouslyGetListPlan(): TListStep; deduplicate(peers: __ListTransformStep[]): __ListTransformStep[]; optimize(): Step; execute({ indexForEach, indexMap, values, extra, }: ExecutionDetails<[any[] | null | undefined | Error]>): Promise>; } /** * **Experimental.** * * A "special" plan that has custom handling in Grafast. Used for turning lists * into other things (or maybe more lists!). * * {@page ~grafast/steps/listTransform.md} */ export declare function listTransform, TDepsStep extends Step, TMemo, TItemStep extends Step | undefined = undefined>(options: ListTransformOptions): __ListTransformStep; //# sourceMappingURL=listTransform.d.ts.map