/** * Boundary mappers between commercetools `BaseAddress` and Acuris's * wire format. These are the load-bearing piece of this connector: * commercetools speaks ISO-2 + (streetName/streetNumber/additionalStreetInfo) * while Acuris speaks ISO-3 + (street/house_number/locality). * * Both directions preserve merchant-supplied identity fields (name, phone, * company, …) verbatim — Acuris doesn't return them. */ import type { FieldedAddressInput, ValidationResult } from "@acuris-geo/av-sdk"; import type { BaseAddress, SuggestionHit } from "./types.js"; /** * Strip leading zeros from a house-number string. Acuris's /suggest * endpoint returns house numbers padded with leading zeros for some * countries (DEU stores "0001" instead of "1" for sortability in the * reference DB). /validate normalizes them; /suggest doesn't. * Examples: "0001" → "1", "0042B" → "42B", "0" → "0", "10" → "10". */ export declare function normalizeHouseNumber(hno?: string): string | undefined; /** * commercetools BaseAddress → Acuris fielded input. * * { country: "DE", streetName: "Hammanstr.", streetNumber: "1", * postalCode: "67549", city: "Worms" } * → * { street: "Hammanstr.", house_number: "1", * postcode: "67549", city: "Worms" } * * Country is NOT included in the output — it travels separately at the * top of the validate-proxy wire payload so the proxy can do the * ISO-2 → ISO-3 conversion in one place. */ export declare function toAcurisInput(addr: BaseAddress): FieldedAddressInput; /** * Acuris validate result → commercetools BaseAddress. * * `base` lets the caller carry through identity fields (name, phone, company, * apartment/building/pOBox) that Acuris doesn't see. The standardized * address from Acuris always wins on locale fields; the base wins on identity. */ export declare function toBaseAddress(result: ValidationResult, base?: Partial): BaseAddress; /** * Acuris suggestion hit → commercetools BaseAddress. Used when a buyer * picks from the typeahead and the merchant wants to seed cart fields * without a follow-up /validate call. */ export declare function suggestionToBaseAddress(hit: SuggestionHit, base?: Partial): BaseAddress; //# sourceMappingURL=boundary.d.ts.map