/** * Peppol Code Lists — Static lookup utilities * * Provides tree-shakeable helper functions for common Peppol-related code lists: * countries, EAS schemes, unit codes, VAT categories, and payment means. * * All data is static — no API calls, no side effects. */ /** * Get the country name for an ISO 3166-1 alpha-2 code. * * @param code - Two-letter country code (case-insensitive) * @returns Country name or `undefined` if not found * * @example * ```ts * getCountryName("FR") // "France" * getCountryName("XX") // undefined * ``` */ export declare function getCountryName(code: string): string | undefined; /** * Get all supported countries. * * @returns Array of `{ code, name }` objects sorted by name */ export declare function getAllCountries(): Array<{ code: string; name: string; }>; /** * A currency entry per ISO 4217. */ export interface Currency { /** Three-letter ISO 4217 code (uppercase) */ code: string; /** Currency name */ name: string; /** Standard minor unit count (e.g., 2 for EUR, 0 for JPY, 3 for BHD) */ minorUnits: number; } /** * Look up a currency by ISO 4217 code. * * @param code - Three-letter currency code (case-insensitive) * @returns The currency entry or `undefined` if not found * * @example * ```ts * getCurrency("EUR") // { code: "EUR", name: "Euro", minorUnits: 2 } * getCurrency("eu") // undefined * ``` */ export declare function getCurrency(code: string): Currency | undefined; /** * Get all supported currencies. * * @returns Array sorted by ISO code ascending */ export declare function getAllCurrencies(): Currency[]; /** * A Peppol Electronic Address Scheme (EAS) entry. */ export interface EasScheme { /** Numeric EAS code (e.g. "0088") */ code: string; /** Human-readable scheme name */ name: string; /** ISO country code if scheme is country-specific */ country?: string; } /** * Look up an EAS scheme by its numeric code. * * @param code - EAS code (e.g. "0088", "0208") * @returns The scheme or `undefined` if not found * * @example * ```ts * getEasScheme("0208") // { code: "0208", name: "Belgian Enterprise Number (KBO/BCE)", country: "BE" } * getEasScheme("9999") // undefined * ``` */ export declare function getEasScheme(code: string): EasScheme | undefined; /** * Get all known EAS schemes. * * @returns Array of EAS schemes sorted by code */ export declare function getAllEasSchemes(): EasScheme[]; /** * Resolve a human-readable unit name or alias to its UN/ECE Recommendation 20 code. * * Accepts both aliases ("hours", "kg") and canonical codes ("HUR", "KGM"). * Unknown values pass through unchanged. * * @param input - Unit name or code * @returns Resolved UN/ECE code * * @example * ```ts * resolveUnit("hours") // "HUR" * resolveUnit("HUR") // "HUR" * resolveUnit("kg") // "KGM" * resolveUnit("XYZ") // "XYZ" (passthrough) * ``` */ export declare function resolveUnit(input: string): string; /** * Get all supported unit codes with human-readable names. * * @returns Array of `{ code, name }` objects sorted by code */ export declare function getAllUnits(): Array<{ code: string; name: string; }>; /** * A Peppol VAT category entry. */ export interface VatCategory { /** Category code (e.g. "S", "Z", "AE") */ code: string; /** Short name */ name: string; /** Longer description */ description: string; /** * Whether getpeppr can actually put this category on the wire (GPR-1012). * * `false` means the code is valid under EN 16931 but our provider has no * vocabulary for it, so a send carrying it is refused with a 422 * (`unsupported_vat_category`). Listing such a code without saying so is what * let `L` and `M` be advertised for months as usable regimes. */ sendable: boolean; } /** * Get all Peppol VAT category codes, sendable or not. * * Filter on `sendable` to get only the ones getpeppr can deliver — the others * are listed so the catalogue matches EN 16931, not because they can be used. * * @returns Array of VAT categories */ export declare function getVatCategories(): VatCategory[]; /** * A payment means code entry. */ export interface PaymentMeansCode { /** Numeric code */ code: number; /** Human-readable description */ name: string; } /** * Get all supported payment means codes sorted by code. * * @returns Array of payment means codes */ export declare function getPaymentMeansCodes(): PaymentMeansCode[]; /** * GPR-1234 — les DEUX vocabulaires de BR-CL-01, verbatim du rulebook gravé. * * Jusqu'ici `validator.ts` décidait sur une liste écrite à la main de 7 codes, * publiée telle quelle dans `openapi.yaml`. Or BR-CL-01 — fatale — définit deux * vocabulaires DISJOINTS : 50 codes pour ``, 13 pour * `` (seul `81` figure dans les deux). La liste unique * décrivait comme valides 6 codes illégaux pour un avoir, et refusait 44 codes * légaux pour une facture — dont `326` (facture partielle), que `DE-R-017` * cite nommément dans le même rulebook. Approximer une liste externe est le * défaut, la lire est le correctif (même leçon que BR-CL-14) : la source est * `peppol-schematron/CEN-EN16931-UBL.sch` v3.0.21, et le verrou console * `invoice-type-codes-network-parity.test.ts` rougit au premier écart. */ declare const INVOICE_TYPE_CODES: readonly [71, 80, 81, 82, 84, 102, 130, 202, 203, 204, 211, 218, 219, 295, 325, 326, 331, 380, 382, 383, 384, 385, 386, 387, 388, 389, 390, 393, 394, 395, 456, 457, 471, 472, 473, 500, 501, 527, 553, 575, 623, 633, 751, 780, 817, 870, 875, 876, 877, 935]; /** Les 13 codes légaux en `` — voir `INVOICE_TYPE_CODES`. */ declare const CREDIT_NOTE_TYPE_CODES: readonly [81, 83, 261, 262, 296, 308, 381, 396, 420, 458, 502, 503, 532]; /** * Any legal document type code — the UNION of both BR-CL-01 vocabularies. * * ⚠️ This type cannot express the context: `381` is legal on a credit note but * fatal on an invoice, `382` the reverse. Runtime validation * (`validateInvoice`) picks the vocabulary from `isCreditNote` — the type is * only the outer bound. */ export type InvoiceTypeCode = (typeof INVOICE_TYPE_CODES)[number] | (typeof CREDIT_NOTE_TYPE_CODES)[number]; /** * The 50 UNTDID 1001 codes BR-CL-01 allows as ``. * * @returns A fresh array — mutating the result cannot poison the vocabulary */ export declare function getInvoiceTypeCodes(): number[]; /** * The 13 UNTDID 1001 codes BR-CL-01 allows as ``. * * @returns A fresh array — mutating the result cannot poison the vocabulary */ export declare function getCreditNoteTypeCodes(): number[]; export {}; //# sourceMappingURL=code-lists.d.ts.map