UNPKG

1.81 kBTypeScriptView Raw
1import { Component, ParsedComponents, ParsedResult, ParsingReference } from "./index";
2import dayjs, { OpUnitType, QUnitType } from "dayjs";
3export declare class ReferenceWithTimezone {
4 readonly instant: Date;
5 readonly timezoneOffset?: number;
6 constructor(input?: ParsingReference | Date);
7}
8export declare class ParsingComponents implements ParsedComponents {
9 private knownValues;
10 private impliedValues;
11 private reference;
12 constructor(reference: ReferenceWithTimezone, knownComponents?: {
13 [c in Component]?: number;
14 });
15 get(component: Component): number | null;
16 isCertain(component: Component): boolean;
17 getCertainComponents(): Array<Component>;
18 imply(component: Component, value: number): ParsingComponents;
19 assign(component: Component, value: number): ParsingComponents;
20 delete(component: Component): void;
21 clone(): ParsingComponents;
22 isOnlyDate(): boolean;
23 isOnlyTime(): boolean;
24 isOnlyWeekdayComponent(): boolean;
25 isOnlyDayMonthComponent(): boolean;
26 isValidDate(): boolean;
27 toString(): string;
28 dayjs(): dayjs.Dayjs;
29 date(): Date;
30 private dateWithoutTimezoneAdjustment;
31 private getSystemTimezoneAdjustmentMinute;
32 static createRelativeFromReference(reference: ReferenceWithTimezone, fragments: {
33 [c in OpUnitType | QUnitType]?: number;
34 }): ParsingComponents;
35}
36export declare class ParsingResult implements ParsedResult {
37 refDate: Date;
38 index: number;
39 text: string;
40 reference: ReferenceWithTimezone;
41 start: ParsingComponents;
42 end?: ParsingComponents;
43 constructor(reference: ReferenceWithTimezone, index: number, text: string, start?: ParsingComponents, end?: ParsingComponents);
44 clone(): ParsingResult;
45 date(): Date;
46 toString(): string;
47}