import type { AddressError, AddressRow, AddressSettings, AddressValidationRule, ResolvedAddressSchema, ValidateAddressOptions } from './types.js'; /** `translate(text, values)` — interpolates `${key}` placeholders after translating. */ export type AddressTranslate = (text: string, values?: Record) => string; export interface ValidateAddressAgainstSchemaOptions extends ValidateAddressOptions { /** * Extra-field ids accepted as known payload keys. Default: every extra * registered for the schema's country on any surface, so a value collected * on another form still travels with the row (§ 3.1 strict parity). */ knownExtraIds?: string[]; /** Merchant settings for the sell-to check. Default: the runtime's. */ settings?: AddressSettings; /** Countries covered by at least one shipping zone. Default: the runtime's. */ zoneCountries?: string[]; /** Message translator. Default: the runtime's `translate`. */ translate?: AddressTranslate; } export interface AddressValidationResult { valid: boolean; errors: AddressError[]; } /** * Register a cross-field, server-only rule. Rules run after the schema-derived * rules, in registration order, and may be async. Must be called from a * module's `bootstrap.ts`: the registry is locked afterwards. */ export declare function addAddressValidationRule(rule: AddressValidationRule): void; export declare function __resetAddressValidationRulesForTests(): void; /** * Validate `address` against an already resolved schema. Returns every error, * with messages translated and the field label interpolated as `${field}`. */ export declare function validateAddressAgainstSchema(address: AddressRow, schema: ResolvedAddressSchema, opts?: ValidateAddressAgainstSchemaOptions): Promise; /** * Resolve the schema for `address.country` (the DEFAULT record when empty or * unknown) and validate against it. `opts.previous` is the stored row on * update and drives the split-name rule; `opts.surface` drives the sell-to * check (account and billing use the list, shipping the list ∩ zone countries). */ export declare function validateAddress(address: AddressRow, opts?: ValidateAddressAgainstSchemaOptions): Promise;