Skip to content

Interface: IntlShape<T>

src/core/util/l10n.IntlShape

Type parameters

NameType
Tstring

Hierarchy

  • ResolvedIntlConfig<T>

  • IntlFormatters<T>

    IntlShape

Table of contents

Properties

Methods

Properties

defaultFormats

defaultFormats: CustomFormats

Inherited from

ResolvedIntlConfig.defaultFormats


defaultLocale

defaultLocale: string

Inherited from

ResolvedIntlConfig.defaultLocale


defaultRichTextElements

Optional defaultRichTextElements: Record<string, FormatXMLElementFn<T>>

Inherited from

ResolvedIntlConfig.defaultRichTextElements


fallbackOnEmptyString

Optional fallbackOnEmptyString: boolean

Inherited from

ResolvedIntlConfig.fallbackOnEmptyString


formats

formats: CustomFormats

Inherited from

ResolvedIntlConfig.formats


formatters

formatters: Formatters


locale

locale: string

Inherited from

ResolvedIntlConfig.locale


messages

messages: Record<string, string> | Record<string, MessageFormatElement[]>

Inherited from

ResolvedIntlConfig.messages


onError

onError: OnErrorFn

Inherited from

ResolvedIntlConfig.onError


onWarn

Optional onWarn: OnWarnFn

Inherited from

ResolvedIntlConfig.onWarn


timeZone

Optional timeZone: string

Inherited from

ResolvedIntlConfig.timeZone

Methods

$t

$t(descriptor, values?, opts?): string

Parameters

NameType
descriptorMessageDescriptor
values?Record<string, PrimitiveType | FormatXMLElementFn<string, string>>
opts?Options

Returns

string

Inherited from

IntlFormatters.$t

$t<T>(descriptor, values?, opts?): string | T | (string | T)[]

Type parameters

Name
T

Parameters

NameType
descriptorMessageDescriptor
values?Record<string, PrimitiveType | T | FormatXMLElementFn<T>>
opts?Options

Returns

string | T | (string | T)[]

Inherited from

IntlFormatters.$t


formatDate

formatDate(value, opts?): string

Parameters

NameType
valuestring | number | Date
opts?FormatDateOptions

Returns

string

Inherited from

IntlFormatters.formatDate


formatDateTimeRange

formatDateTimeRange(from, to, opts?): string

Parameters

NameType
fromnumber | Date
tonumber | Date
opts?FormatDateOptions

Returns

string

Inherited from

IntlFormatters.formatDateTimeRange


formatDateToParts

formatDateToParts(value, opts?): DateTimeFormatPart[]

Parameters

NameType
valuestring | number | Date
opts?FormatDateOptions

Returns

DateTimeFormatPart[]

Inherited from

IntlFormatters.formatDateToParts


formatDisplayName

formatDisplayName(value, opts): string

Parameters

NameType
valuestring | number | Record<string, unknown>
optsFormatDisplayNameOptions

Returns

string

Inherited from

IntlFormatters.formatDisplayName


formatList

formatList(values, opts?): string

Parameters

NameType
valuesreadonly string[]
opts?FormatListOptions

Returns

string

Inherited from

IntlFormatters.formatList

formatList<T>(values, opts?): string | T | (string | T)[]

Type parameters

Name
T

Parameters

NameType
valuesreadonly (string | T)[]
opts?FormatListOptions

Returns

string | T | (string | T)[]

Inherited from

IntlFormatters.formatList


formatListToParts

formatListToParts<T>(values, opts?): Part[]

Type parameters

Name
T

Parameters

NameType
valuesreadonly (string | T)[]
opts?FormatListOptions

Returns

Part[]

Inherited from

IntlFormatters.formatListToParts


formatMessage

formatMessage(descriptor, values?, opts?): string

Parameters

NameType
descriptorMessageDescriptor
values?Record<string, PrimitiveType | FormatXMLElementFn<string, string>>
opts?Options

Returns

string

Inherited from

IntlFormatters.formatMessage

formatMessage<T>(descriptor, values?, opts?): string | T | (string | T)[]

Type parameters

Name
T

Parameters

NameType
descriptorMessageDescriptor
values?Record<string, PrimitiveType | T | FormatXMLElementFn<T>>
opts?Options

Returns

string | T | (string | T)[]

Inherited from

IntlFormatters.formatMessage


formatNumber

formatNumber(value, opts?): string

Parameters

NameType
valuenumber | bigint
opts?FormatNumberOptions

Returns

string

Inherited from

IntlFormatters.formatNumber


formatNumberToParts

formatNumberToParts(value, opts?): NumberFormatPart[]

Parameters

NameType
valuenumber | bigint
opts?FormatNumberOptions

Returns

NumberFormatPart[]

Inherited from

IntlFormatters.formatNumberToParts


formatPlural

formatPlural(value, opts?): LDMLPluralRule

Parameters

NameType
valuenumber
opts?FormatPluralOptions

Returns

LDMLPluralRule

Inherited from

IntlFormatters.formatPlural


formatRelativeTime

formatRelativeTime(value, unit?, opts?): string

Parameters

NameType
valuenumber
unit?RelativeTimeFormatUnit
opts?FormatRelativeTimeOptions

Returns

string

Inherited from

IntlFormatters.formatRelativeTime


formatTime

formatTime(value, opts?): string

Parameters

NameType
valuestring | number | Date
opts?FormatDateOptions

Returns

string

Inherited from

IntlFormatters.formatTime


formatTimeToParts

formatTimeToParts(value, opts?): DateTimeFormatPart[]

Parameters

NameType
valuestring | number | Date
opts?FormatDateOptions

Returns

DateTimeFormatPart[]

Inherited from

IntlFormatters.formatTimeToParts

Powered by TypeDoc & VitePress.