import { ResidualOrderBy } from "../types";
import { ConsumeContext } from "./residual-filters";
/**
 * Stage 2 of cross-module sorting: applies in memory the root ordering that
 * stage 1 could not push down to SQL. Sort keys are lexicographically
 * significant, so a single residual key moves the whole ordering here (see
 * rewriteRootOrder).
 *
 * At compile time, {@link consumeResidualOrderBy} loads the values the sort
 * keys read, reusing the residual-filter machinery. At execute time,
 * {@link sortByResidualOrder} sorts the (already filtered) root items before
 * hiding and pagination.
 */
/** Loads the values the sort keys read, recording additions for hiding. */
export declare function consumeResidualOrderBy(context: ConsumeContext, residualOrderBy: ResidualOrderBy[]): void;
/**
 * Sorts items in place, most significant key first. To-many hops sort by
 * their first element; nulls sort last ascending and first descending
 * (Postgres defaults).
 */
export declare function sortByResidualOrder(params: {
    items: any[];
    orderBy: ResidualOrderBy[];
}): void;
//# sourceMappingURL=residual-order.d.ts.map