UNPKG

1.17 kBTypeScriptView Raw
1import { ResolvedIntlConfig as CoreResolvedIntlConfig, Formatters, IntlFormatters, MessageDescriptor } from '@formatjs/intl';
2import { FormatXMLElementFn, Options as IntlMessageFormatOptions, PrimitiveType } from 'intl-messageformat';
3import * as React from 'react';
4import { DEFAULT_INTL_CONFIG } from './utils';
5export type IntlConfig = Omit<ResolvedIntlConfig, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>;
6export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNode> {
7 textComponent?: React.ComponentType | keyof React.JSX.IntrinsicElements;
8 wrapRichTextChunksInFragment?: boolean;
9}
10export interface IntlShape extends ResolvedIntlConfig, IntlFormatters<React.ReactNode> {
11 formatMessage(this: void, descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | FormatXMLElementFn<string, string>>, opts?: IntlMessageFormatOptions): string;
12 formatMessage(this: void, descriptor: MessageDescriptor, values?: Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<string, React.ReactNode>>, opts?: IntlMessageFormatOptions): Array<React.ReactNode>;
13 formatters: Formatters;
14}