/** * `former-divisions`: a former administrative division written beside a locality it covered. * * The input is the tuple file `packages/gazetteer/tools/former-divisions.run.ts --tuples` * writes: one line per row, naming a division of the former divisions table, * a current WOF locality its containment evidence links it to, and the shape to write. * That tool, never this recipe, sets the row counts, capped and stratified by country * and division by one rule for every country. * * Two shapes place the division: * * - `division_first`: before the locality, the order Google writes, `Redland, Avon, Bristol`. * - `division_after`: after the locality, the conventional order, `Redland, Bristol, Avon`. * * The division takes the tag the table states, `subregion` at county level * or `region` at the first level (`docs/engineering/reference/SCHEMA.mdx`). * A dependent locality, a postcode and a country are written when the tuple states them. * * A postcode sits where `POSTCODE_CONVENTIONS` places it for the country, * and a country the table doesn't list gets no postcode. */ import type { ComponentTag } from "@mailwoman/codex/component"; import { type CorpusRecipe, type PostcodePlacement } from "#recipes/scaffold"; /** * Where the division sits relative to the locality. */ export declare const FORMER_DIVISION_SHAPES: readonly ["division_first", "division_after"]; export type FormerDivisionShape = (typeof FORMER_DIVISION_SHAPES)[number]; /** * One row as the tuple file states it. */ export interface FormerDivisionTuple { country: string; division: string; division_tag: "subregion" | "region"; /** * `geonames:` or `wof:`. */ division_id: string; /** * The WOF id of the locality. */ settlement_id: number; locality: string; dependent_locality: string | null; postcode: string | null; postcode_placement: PostcodePlacement | null; /** * The country form to end the row with, or `null` for none. */ country_name: string | null; shape: FormerDivisionShape; /** * The tuple's index among its division's rows, so a repeated tuple takes its own `source_id`. */ index: number; } /** * The text and components of one tuple's row. */ export declare function formerDivisionRow(tuple: FormerDivisionTuple): { raw: string; components: Partial>; }; /** * The `former-divisions` recipe. */ export declare const formerDivisionsRecipe: CorpusRecipe; //# sourceMappingURL=former-divisions.d.ts.map