import type { Expr } from "./ast.ts"; import { type GenerateCtx } from "./codegen.ts"; import { type SubPipelineLowerer } from "./lookup-translation.ts"; type LambdaNode = Extract; export type FacetEntry = { key: string; lambda: LambdaNode; pos: number; }; /** * Recognise an object-literal RHS where every value is a `$$.filter()`. * Returns the parsed facets, or `null` when no entry has the filter shape (so * the caller falls back to `$replaceWith`). * * If *any* entry is a `$$.filter(...)` but others are not, throws a precise * mixed-shape error — the user clearly meant a facet, so silently falling * through to `$replaceWith` would surface a confusing "$$ is statement-only" * downstream. */ export declare function detectFacetShape(value: Expr): FacetEntry[] | null; /** * Lower the detected facets to a single `$facet` stage. Each entry's lambda * becomes one sub-pipeline (one `$match` for expression-body predicates; * the block's stages for block-body predicates). */ export declare function lowerFacet(facets: FacetEntry[], outerCtx: GenerateCtx, lowerBlock: SubPipelineLowerer): object[]; export {}; //# sourceMappingURL=facet-translation.d.ts.map