@naturalcycles/js-lib
Version:
Standard library for universal (browser + Node.js) javascript
27 lines (26 loc) • 1.3 kB
TypeScript
import type { IANATimezone } from '../types.js';
/**
* Returns cached Intl.* formatters, because they are known to be
* very slow to create.
*
* See https://github.com/poppinss/intl-formatter
*
* Methods accept non-optional arguments consciously,
* to be able to cache them better. Just pass {} for options.
*/
declare class MemoizedIntl {
/**
* Returns the IANA timezone e.g `Europe/Stockholm`.
* https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
*/
getTimezone(): IANATimezone;
DateTimeFormat(locales: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
RelativeTimeFormat(locales: Intl.LocalesArgument, options: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat;
NumberFormat(locales: Intl.LocalesArgument, options: Intl.NumberFormatOptions): Intl.NumberFormat;
Collator(locales: Intl.LocalesArgument, options: Intl.CollatorOptions): Intl.Collator;
PluralRules(locales: Intl.LocalesArgument, options: Intl.PluralRulesOptions): Intl.PluralRules;
ListFormat(locales: Intl.LocalesArgument, options: Intl.ListFormatOptions): Intl.ListFormat;
DisplayNames(locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions): Intl.DisplayNames;
}
export declare const Intl2: MemoizedIntl;
export {};