You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
1.1 KiB

import * as React from 'react';
import { IntlShape, FormatDateOptions, FormatNumberOptions, FormatListOptions, FormatDisplayNameOptions } from '../types';
declare type Formatter = {
formatDate: FormatDateOptions;
formatTime: FormatDateOptions;
formatNumber: FormatNumberOptions;
formatList: FormatListOptions;
formatDisplayName: FormatDisplayNameOptions;
};
export declare const FormattedNumberParts: React.FC<Formatter['formatNumber'] & {
value: Parameters<IntlShape['formatNumber']>[0];
children(val: Intl.NumberFormatPart[]): React.ReactElement | null;
}>;
export declare function createFormattedDateTimePartsComponent<Name extends 'formatDate' | 'formatTime'>(name: Name): React.FC<Formatter[Name] & {
value: Parameters<IntlShape[Name]>[0];
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
}>;
export declare function createFormattedComponent<Name extends keyof Formatter>(name: Name): React.FC<Formatter[Name] & {
value: Parameters<IntlShape[Name]>[0];
children?(val: string): React.ReactElement | null;
}>;
export {};