1 | import { DateLocalizer, DateTimePart, NumberLocalizer } from './Localization';
|
2 | declare type UserDateFormat = Intl.DateTimeFormatOptions | ((date: Date, culture?: string) => string);
|
3 | /**
|
4 | * A `react-widgets` Localizer using native `Intl` APIs.
|
5 | *
|
6 | */
|
7 | declare class IntlDateLocalizer implements DateLocalizer<Intl.DateTimeFormatOptions> {
|
8 | culture?: string;
|
9 | firstOfWeek: () => number;
|
10 | date: (date: Date, format?: UserDateFormat) => string;
|
11 | time: (date: Date, format?: UserDateFormat) => string;
|
12 | datetime: (date: Date, format?: UserDateFormat) => string;
|
13 | header: (date: Date, format?: UserDateFormat) => string;
|
14 | footer: (date: Date, format?: UserDateFormat) => string;
|
15 | weekday: (date: Date, format?: UserDateFormat) => string;
|
16 | dayOfMonth: (date: Date, format?: UserDateFormat) => string;
|
17 | month: (date: Date, format?: UserDateFormat) => string;
|
18 | year: (date: Date, format?: UserDateFormat) => string;
|
19 | decade: (date: Date, format?: UserDateFormat) => string;
|
20 | century: (date: Date, format?: UserDateFormat) => string;
|
21 | constructor({ culture, firstOfWeek, }?: {
|
22 | culture?: string;
|
23 | firstOfWeek?: number;
|
24 | });
|
25 | toFormattedParts(date: Date, format?: Intl.DateTimeFormatOptions): DateTimePart[];
|
26 | parse(value: string): Date | null;
|
27 | }
|
28 | declare type UserNumberFormat = Intl.NumberFormatOptions | ((num: number, culture?: string) => string);
|
29 | /**
|
30 | * A number localization strategy based on `Intl.NumberFormat`.
|
31 | */
|
32 | declare class IntlNumberLocalizer implements NumberLocalizer<Intl.NumberFormatOptions> {
|
33 | culture?: string;
|
34 | decimalCharacter: () => string;
|
35 | format: (num: number, format?: UserNumberFormat) => string;
|
36 | constructor({ culture }?: {
|
37 | culture?: undefined;
|
38 | });
|
39 | parse(value: string): number;
|
40 | }
|
41 | export { IntlDateLocalizer as DateLocalizer, IntlNumberLocalizer as NumberLocalizer, };
|
42 |
|
\ | No newline at end of file |