Library API
    Preparing search index...

    Interface TempoIntlNamespace

    interface TempoIntlNamespace {
        info: ResolvedLocaleInfo;
        locale?: Locale;
        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

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

    locale?: Locale

    Memoized native Intl.Locale instance for the active locale.

    • 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

    • 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