1 | import { FormatDateOptions, FormatDisplayNameOptions, FormatListOptions, FormatNumberOptions } from '@formatjs/intl';
|
2 | import * as React from 'react';
|
3 | import { IntlShape } from '../types';
|
4 | type Formatter = {
|
5 | formatDate: FormatDateOptions;
|
6 | formatTime: FormatDateOptions;
|
7 | formatNumber: FormatNumberOptions;
|
8 | formatList: FormatListOptions;
|
9 | formatDisplayName: FormatDisplayNameOptions;
|
10 | };
|
11 | export declare const FormattedNumberParts: React.FC<Formatter['formatNumber'] & {
|
12 | value: Parameters<IntlShape['formatNumber']>[0];
|
13 | children(val: Intl.NumberFormatPart[]): React.ReactElement | null;
|
14 | }>;
|
15 | export declare const FormattedListParts: React.FC<Formatter['formatList'] & {
|
16 | value: Parameters<IntlShape['formatList']>[0];
|
17 | children(val: ReturnType<Intl.ListFormat['formatToParts']>): React.ReactElement | null;
|
18 | }>;
|
19 | export declare function createFormattedDateTimePartsComponent<Name extends 'formatDate' | 'formatTime'>(name: Name): React.FC<Formatter[Name] & {
|
20 | value: Parameters<IntlShape[Name]>[0];
|
21 | children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
22 | }>;
|
23 | export declare function createFormattedComponent<Name extends keyof Formatter>(name: Name): React.FC<Formatter[Name] & {
|
24 | value: Parameters<IntlShape[Name]>[0];
|
25 | children?(val: string): React.ReactElement | null;
|
26 | }>;
|
27 | export {};
|