import type { Cart } from '../cart/Cart.js'; export interface ShippingMethodIntent { provider_code: string; method_code: string; } export interface ResolvedShippingMethod { provider_code: string; method_code: string; snapshot: { code: string; name: string; cost: number; carrier?: string; delivery?: unknown; }; fingerprint: string; quotedAt: string; } export declare class ShippingQuoteError extends Error { constructor(message: string); } /** * Fully resolve a shipping intent against the cart's current state into an * enriched snapshot. The "intent" is the bare `{ provider_code, method_code }` * the customer picked; the snapshot is what the provider answers when asked, * captured alongside a fingerprint of the cart state at quote time and a * timestamp. * * Shared by two callers: * * - `setShippingMethod(cart, intent)` — the service used by API handlers and * in-process checkout flows. Pre-resolves so it can call setData with the * enriched value, satisfying DataObject's "resolver returns what was set" * contract. * * - The `shipping_method_data` field resolver — the dependency-rebuild path * (Case 2). When `items` / `shipping_address` / totals change, the * resolver runs without `setData` having been called on this field. The * cached snapshot may be stale; the resolver calls back through this * helper to re-quote. * * Throws `ShippingQuoteError` on any condition that should surface to the * caller (no provider, no zone, method no longer applies). Other errors * propagate as-is. * * See wiki/shipping-provider-design.md → "Recompute on cart change". */ export declare function resolveShippingQuote(cart: Cart, intent: ShippingMethodIntent): Promise;