import { AddressForm, IkasCheckoutSettings, IkasCustomerAddress } from "../../../../storefront-models/src"; /** * Builds a comma-separated text representation of a customer address from its non-empty fields. * * @ai-category Address * @ai-related getCustomerAddressValidationResult, isValidCustomerAddress, getIkasCustomerAddressForm * * @param address - The customer address object to convert to text. * @returns A comma-separated string composed of address lines, postal code, region, district, city, state, and country. * * @example * ```typescript * import { getCustomerAddressText } from "@ikas/bp-storefront"; * const text = getCustomerAddressText(address); * console.log(text); // "123 Main St, Suite 4, 10001, New York, US" * ``` */ export declare function getCustomerAddressText(address: IkasCustomerAddress): string; /** * Validates each field of a customer address against checkout settings and returns a per-field result object. * * @ai-category Address * @ai-related isValidCustomerAddress, getCustomerAddressText, getIkasCustomerAddressForm * * @param address - The customer address to validate. * @param checkoutSettings - The checkout settings that determine which fields are mandatory or optional. * @param isDistrictRequired - Whether the district field is required for the selected location. * @returns An object mapping each address field name to a boolean indicating whether it passes validation. * * @example * ```typescript * import { getCustomerAddressValidationResult } from "@ikas/bp-storefront"; * const result = getCustomerAddressValidationResult(address, checkoutSettings, true); * if (!result.phone) { * console.log("Phone number is invalid."); * } * ``` */ export declare function getCustomerAddressValidationResult(address: IkasCustomerAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): IkasCustomerAddressValidationResult; /** * Checks whether all fields of a customer address pass validation based on checkout settings. * * @ai-category Address * @ai-related getCustomerAddressValidationResult, getCustomerAddressText, getIkasCustomerAddressForm * * @param address - The customer address to validate. * @param checkoutSettings - The checkout settings that determine which fields are mandatory or optional. * @param isDistrictRequired - Whether the district field is required for the selected location. * @returns True if every field in the address passes validation, false otherwise. * * @example * ```typescript * import { isValidCustomerAddress } from "@ikas/bp-storefront"; * const valid = isValidCustomerAddress(address, checkoutSettings, false); * if (!valid) { * console.log("Address is incomplete or invalid."); * } * ``` */ export declare function isValidCustomerAddress(address: IkasCustomerAddress, checkoutSettings: IkasCheckoutSettings, isDistrictRequired: boolean): boolean; export type IkasCustomerAddressValidationResult = { firstName: boolean; lastName: boolean; addressLine1: boolean; country: boolean; state: boolean; city: boolean; district: boolean; phone: boolean; postalCode: boolean; identityNumber: boolean; title: boolean; }; /** * Retrieves or initializes the address form for a given customer address, caching it in the customer store. * * @ai-category Address, Initialization * @ai-related clearIkasCustomerAddressForm, getCustomerAddressValidationResult * * @param address - The customer address whose form should be retrieved or created. * @returns The cached AddressForm instance associated with the given address. * * @example * ```typescript * import { getIkasCustomerAddressForm } from "@ikas/bp-storefront"; * const form = getIkasCustomerAddressForm(address); * console.log(form); * ``` */ export declare function getIkasCustomerAddressForm(address: IkasCustomerAddress): AddressForm; /** * Removes the cached address form for a given customer address from the customer store. * * @ai-category Address * @ai-related getIkasCustomerAddressForm * * @param address - The customer address whose cached form should be cleared. * @returns void * * @example * ```typescript * import { clearIkasCustomerAddressForm } from "@ikas/bp-storefront"; * clearIkasCustomerAddressForm(address); * ``` */ export declare function clearIkasCustomerAddressForm(address: IkasCustomerAddress): void;