/** * Canonical locale set for data packs (locale-first addressing). * * Mirrors moment.js's `locale/*.js` files (135 locales) so the pack scheme * stays in lockstep with the date layer, plus two codes moment does not ship. * `en` is one — moment treats English as its built-in default and ships no * `en.js`, but a data-pack system needs English. `zh` is the other, and it is * here because the variant fallback takes exactly ONE step to the base * language: `zh` is the only address zh-tw, zh-hk and zh-mo can all reach, so * it is where Traditional Chinese has to live. Total: 137. A pack address's * first segment must be one of these codes or a reserved bucket (`common`). */ export type Direction = 'ltr' | 'rtl'; export declare const CANONICAL_LOCALES: ReadonlySet; export declare const RTL_LOCALES: ReadonlySet; /** * Country names (full lowercase words, so they never collide with 2-letter * language codes). Gate valid country first-segments and catch typos. Country * generators (government IDs, plates, licenses) are addressed absolutely by * country: `usa.tax.ssn`, `russia.vehicle.plate`. Populated on demand — only * `usa` + `russia` carry data today. */ export declare const CANONICAL_COUNTRIES: ReadonlySet; /** * Valid address roots that are neither languages nor countries. `common` = * language-agnostic shared data; `user` = the user's private, update-safe area * (physically their own directory, scanned via dataPaths). */ export declare const RESERVED_BUCKETS: ReadonlySet; export declare function directionOf(code: string): Direction; /** Called by the pack scanner for every address it registers. */ export declare function noteNamespace(head: string): void; /** * The base language of a regional variant — `en-gb` → `en`, `en` → undefined. * * One step, deliberately. A variant defers to the language it is a variant OF * and to nothing else: `zh-tw` reaches `zh` (which ships nothing) and stops, * rather than walking on to `zh-cn` and handing Traditional readers Simplified * data. Falling all the way back to English would be worse still — silently * correct-looking output in the wrong language is the failure this project * exists to prevent. */ export declare function baseLocale(locale: string): string | undefined; export declare function resolvePackAddress(path: string, locale: string, registry?: ReadonlyMap): string; export interface LocaleManifest { readonly code: string; readonly direction: Direction; } export declare const MANIFEST_FILENAME = "_locale.json"; /** * Parse a `_locale.json` manifest. Tolerant: malformed JSON or missing fields * fall back to the folder's code and its canonical direction. */ export declare function parseLocaleManifest(content: string, fallbackCode: string): LocaleManifest; //# sourceMappingURL=locales.d.ts.map