UNPKG

1.04 kBTypeScriptView Raw
1import { default as IntlRelativeTimeFormat } from '@formatjs/intl-relativetimeformat';
2import { SUPPORTED_FIELD, STYLE, LocaleData } from './types';
3declare global {
4 namespace Intl {
5 var RelativeTimeFormat: typeof IntlRelativeTimeFormat;
6 }
7}
8export interface IntlRelativeFormatOptions {
9 style?: STYLE;
10 units?: SUPPORTED_FIELD;
11}
12interface IntlRelativeFormat {
13 new (locales?: string | string[], opts?: IntlRelativeFormatOptions): IntlRelativeFormat;
14 (locales?: string | string[], opts?: IntlRelativeFormatOptions): IntlRelativeFormat;
15 thresholds: Record<string, number>;
16 defaultLocale: string;
17 __localeData__: Record<string, LocaleData>;
18 __addLocaleData(...data: LocaleData[]): void;
19 format(date: ConstructorParameters<typeof Date>[0], opts?: {
20 now?: Date | number | null;
21 }): string;
22 resolvedOptions(): {
23 locale: string;
24 style: STYLE;
25 units?: SUPPORTED_FIELD;
26 };
27}
28declare const RelativeFormat: IntlRelativeFormat;
29export default RelativeFormat;