import { type FlattenedField, type Where } from 'payload';
import type { DrizzleAdapter } from '../types.js';
export type ScalarWhereField = {
    field: FlattenedField;
    isUUID: boolean;
    type: 'scalar';
};
type CollectionWhereField = {
    field: FlattenedField;
    type: 'hasManySelect';
} | ScalarWhereField;
export type WherePathPlan = {
    columnPath: string;
    fieldsByCollection: Map<string, CollectionWhereField>;
    schemaPath: string;
    type: 'hasManySelect' | 'invalid' | 'scalar';
};
export type PolymorphicJoinWherePlan = Map<string, WherePathPlan>;
/**
 * Analyzes every leaf path in a polymorphic join where clause before SQL is built. Each plan entry
 * records the flattened column path, the compatible field shape for each target collection, and
 * whether the path uses a scalar column or a has-many select value table. A field may be absent
 * from some target collections; those branches compare against SQL NULL or an empty JSON array.
 *
 * Paths are marked as invalid when their storage shapes conflict, require localized or separate-row
 * traversal, have no matching field, lack a required column, or collide after path flattening.
 *
 * @returns A plan keyed by each unique schema path in `where`.
 * @throws If a target collection or its mapped database table is not available in the adapter.
 */
export declare const createPolymorphicJoinWherePlan: ({ adapter, collections, where, }: {
    adapter: DrizzleAdapter;
    collections: string[];
    where: Where;
}) => PolymorphicJoinWherePlan;
export {};
//# sourceMappingURL=createPolymorphicJoinWherePlan.d.ts.map