/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * @file Renders labeled pieces into sub-venue rows in a sampled case register and a per-country address order. */ import type { ComponentTag } from "@mailwoman/codex/component"; import type { LocaleBaseTuple } from "#surfaces/locale"; /** * One labeled piece of a row. * * Pieces inside a group are joined with a space. * Groups are joined with the register's separator. */ export interface Piece { text: string; tag?: ComponentTag; } /** * A run of pieces that share one comma segment. */ export type Group = Piece[]; /** * The case and punctuation style of a rendered row. * * Users often type addresses in lowercase, so every recipe output includes lowercase rows. */ export declare const Register: { readonly Canonical: "canonical"; readonly CommaFree: "comma-free"; readonly Lower: "lower"; readonly Upper: "upper"; }; /** * One of the {@link Register} values. */ export type Register = (typeof Register)[keyof typeof Register]; /** * Samples a register with the fixed shares above. */ export declare function sampleRegister(random: () => number): Register; /** * Joins groups into `raw` and `components`. * * The register's case change applies to both so that alignment still finds every component value in `raw`. */ export declare function renderGroups(groups: Group[], register: Register): { raw: string; components: Partial>; }; /** * Returns the street and locality groups for a country in the order of its codex address layout. * * The function splits the rendered layout at comma and line-break connectors. * It returns an empty list when codex has no Latin-script layout for the country. */ export declare function addressGroups(country: string, tuple: LocaleBaseTuple, withStreet: boolean): Group[]; //# sourceMappingURL=render.d.ts.map