UNPKG

2.99 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';
6export { IntlConfig, ResolvedIntlConfig, IntlShape } from './src/types';
7export { 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';
8export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;
9export declare function defineMessage<T extends MessageDescriptor>(msg: T): T;
10export { default as injectIntl, Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps, } from './src/components/injectIntl';
11export { default as useIntl } from './src/components/useIntl';
12export { default as IntlProvider, createIntl } from './src/components/provider';
13export declare const FormattedDate: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
14 value: string | number | Date | undefined;
15}>;
16export declare const FormattedTime: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
17 value: string | number | Date | undefined;
18}>;
19export declare const FormattedNumber: React.FC<NumberFormatOptions & CustomFormatConfig & {
20 value: number | bigint;
21}>;
22export declare const FormattedList: React.FC<IntlListFormatOptions & {
23 value: readonly React.ReactNode[];
24}>;
25export declare const FormattedDisplayName: React.FC<DisplayNamesOptions & {
26 value: string | number | Record<string, unknown>;
27}>;
28export declare const FormattedDateParts: React.FC<FormatDateOptions & {
29 value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
30 children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
31}>;
32export declare const FormattedTimeParts: React.FC<FormatDateOptions & {
33 value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
34 children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
35}>;
36export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
37export { default as FormattedRelativeTime } from './src/components/relative';
38export { default as FormattedPlural } from './src/components/plural';
39export { default as FormattedMessage } from './src/components/message';
40export { default as FormattedDateTimeRange } from './src/components/dateTimeRange';
41export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
42//# sourceMappingURL=index.d.ts.map
\No newline at end of file