import { RemoteJoinerQuery } from "@medusajs/types";
import { GraphCatalog } from "../catalog";
import { InternalJoinerServiceConfig, ResidualOrderBy } from "../types";
import { SpecRegistry } from "./types";
/**
 * Cross-module sorting on the root order arg, e.g.
 * `order: { "price_set.id": "ASC" }` or `order: { price_set: { id: "ASC" } }`.
 *
 * Each entry is classified as native (root fields, same-module paths),
 * pushable (cross-module, sorted field is crossjoinable), or residual
 * (cross-module but not pushable: computed fields, cross-DB targets,
 * conflicting joins). Pushable entries are rewritten to the flat
 * `<target table>.<column>` form the DAL expects — but sort keys are
 * lexicographically significant, so a single residual entry moves the whole
 * ordering to the in-memory stage (stage 2) instead.
 */
export declare function rewriteRootOrder(params: {
    query: RemoteJoinerQuery;
    serviceConfig: InternalJoinerServiceConfig;
    catalog: GraphCatalog;
    registry: SpecRegistry;
}): ResidualOrderBy[];
//# sourceMappingURL=rewrite-order.d.ts.map