/** * Index lookup for query acceleration. * * Provides functions for resolving entities using indexes when the query's * where clause contains equality conditions on indexed fields. */ import { Effect } from "effect"; import type { CollectionIndexes } from "../types/index-types.js"; /** * Entity constraint: must have a readonly string `id` field. */ type HasId = { readonly id: string; }; /** * Resolve entities using an index if the where clause is eligible. * * Checks the where clause for equality conditions (direct value, $eq, or $in) * on indexed fields. If a usable index is found, returns the matching entities. * Otherwise returns undefined, signaling that the caller should fall back to * a full scan. * * The where clause is NOT modified — the filter stage should still run on the * returned entities to apply any remaining conditions. * * @param where - The where clause from the query (may be undefined) * @param indexes - The collection's indexes * @param map - The entity data map (id -> entity) * @returns Effect producing Array if index was used, undefined if no usable index */ export declare const resolveWithIndex: (where: Record | undefined, indexes: CollectionIndexes, map: ReadonlyMap) => Effect.Effect | undefined>; export {}; //# sourceMappingURL=index-lookup.d.ts.map