Interface: IntlShape<T>
src/core/util/l10n.IntlShape
Type parameters
Name | Type |
---|---|
T | string |
Hierarchy
ResolvedIntlConfig
<T
>IntlFormatters
<T
>↳
IntlShape
Table of contents
Properties
- defaultFormats
- defaultLocale
- defaultRichTextElements
- fallbackOnEmptyString
- formats
- formatters
- locale
- messages
- onError
- onWarn
- timeZone
Methods
- $t
- formatDate
- formatDateTimeRange
- formatDateToParts
- formatDisplayName
- formatList
- formatListToParts
- formatMessage
- formatNumber
- formatNumberToParts
- formatPlural
- formatRelativeTime
- formatTime
- formatTimeToParts
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
Name | Type |
---|---|
descriptor | MessageDescriptor |
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
Name | Type |
---|---|
descriptor | MessageDescriptor |
values? | Record <string , PrimitiveType | T | FormatXMLElementFn <T >> |
opts? | Options |
Returns
string
| T
| (string
| T
)[]
Inherited from
IntlFormatters.$t
formatDate
formatDate(value
, opts?
): string
Parameters
Name | Type |
---|---|
value | string | number | Date |
opts? | FormatDateOptions |
Returns
string
Inherited from
IntlFormatters.formatDate
formatDateTimeRange
formatDateTimeRange(from
, to
, opts?
): string
Parameters
Name | Type |
---|---|
from | number | Date |
to | number | Date |
opts? | FormatDateOptions |
Returns
string
Inherited from
IntlFormatters.formatDateTimeRange
formatDateToParts
formatDateToParts(value
, opts?
): DateTimeFormatPart
[]
Parameters
Name | Type |
---|---|
value | string | number | Date |
opts? | FormatDateOptions |
Returns
DateTimeFormatPart
[]
Inherited from
IntlFormatters.formatDateToParts
formatDisplayName
formatDisplayName(value
, opts
): string
Parameters
Name | Type |
---|---|
value | string | number | Record <string , unknown > |
opts | FormatDisplayNameOptions |
Returns
string
Inherited from
IntlFormatters.formatDisplayName
formatList
formatList(values
, opts?
): string
Parameters
Name | Type |
---|---|
values | readonly string [] |
opts? | FormatListOptions |
Returns
string
Inherited from
IntlFormatters.formatList
formatList<T
>(values
, opts?
): string
| T
| (string
| T
)[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
values | readonly (string | T )[] |
opts? | FormatListOptions |
Returns
string
| T
| (string
| T
)[]
Inherited from
IntlFormatters.formatList
formatListToParts
formatListToParts<T
>(values
, opts?
): Part
[]
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
values | readonly (string | T )[] |
opts? | FormatListOptions |
Returns
Part
[]
Inherited from
IntlFormatters.formatListToParts
formatMessage
formatMessage(descriptor
, values?
, opts?
): string
Parameters
Name | Type |
---|---|
descriptor | MessageDescriptor |
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
Name | Type |
---|---|
descriptor | MessageDescriptor |
values? | Record <string , PrimitiveType | T | FormatXMLElementFn <T >> |
opts? | Options |
Returns
string
| T
| (string
| T
)[]
Inherited from
IntlFormatters.formatMessage
formatNumber
formatNumber(value
, opts?
): string
Parameters
Name | Type |
---|---|
value | number | bigint |
opts? | FormatNumberOptions |
Returns
string
Inherited from
IntlFormatters.formatNumber
formatNumberToParts
formatNumberToParts(value
, opts?
): NumberFormatPart
[]
Parameters
Name | Type |
---|---|
value | number | bigint |
opts? | FormatNumberOptions |
Returns
NumberFormatPart
[]
Inherited from
IntlFormatters.formatNumberToParts
formatPlural
formatPlural(value
, opts?
): LDMLPluralRule
Parameters
Name | Type |
---|---|
value | number |
opts? | FormatPluralOptions |
Returns
LDMLPluralRule
Inherited from
IntlFormatters.formatPlural
formatRelativeTime
formatRelativeTime(value
, unit?
, opts?
): string
Parameters
Name | Type |
---|---|
value | number |
unit? | RelativeTimeFormatUnit |
opts? | FormatRelativeTimeOptions |
Returns
string
Inherited from
IntlFormatters.formatRelativeTime
formatTime
formatTime(value
, opts?
): string
Parameters
Name | Type |
---|---|
value | string | number | Date |
opts? | FormatDateOptions |
Returns
string
Inherited from
IntlFormatters.formatTime
formatTimeToParts
formatTimeToParts(value
, opts?
): DateTimeFormatPart
[]
Parameters
Name | Type |
---|---|
value | string | number | Date |
opts? | FormatDateOptions |
Returns
DateTimeFormatPart
[]
Inherited from
IntlFormatters.formatTimeToParts