UNPKG

1.41 kBTypeScriptView Raw
1import * as React from 'react';
2import { FormatDateOptions, FormatNumberOptions, FormatListOptions, FormatDisplayNameOptions } from '@formatjs/intl';
3import { IntlShape } from '../types';
4import { Part } from '@formatjs/intl-listformat';
5declare type Formatter = {
6 formatDate: FormatDateOptions;
7 formatTime: FormatDateOptions;
8 formatNumber: FormatNumberOptions;
9 formatList: FormatListOptions;
10 formatDisplayName: FormatDisplayNameOptions;
11};
12export declare const FormattedNumberParts: React.FC<Formatter['formatNumber'] & {
13 value: Parameters<IntlShape['formatNumber']>[0];
14 children(val: Intl.NumberFormatPart[]): React.ReactElement | null;
15}>;
16export declare const FormattedListParts: React.FC<Formatter['formatList'] & {
17 value: Parameters<IntlShape['formatList']>[0];
18 children(val: Part[]): React.ReactElement | null;
19}>;
20export 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}>;
24export 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}>;
28export {};
29//# sourceMappingURL=createFormattedComponent.d.ts.map
\No newline at end of file