1 | import { DateAdapter } from './date-adapters/date-adapter/index';
|
2 | export declare enum DAYS_OF_WEEK {
|
3 | SUNDAY = 0,
|
4 | MONDAY = 1,
|
5 | TUESDAY = 2,
|
6 | WEDNESDAY = 3,
|
7 | THURSDAY = 4,
|
8 | FRIDAY = 5,
|
9 | SATURDAY = 6
|
10 | }
|
11 | export declare const SECONDS_IN_DAY: number;
|
12 | export interface WeekDay {
|
13 | date: Date;
|
14 | day: number;
|
15 | isPast: boolean;
|
16 | isToday: boolean;
|
17 | isFuture: boolean;
|
18 | isWeekend: boolean;
|
19 | cssClass?: string;
|
20 | }
|
21 | export interface EventColor {
|
22 | primary: string;
|
23 | secondary: string;
|
24 | secondaryText?: string;
|
25 | }
|
26 | export interface EventAction {
|
27 | id?: string | number;
|
28 | label: string;
|
29 | cssClass?: string;
|
30 | a11yLabel?: string;
|
31 | onClick({ event, sourceEvent, }: {
|
32 | event: CalendarEvent;
|
33 | sourceEvent: MouseEvent | KeyboardEvent;
|
34 | }): any;
|
35 | }
|
36 | export interface CalendarEvent<MetaType = any> {
|
37 | id?: string | number;
|
38 | start: Date;
|
39 | end?: Date;
|
40 | title: string;
|
41 | color?: EventColor;
|
42 | actions?: EventAction[];
|
43 | allDay?: boolean;
|
44 | cssClass?: string;
|
45 | resizable?: {
|
46 | beforeStart?: boolean;
|
47 | afterEnd?: boolean;
|
48 | };
|
49 | draggable?: boolean;
|
50 | meta?: MetaType;
|
51 | }
|
52 | export interface WeekViewAllDayEvent {
|
53 | event: CalendarEvent;
|
54 | offset: number;
|
55 | span: number;
|
56 | startsBeforeWeek: boolean;
|
57 | endsAfterWeek: boolean;
|
58 | }
|
59 | export interface WeekViewAllDayEventRow {
|
60 | id?: string;
|
61 | row: WeekViewAllDayEvent[];
|
62 | }
|
63 | export interface WeekView {
|
64 | period: ViewPeriod;
|
65 | allDayEventRows: WeekViewAllDayEventRow[];
|
66 | hourColumns: WeekViewHourColumn[];
|
67 | }
|
68 | export interface MonthViewDay<MetaType = any> extends WeekDay {
|
69 | inMonth: boolean;
|
70 | events: CalendarEvent[];
|
71 | backgroundColor?: string;
|
72 | badgeTotal: number;
|
73 | meta?: MetaType;
|
74 | }
|
75 | export interface MonthView {
|
76 | rowOffsets: number[];
|
77 | days: MonthViewDay[];
|
78 | totalDaysVisibleInWeek: number;
|
79 | period: ViewPeriod;
|
80 | }
|
81 | export interface WeekViewTimeEvent {
|
82 | event: CalendarEvent;
|
83 | height: number;
|
84 | width: number;
|
85 | top: number;
|
86 | left: number;
|
87 | startsBeforeDay: boolean;
|
88 | endsAfterDay: boolean;
|
89 | }
|
90 | export interface WeekViewHourSegment {
|
91 | isStart: boolean;
|
92 | date: Date;
|
93 | displayDate: Date;
|
94 | cssClass?: string;
|
95 | }
|
96 | export interface WeekViewHour {
|
97 | segments: WeekViewHourSegment[];
|
98 | }
|
99 | export interface WeekViewHourColumn {
|
100 | date: Date;
|
101 | hours: WeekViewHour[];
|
102 | events: WeekViewTimeEvent[];
|
103 | }
|
104 | export interface ViewPeriod {
|
105 | start: Date;
|
106 | end: Date;
|
107 | events: CalendarEvent[];
|
108 | }
|
109 | export interface GetEventsInPeriodArgs {
|
110 | events: CalendarEvent[];
|
111 | periodStart: Date;
|
112 | periodEnd: Date;
|
113 | }
|
114 | export declare function getEventsInPeriod(dateAdapter: DateAdapter, { events, periodStart, periodEnd }: GetEventsInPeriodArgs): CalendarEvent[];
|
115 | export interface GetWeekViewHeaderArgs {
|
116 | viewDate: Date;
|
117 | weekStartsOn: number;
|
118 | excluded?: number[];
|
119 | weekendDays?: number[];
|
120 | viewStart?: Date;
|
121 | viewEnd?: Date;
|
122 | }
|
123 | export declare function getWeekViewHeader(dateAdapter: DateAdapter, { viewDate, weekStartsOn, excluded, weekendDays, viewStart, viewEnd, }: GetWeekViewHeaderArgs): WeekDay[];
|
124 | export interface GetWeekViewArgs {
|
125 | events?: CalendarEvent[];
|
126 | viewDate: Date;
|
127 | weekStartsOn: number;
|
128 | excluded?: number[];
|
129 | precision?: 'minutes' | 'days';
|
130 | absolutePositionedEvents?: boolean;
|
131 | hourSegments?: number;
|
132 | hourDuration?: number;
|
133 | dayStart: Time;
|
134 | dayEnd: Time;
|
135 | weekendDays?: number[];
|
136 | segmentHeight: number;
|
137 | viewStart?: Date;
|
138 | viewEnd?: Date;
|
139 | minimumEventHeight?: number;
|
140 | }
|
141 | export declare function getDifferenceInDaysWithExclusions(dateAdapter: DateAdapter, { date1, date2, excluded }: {
|
142 | date1: Date;
|
143 | date2: Date;
|
144 | excluded: number[];
|
145 | }): number;
|
146 | interface GetAllDayEventArgs {
|
147 | precision?: 'days' | 'minutes';
|
148 | events?: CalendarEvent[];
|
149 | absolutePositionedEvents?: boolean;
|
150 | viewStart: Date;
|
151 | viewEnd: Date;
|
152 | excluded?: number[];
|
153 | }
|
154 | export declare function getAllDayWeekEvents(dateAdapter: DateAdapter, { events, excluded, precision, absolutePositionedEvents, viewStart, viewEnd, }: GetAllDayEventArgs): WeekViewAllDayEventRow[];
|
155 | export declare function getWeekView(dateAdapter: DateAdapter, { events, viewDate, weekStartsOn, excluded, precision, absolutePositionedEvents, hourSegments, hourDuration, dayStart, dayEnd, weekendDays, segmentHeight, minimumEventHeight, viewStart, viewEnd, }: GetWeekViewArgs): WeekView;
|
156 | export interface GetMonthViewArgs {
|
157 | events?: CalendarEvent[];
|
158 | viewDate: Date;
|
159 | weekStartsOn: number;
|
160 | excluded?: number[];
|
161 | viewStart?: Date;
|
162 | viewEnd?: Date;
|
163 | weekendDays?: number[];
|
164 | }
|
165 | export declare function getMonthView(dateAdapter: DateAdapter, { events, viewDate, weekStartsOn, excluded, viewStart, viewEnd, weekendDays, }: GetMonthViewArgs): MonthView;
|
166 | export interface GetDayViewArgs {
|
167 | events?: CalendarEvent[];
|
168 | viewDate: Date;
|
169 | hourSegments: number;
|
170 | dayStart: {
|
171 | hour: number;
|
172 | minute: number;
|
173 | };
|
174 | dayEnd: {
|
175 | hour: number;
|
176 | minute: number;
|
177 | };
|
178 | eventWidth: number;
|
179 | segmentHeight: number;
|
180 | hourDuration: number;
|
181 | minimumEventHeight: number;
|
182 | }
|
183 | interface Time {
|
184 | hour: number;
|
185 | minute: number;
|
186 | }
|
187 | export declare enum EventValidationErrorMessage {
|
188 | NotArray = "Events must be an array",
|
189 | StartPropertyMissing = "Event is missing the `start` property",
|
190 | StartPropertyNotDate = "Event `start` property should be a javascript date object. Do `new Date(event.start)` to fix it.",
|
191 | EndPropertyNotDate = "Event `end` property should be a javascript date object. Do `new Date(event.end)` to fix it.",
|
192 | EndsBeforeStart = "Event `start` property occurs after the `end`"
|
193 | }
|
194 | export declare function validateEvents(events: CalendarEvent[], log: (...args: any[]) => void): boolean;
|
195 | export {};
|