import type { CanonicalRow } from "#types"; /** * Real address tuple (for example one OpenAddresses row). * * Street and locality are required. * Other tuple fields are optional. */ export interface LocaleBaseTuple { house_number?: string; street: string; locality: string; /** * Sub-locality below locality (for example suburb/district). * When present, it is rendered between street and locality. */ dependent_locality?: string; region?: string; postcode?: string; } /** * @deprecated Alias — use LocaleBaseTuple. */ export type GermanBaseTuple = LocaleBaseTuple; export interface RenderedLocaleRow { raw: string; components: CanonicalRow["components"]; locale: string; } /** * @deprecated Alias — use RenderedLocaleRow. */ export type RenderedGermanRow = RenderedLocaleRow; export interface LocaleRenderOpts { random?: () => number; /** * Postcode surface shape. * * `"conventional"` (default) canonicalizes to the country's rendered form * (NL: OA's glued `1011AB` → the spaced `1011 AB`). * `"as-source"` keeps the source's own surface. * * Today, only NL differs between these modes. */ postcodeShape?: "conventional" | "as-source"; /** * How the native-order render joins street and house number. * * The OpenCage ES template comma-joins (`Calle Mayor, 12`, the official Spanish convention). * OA-derived feeds and our ES eval space-join (`calle mayor 12`, the observed form on all 3,000 eval rows). * * `"template"` (default) keeps the template's own join. * `"space"` collapses `, ` → ` ` after rendering. */ nativeHouseJoin?: "template" | "space"; /** * The string between rendered address lines. * * `", "` (default) is the template's own join. * `" "` renders the comma-free single-line register for dictation or a copy out of a * one-field form, as in `Neusser Str. 12 Nippes 50733 Köln` for the same components. */ separator?: ", " | " "; /** * Write the tuple's region where the country writes one (`regionLayoutForCountry` in the codex). * * The option draws no random number, so the rest of a seeded run is unchanged. * A row whose region cannot be placed or aligned renders without it. */ withRegion?: boolean; } /** * @deprecated Alias — use LocaleRenderOpts. */ export type GermanRenderOpts = LocaleRenderOpts; /** * Render one tuple into a locale-ordered `{raw, components}` row via OpenCage templates, * with light variation (house number and postcode may be dropped). * * Returns `null` when the tuple is too thin or a component wouldn't align to an exact span. * The row prints the tuple's region only when {@linkcode LocaleRenderOpts.withRegion} asks for it. */ export declare function renderLocaleRow(base: LocaleBaseTuple, country: string, opts?: LocaleRenderOpts): RenderedLocaleRow | null; /** * The generator a seeded recipe draws {@linkcode LocaleRenderOpts.withRegion} from. * * It is separate from the rendering generator, so choosing which rows print a region * leaves every other draw of the run, and every row without a region, as it was. */ export declare function regionDrawRandom(seed: number): () => number; /** * German wrapper over {@link renderLocaleRow}. * * Kept for the `german` recipe (`de/recipes/locale.ts`) and tests. */ export declare function renderGermanRow(base: LocaleBaseTuple, opts?: LocaleRenderOpts): RenderedLocaleRow | null; //# sourceMappingURL=locale.d.ts.map