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