Library API
    Preparing search index...

    Interface TempoIntlNamespace

    interface TempoIntlNamespace {
        baseName: string;
        direction: "ltr" | "rtl";
        firstDay: number;
        hourCycle: string;
        hourCycles: readonly string[];
        info: ResolvedLocaleInfo;
        language?: string;
        locale?: Locale;
        minimalDays: number;
        numberingSystem: string;
        numberingSystems: readonly string[];
        region?: string;
        script?: string;
        timeZones: readonly string[];
        weekend: readonly number[];
        weekInfo: LocaleWeekInfo;
        dtf(options?: DateTimeFormatOptions): DateTimeFormat;
        lf(options?: ListFormatOptions): ListFormat;
        list(items: Iterable<string>, options?: ListFormatOptions): string;
        nf(options?: NumberFormatOptions): NumberFormat;
        number(value: number | bigint, options?: NumberFormatOptions): string;
        plural(value: number, options?: PluralRulesOptions): LDMLPluralRule;
        relativeTime(
            value: number,
            unit: RelativeTimeFormatUnit,
            options?: RelativeTimeFormatOptions,
        ): string;
        rtf(options?: RelativeTimeFormatOptions): RelativeTimeFormat;
    }
    Index
    baseName: string

    Use intl.info.baseName instead. To be removed in v5.0.0.

    direction: "ltr" | "rtl"

    Use intl.info.direction instead. To be removed in v5.0.0.

    firstDay: number

    Use intl.info.firstDay instead. To be removed in v5.0.0.

    hourCycle: string

    Use intl.info.hourCycle instead. To be removed in v5.0.0.

    hourCycles: readonly string[]

    Use intl.info.hourCycles instead. To be removed in v5.0.0.

    Resolved cultural and regional calendar metadata (firstDay, weekend, direction, hourCycle, etc.) via the host engine's CLDR / Intl.Locale Info database.

    language?: string

    Use intl.info.language instead. To be removed in v5.0.0.

    locale?: Locale

    Memoized native Intl.Locale instance for the active locale.

    minimalDays: number

    Minimum days required in the first week of the year

    numberingSystem: string

    Use intl.info.numberingSystem instead. To be removed in v5.0.0.

    numberingSystems: readonly string[]

    Use intl.info.numberingSystems instead. To be removed in v5.0.0.

    region?: string

    Use intl.info.region instead. To be removed in v5.0.0.

    script?: string

    Use intl.info.script instead. To be removed in v5.0.0.

    timeZones: readonly string[]

    Use intl.info.timeZones instead. To be removed in v5.0.0.

    weekend: readonly number[]

    Use intl.info.weekend instead. To be removed in v5.0.0.

    weekInfo: LocaleWeekInfo

    Use intl.info.weekInfo instead. To be removed in v5.0.0.

    • Returns a globally memoized native Intl.DateTimeFormat instance pre-bound to the active locale and timezone.

      Parameters

      • Optionaloptions: DateTimeFormatOptions

      Returns DateTimeFormat

    • Returns a globally memoized native Intl.ListFormat instance pre-bound to the active locale.

      Parameters

      • Optionaloptions: ListFormatOptions

      Returns ListFormat

    • Formats an iterable or array of strings into a localized list (e.g. ['A', 'B', 'C'] -> 'A, B, and C') pre-bound to the active locale and backed by a globally memoized Intl.ListFormat instance.

      Parameters

      • items: Iterable<string>
      • Optionaloptions: ListFormatOptions

      Returns string

    • Returns a globally memoized native Intl.NumberFormat instance pre-bound to the active locale.

      Parameters

      • Optionaloptions: NumberFormatOptions

      Returns NumberFormat

    • Formats a number according to the active locale and numbering system backed by a globally memoized Intl.NumberFormat instance.

      Parameters

      • value: number | bigint
      • Optionaloptions: NumberFormatOptions

      Returns string

    • Resolves the plural category rule ('zero' | 'one' | 'two' | 'few' | 'many' | 'other') for a numeric value in the active locale.

      Parameters

      • value: number
      • Optionaloptions: PluralRulesOptions

      Returns LDMLPluralRule

    • Formats a relative time description (e.g. -1, 'day' -> 'yesterday' or 'il y a 1 jour') pre-bound to the active locale and backed by a globally memoized Intl.RelativeTimeFormat instance.

      Parameters

      • value: number
      • unit: RelativeTimeFormatUnit
      • Optionaloptions: RelativeTimeFormatOptions

      Returns string

    • Returns a globally memoized native Intl.RelativeTimeFormat instance pre-bound to the active locale.

      Parameters

      • Optionaloptions: RelativeTimeFormatOptions

      Returns RelativeTimeFormat