UNPKG

3.1 kBTypeScriptView Raw
1import * as React from 'react';
2import { MessageDescriptor, CustomFormatConfig, FormatDateOptions } from '@formatjs/intl';
3import { IntlListFormatOptions } from '@formatjs/intl-listformat';
4import { DisplayNamesOptions } from '@formatjs/intl-displaynames';
5import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
6import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
7import useIntl from './src/components/useIntl';
8import IntlProvider, { createIntl } from './src/components/provider';
9import FormattedRelativeTime from './src/components/relative';
10import FormattedPlural from './src/components/plural';
11import FormattedMessage from './src/components/message';
12import FormattedDateTimeRange from './src/components/dateTimeRange';
13export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, WithIntlProps, WrappedComponentProps, createIntl, injectIntl, useIntl, };
14export { IntlConfig, ResolvedIntlConfig, IntlShape } from './src/types';
15export { createIntlCache, MessageDescriptor, IntlCache, Formatters, IntlFormatters, FormatDisplayNameOptions, FormatListOptions, FormatPluralOptions, FormatRelativeTimeOptions, FormatNumberOptions, FormatDateOptions, CustomFormatConfig, CustomFormats, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
16export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;
17export declare function defineMessage<T extends MessageDescriptor>(msg: T): T;
18export declare const FormattedDate: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
19 value: string | number | Date | undefined;
20}>;
21export declare const FormattedTime: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
22 value: string | number | Date | undefined;
23}>;
24export declare const FormattedNumber: React.FC<NumberFormatOptions & CustomFormatConfig & {
25 value: number | bigint;
26}>;
27export declare const FormattedList: React.FC<IntlListFormatOptions & {
28 value: readonly React.ReactNode[];
29}>;
30export declare const FormattedDisplayName: React.FC<DisplayNamesOptions & {
31 value: string | number | Record<string, unknown>;
32}>;
33export declare const FormattedDateParts: React.FC<FormatDateOptions & {
34 value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
35 children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
36}>;
37export declare const FormattedTimeParts: React.FC<FormatDateOptions & {
38 value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
39 children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
40}>;
41export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
42export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
43//# sourceMappingURL=index.d.ts.map
\No newline at end of file