UNPKG

react-intl

Version:

Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.

7 lines (6 loc) 1.52 kB
import { Formatters, IntlConfig, IntlFormatters } from '../types'; export declare function getFormatter({ locale, formats, onError, timeZone, }: Pick<IntlConfig, 'locale' | 'formats' | 'onError' | 'timeZone'>, type: 'date' | 'time', getDateTimeFormat: Formatters['getDateTimeFormat'], options?: Parameters<IntlFormatters['formatDate']>[1]): Intl.DateTimeFormat; export declare function formatDate(config: Pick<IntlConfig, 'locale' | 'formats' | 'onError' | 'timeZone'>, getDateTimeFormat: Formatters['getDateTimeFormat'], value?: Parameters<IntlFormatters['formatDate']>[0], options?: Parameters<IntlFormatters['formatDate']>[1]): string; export declare function formatTime(config: Pick<IntlConfig, 'locale' | 'formats' | 'onError' | 'timeZone'>, getDateTimeFormat: Formatters['getDateTimeFormat'], value?: Parameters<IntlFormatters['formatTime']>[0], options?: Parameters<IntlFormatters['formatTime']>[1]): string; export declare function formatDateToParts(config: Pick<IntlConfig, 'locale' | 'formats' | 'onError' | 'timeZone'>, getDateTimeFormat: Formatters['getDateTimeFormat'], value?: Parameters<IntlFormatters['formatDate']>[0], options?: Parameters<IntlFormatters['formatDate']>[1]): Intl.DateTimeFormatPart[]; export declare function formatTimeToParts(config: Pick<IntlConfig, 'locale' | 'formats' | 'onError' | 'timeZone'>, getDateTimeFormat: Formatters['getDateTimeFormat'], value?: Parameters<IntlFormatters['formatTime']>[0], options?: Parameters<IntlFormatters['formatTime']>[1]): Intl.DateTimeFormatPart[];