import { type AddressScript } from "@mailwoman/codex/address/layouts"; import { type UnitSplitter } from "#adapters/street/unit"; import { type CanonicalRow, type CorpusAdapter } from "#types"; /** * Registry id for this adapter, stamped into every row it emits. */ export declare const GLEIF_ADAPTER_ID = "gleif-lei"; /** * Countries whose sampled rows show a labeling defect the street split cannot detect, * so none of their rows is emitted until the split handles them. * * - `AE`: the first address line can be an office or unit number before a building name, * as in `601 سويس تاور` and `501 LE SOLARIUM`, which the split reads as a house number and a street. * - `HK`: a floor such as `6F` comes out as the house number, as in `6F MANULIFE PLACE`. * - `BS`: codex records the Bahamas as number-last while its published lines are number-first * (`1 Montague Place`), and a `# 207` suite marker stays inside the street. */ export declare const GLEIF_UNREVIEWED_COUNTRIES: ReadonlySet; /** * The license GLEIF's LEI Data Terms of Use state for the golden copy. */ export declare const GLEIF_LICENSE = "CC0-1.0"; /** * The page that states {@linkcode GLEIF_LICENSE}. */ export declare const GLEIF_LICENSE_URL = "https://www.gleif.org/en/meta/lei-data-terms-of-use"; /** * The credit a model card includes. * * CC0 requires none. * The terms ask that no derived product imply GLEIF's endorsement, so the credit * states the source and claims no relationship with GLEIF. */ export declare const GLEIF_ATTRIBUTION = "Global Legal Entity Identifier Foundation (GLEIF), LEI golden copy (CC0 1.0)"; /** * The publisher's file name for a Level 1 golden copy in CSV, date- and time-prefixed. */ export declare const GLEIF_ARCHIVE_PATTERN: RegExp; /** * ISO 20275 Entity Legal Form codes whose form is a natural person trading in their own name. * * Each code is one the golden copy files under the `SOLE_PROPRIETOR` category, and each is kept * because its name in GLEIF's ELF code list v1.6 (2026-02-19) states that form: `4QIE` is India's * `Sole Proprietorship`, `ZVVM` Poland's `osoby fizyczne prowadzące działalność gospodarczą`, * `OL20` Germany's `Einzelunternehmen, eingetragener Kaufmann`, `RV48` China's `个体工商户`. * Two codes filed under the category are left out because the list describes each as a company: * `HA2W` (Oman, a one-person company) and `AL8W` (Brazil, `Sociedade Limitada Unipessoal`). */ export declare const GLEIF_SOLE_PROPRIETOR_LEGAL_FORMS: ReadonlySet; /** * Why an entity or one of its addresses didn't become a row. */ export declare const GLEIFRefusal: { /** * The country is in {@link GLEIF_UNREVIEWED_COUNTRIES}. */ readonly CountryUnreviewed: "country-unreviewed"; /** * `Entity.EntityCategory` is `SOLE_PROPRIETOR`. */ readonly SoleProprietorCategory: "sole-proprietor-category"; /** * The ELF code is a sole-proprietorship form. */ readonly SoleProprietorLegalForm: "sole-proprietor-legal-form"; /** * The free-text legal form states a sole proprietorship. */ readonly SoleProprietorFormText: "sole-proprietor-form-text"; /** * The address states no country. */ readonly CountryAbsent: "country-absent"; /** * The country isn't an ISO 3166-1 alpha-2 code. */ readonly CountryNotAlpha2: "country-not-alpha-2"; /** * The ISO 3166-2 region code's country prefix differs from `Country`. */ readonly RegionContradictsCountry: "region-contradicts-country"; /** * Codex holds no layout for the country, so no address line can be rendered. */ readonly CountryWithoutLayout: "country-without-layout"; /** * The address states no city. */ readonly LocalityAbsent: "locality-absent"; /** * The address states no first line. */ readonly StreetLineAbsent: "street-line-absent"; /** * The first line opens with a care-of marker, so it identifies the recipient rather than the place. */ readonly CareOfLine: "care-of-line"; /** * The first line holds no digit, so it cannot be told from a building name. */ readonly StreetLineWithoutNumber: "street-line-without-number"; /** * The first line holds a digit the split couldn't place as a house number. */ readonly StreetNumberUnplaced: "street-number-unplaced"; /** * The street the split left still holds a comma, so the line joins several parts * (a building, a district, a floor) and the split cannot say which part is the street. */ readonly StreetLineSegmented: "street-line-segmented"; /** * The street the split left is a building or a place inside one * (`PLATINUM TOWER`, `NINTH FLOOR`, `APTO`), so the number beside it numbers a room, * an office or a building rather than a premise on a street. */ readonly StreetHoldsPremiseWord: "street-holds-premise-word"; /** * The street the split left is only a generic word, as Qatar's `910 Street` leaves `Street`. */ readonly StreetNameGenericOnly: "street-name-generic-only"; /** * The split's house number disagrees with the publisher's own `AddressNumber`. */ readonly StreetNumberDisagrees: "street-number-disagrees"; /** * The components do not render under the country's layout. */ readonly Unrenderable: "unrenderable"; /** * The rendered line holds fewer than two address components besides the venue. */ readonly ComponentsTooFew: "components-too-few"; }; /** * One of the {@link GLEIFRefusal} reasons. */ export type GLEIFRefusal = (typeof GLEIFRefusal)[keyof typeof GLEIFRefusal]; /** * The two address blocks a record holds for its entity. */ export declare const GLEIFAddressBlock: { readonly Legal: "LegalAddress"; readonly Headquarters: "HeadquartersAddress"; }; /** * One of the {@link GLEIFAddressBlock} values. */ export type GLEIFAddressBlock = (typeof GLEIFAddressBlock)[keyof typeof GLEIFAddressBlock]; /** * One CSV record, keyed by the publisher's own column names. */ export type GLEIFRecord = Readonly>; /** * What one address block yielded: a row, or the reason it yielded none. */ export type GLEIFAddressReading = { readonly admitted: CanonicalRow; /** * Whether the country's own street-line reader read the line after the generic split refused it. */ readonly byCountryReader: boolean; } | { readonly refused: GLEIFRefusal; }; /** * Whether the entity is a natural person trading in their own name, or otherwise refused whole. * * @returns The refusal, or `null` for an entity whose addresses may be read. */ export declare function readGLEIFEntity(record: GLEIFRecord): GLEIFRefusal | null; /** * Whether the headquarters block states the same address as the legal block, field for field. */ export declare function headquartersRepeatsLegal(record: GLEIFRecord): boolean; /** * Whether the country's layout, in `script`, writes the house number before the street name. * * Read off the layout `formatAddressRow` renders with, so the split and the render cannot disagree. * * @returns `null` where the layout prints no street line. */ export declare function houseNumberLeadsStreet(country: string, script?: AddressScript | null): boolean | null; /** * The first line with a leading or trailing copy of the publisher's own city removed, * a civic-number marker removed, and a period closing a trailing number removed. * * The city copy is removed only where it equals the `City` field, folded for case, * so the publisher's record authorizes the removal rather than a place-name list. */ export declare function normalizeGLEIFStreetLine(line: string, city: string): string; /** * Read one address block into a row, or report why it yielded none. * * Exported because the refusal reasons are the measurement the adapter is checked by. * The entity-level refusals of {@linkcode readGLEIFEntity} are the caller's to apply first. */ export declare function readGLEIFAddress(record: GLEIFRecord, block: GLEIFAddressBlock, units: UnitSplitter): GLEIFAddressReading; export declare function createGLEIFAdapter(): CorpusAdapter; /** * The configured adapter instance registered with the corpus builder. */ export declare const gleifAdapter: CorpusAdapter; //# sourceMappingURL=adapter.d.ts.map