UNPKG

1.46 kBTypeScriptView Raw
1export interface ParsingOption {
2 forwardDate?: boolean;
3 timezones?: TimezoneAbbrMap;
4}
5export interface AmbiguousTimezoneMap {
6 timezoneOffsetDuringDst: number;
7 timezoneOffsetNonDst: number;
8 dstStart: (year: number) => Date;
9 dstEnd: (year: number) => Date;
10}
11export declare type TimezoneAbbrMap = {
12 [key: string]: number | AmbiguousTimezoneMap;
13};
14export interface ParsingReference {
15 instant?: Date;
16 timezone?: string | number;
17}
18export interface ParsedResult {
19 readonly refDate: Date;
20 readonly index: number;
21 readonly text: string;
22 readonly start: ParsedComponents;
23 readonly end?: ParsedComponents;
24 date(): Date;
25 tags(): Set<string>;
26}
27export interface ParsedComponents {
28 isCertain(component: Component): boolean;
29 get(component: Component): number | null;
30 date(): Date;
31 tags(): Set<string>;
32}
33export declare type Component = "year" | "month" | "day" | "weekday" | "hour" | "minute" | "second" | "millisecond" | "meridiem" | "timezoneOffset";
34export declare enum Meridiem {
35 AM = 0,
36 PM = 1
37}
38export declare enum Weekday {
39 SUNDAY = 0,
40 MONDAY = 1,
41 TUESDAY = 2,
42 WEDNESDAY = 3,
43 THURSDAY = 4,
44 FRIDAY = 5,
45 SATURDAY = 6
46}
47export declare enum Month {
48 JANUARY = 1,
49 FEBRUARY = 2,
50 MARCH = 3,
51 APRIL = 4,
52 MAY = 5,
53 JUNE = 6,
54 JULY = 7,
55 AUGUST = 8,
56 SEPTEMBER = 9,
57 OCTOBER = 10,
58 NOVEMBER = 11,
59 DECEMBER = 12
60}