import { ValueIdentity } from '../equality-value-identity.js';
import { CompilationResult } from '../compiler/index.js';
import { ResultStream } from '../../types.js';
export type ResultTuple = [
    value: Record<PropertyKey, any>,
    order: string | undefined,
    correlationKey?: unknown,
    parentContext?: Record<string, any> | null,
    routing?: IncludesRouting,
    publicKey?: unknown
];
export type IncludesRouting = Record<string, IncludeRoute>;
export type IncludeRoute = {
    active: boolean;
    correlationKey: unknown;
    parentContext: Record<string, any> | null;
};
export type CanonicalResult = {
    publicKey: unknown;
    tuple: ResultTuple;
};
export type RelationScope = `root` | `child`;
export declare function exposeRouting(pipeline: ResultStream): ResultStream;
export declare function canonicalizeByPublicKey(pipeline: ResultStream, getKey: ((row: any) => unknown) | undefined, scope: RelationScope, valueIdentity: ValueIdentity): ResultStream;
export declare function routeKey(correlationKey: unknown, parentContext: Record<string, any> | null | undefined, valueIdentity: ValueIdentity): string;
/** Reduces a query without includes to one canonical row per public key. */
export declare function reducePublicKeys(compilation: CompilationResult, getKey: (row: any) => unknown): {
    pipeline: ResultStream;
    facades: undefined;
};
