/** * `formatAddress` — one pure function that renders display values as lines, * on the server (`formatted`, email, admin) and in the browser (live preview). * Spec § 3.6. * * `format` is a record's `fmt` or `lfmt`: `%n` separates lines, `%N %O %A %D * %C %S %Z %X` are tokens, everything else is literal. Each line is processed * structurally: a token with no value vanishes together with one adjacent * literal (the separator that introduced it, else the one that follows), so * `%C, %S %Z` without a state becomes `Mountain View 94043` and without a * postal code `Mountain View, California`. A regex pass then collapses * whitespace and strips any separator debris left at the ends of a line. * Empty lines are dropped; the country name is the last line. */ import type { AddressToken } from './types.js'; /** Display strings per token. `A` may be a list of lines; `country` is the display name. */ export type FormatAddressValues = Partial>; export interface FormatAddressOptions { /** Append `values.country` as the last line. Default true. */ includeCountry?: boolean; } /** * Render `values` through `format` as display lines. Pure: region names and * the country name must already be resolved (`resolveAddressDisplayValues`). */ export declare function formatAddress(values: FormatAddressValues, format: string, opts?: FormatAddressOptions): string[];