Skip to main content

Types

Type LocaleText in the guide is equivalent to T[number](string) in the source code.

Options

interface Options<T extends ReadonlyArray<string>, G extends LS<T> = {}> {
supportedLocales: T
locale: T[number]
fallbackLocale: T[number]
name?: string
globalLS?: G
currency?: LocaleMap<T, CurrencyType>
currencyFormatValueKey?: string
currencyFormat?: CurrencyMap<string>
keyCurrency?: CurrencyType
exchangeRate?: CurrencyMap<number>
timezone?: TimezoneType
timezoneData?: TimezoneDataMap
localTimezoneOnly?: boolean
}

ImprovedNumberFormatOptions

interface ImprovedNumberFormatOptions extends Intl.NumberFormatOptions {
roundingMode?: RoundingMode // 'ceil' | 'floor' | 'round'
}

LocaleMap

type LocaleMap<T extends ReadonlyArray<string>, V> = {
[locale in T[number]]: V
}

CurrencyMap

type CurrencyMap<T> = {
[currency in CurrencyType]?: T
}