-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
170 lines (122 loc) · 5.87 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
type CalendarSystem = 'buddhist' | 'coptic' | 'ethioaa' | 'ethiopic' | 'gregory' | 'hebrew' | 'indian' | 'islamic' | 'islamicc' | 'japanese' | 'persian' | 'roc';
type NumericSystemType = 'arab' | 'arabext' | 'bali' | 'beng' | 'deva' | 'fullwide' | 'gujr' | 'guru' | 'hanidec' | 'khmr' | 'knda' | 'laoo' | 'latn' | 'limb' | 'mlym' | 'mong' | 'mymr' | 'orya' | 'tamldec' | 'telu' | 'thai' | 'tibt';
type CountryISOCode = 'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DG' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EA' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HN' | 'HR' | 'HT' | 'HU' | 'IC' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW';
type LanguageISOCode = 'aa' | 'af' | 'ar' | 'az' | 'be' | 'bg' | 'bi' | 'bm' | 'bn' | 'bs' | 'ca' | 'cs' | 'da' | 'de' | 'dv' | 'dz' | 'el' | 'en' | 'es' | 'et' | 'fa' | 'fi' | 'fo' | 'fr' | 'gn' | 'ha' | 'he' | 'hi' | 'hr' | 'ht' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'ka' | 'kl' | 'km' | 'ko' | 'ky' | 'lo' | 'lt' | 'lv' | 'mg' | 'mk' | 'mn' | 'ms' | 'mt' | 'my' | 'nb' | 'ne' | 'nl' | 'pl' | 'pt' | 'rn' | 'ro' | 'ru' | 'rw' | 'si' | 'sk' | 'sl' | 'sm' | 'sn' | 'so' | 'sq' | 'sr' | 'st' | 'sv' | 'sw' | 'tg' | 'th' | 'ti' | 'tk' | 'to' | 'tr' | 'ur' | 'uz' | 'vi' | 'wo' | 'zh';
type YearListItem = {
id: number,
selected: boolean,
title: string,
}
type MonthListItem = {
id: number,
selected: boolean,
title: string,
titleNumber: string,
titleInt: string,
}
type DayMonthItem = {
id: Date,
utcDay: Date,
localeDateTime: string,
weekDay: number,
weekEnd: boolean,
selected: boolean,
title: string,
titleInt: number
}
type DayItem = {
id: Date,
utcDay: Date,
localeDateTime: string,
weekDay: number,
weekEnd: boolean,
selected: boolean,
title: string,
titleInt: number,
weekNumber: number,
}
type WeekHead = {
long: string,
narrow: string,
}
type WeekHeads = [WeekHead, WeekHead, WeekHead, WeekHead, WeekHead, WeekHead, WeekHead]
type WeekDay = boolean | DayItem
type DayWeekMonthItem = {
head: WeekHeads,
weeks: WeekDay[],
}
type CountryInfoItem = {
id: CountryISOCode,
selected: boolean,
defaultLanguage: LanguageISOCode,
flag: string,
title: string,
titleNative: string,
};
type LanguageInfoItem = {
id: LanguageISOCode,
selected: boolean,
rtl: boolean,
title: string,
titleNative: string,
};
type CalendarInfoItem = {
id: CalendarSystem,
selected: boolean,
title: string,
titleShort: string,
};
interface RelativeTimeFormatOptions {
localeMatcher?: string;
numeric?: string;
style?: string;
}
export declare class Environment {
public static test(): boolean;
}
export declare class Calendar {
constructor(date?: Date, locale?: Locale);
public getLocale(): Locale
public setLocale(locale: Locale): Calendar;
public getDate(): Date;
public setDate(date: Date): Calendar
public format(format: string, date?: Date): string;
public tokenize(tokens: string[], date?: Date): number[]
public yearList(length?: number): YearListItem[];
public yearOffsetSeek(dayOffset: number, wantedYear: number, currentMonth: number, currentDay: number): Date | null;
public yearJump(wantedYear: number): Calendar;
public yearShift(next?: boolean): Calendar;
public monthList(): MonthListItem[];
public monthShift(next?: boolean): Calendar;
public dayShift(next?: boolean): Calendar;
public dayMonthList(): DayMonthItem[];
public dayWeekMonthTable(): DayWeekMonthItem;
}
export declare class Locale {
public static calendarName(formatted: string, ident: string): string;
constructor(locale: string);
public toString(): string;
public getLanguageCode(): LanguageISOCode;
public getCountryCode(): CountryISOCode;
public getCountryFlag(): string;
public getCalendar(): CalendarSystem;
public isRTL(lang?: string): boolean;
public getNumberingSystem(): NumericSystemType;
public numberFormat(
number: number,
options?: Intl.NumberFormatOptions,
): string
public relativeTimeString(
date1: Date,
date2?: Date,
options?: RelativeTimeFormatOptions,
): string
public setCountry(country: string): Locale;
public setCalendar(calendar: CalendarSystem): Locale;
public getWeekDays(): number[];
public getWeekEnds(): number[];
public getCountryList(): CountryInfoItem[];
public getLanguageList(): LanguageInfoItem[];
public getCalendarList(): CalendarInfoItem[];
}
export declare const SUPPORTED_CALENDARS: CalendarSystem[];