export interface LocaleVocab { monthLong: string[]; monthShort: string[]; weekdayLong: string[]; weekdayShort: string[]; dayPeriod: string[]; } export declare function subscribeToVocabChanges(listener: () => void): void; /** * Supply a custom month/weekday/day-period vocabulary for a locale key, * overriding the Intl-derived vocab this library would otherwise build * for that key. Useful for locales Intl doesn't cover well — the * Parsing section of the README ("MMMM/MMM assume a 12-month calendar") * calls out the Hebrew leap-month gap as a specific case this addresses. * * Throws descriptively on malformed input (wrong array lengths, empty * strings, duplicate entries, missing fields) rather than failing later * during format/parse. * * Registered vocab takes precedence over the Intl-derived vocab for that * locale key, including for already-cached entries — registering * invalidates the prior cache entry for that locale so the next call * picks up the new vocab. * * @example * registerLocaleVocab('en-u-ca-hebrew-leap', { * monthLong: ['Nisan','Iyar','Sivan','Tammuz','Av','Elul','Tishrei','Marcheshvan','Kislev','Tevet','Shevat','Adar I','Adar II'], * monthShort: ['Nis','Iyy','Siv','Tam','Av','Elu','Tish','Chesh','Kis','Tev','Shv','Ad1','Ad2'], * weekdayLong: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'], * weekdayShort: ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'], * dayPeriod: ['AM','PM'], * }); */ export declare function registerLocaleVocab(locale: string, vocab: Partial): void; export declare function normalizeLocaleTag(locale: string): string; export declare function canonicalCacheKey(locale: string): string; export declare function assertValidLocaleTag(locale: string): void; export declare function partValue(formatter: Intl.DateTimeFormat, date: Date, type: Intl.DateTimeFormatPartTypes): string; export declare function getCustomVocab(locale: string): LocaleVocab | undefined; export declare function getLocaleVocab(locale: string): LocaleVocab;