6 } from '../../calendar/constants';
18 export type VcalDaysKeys = keyof typeof VcalDays;
20 export interface VcalDateValue {
26 export interface VcalDateTimeValue {
36 export type VcalDateOrDateTimeValue = VcalDateValue | VcalDateTimeValue;
38 export interface VcalDateTimeProperty {
43 value: VcalDateTimeValue;
46 export interface VcalDateProperty {
53 export interface VcalFloatingDateTimeProperty {
57 value: VcalDateTimeValue;
60 export interface IcalJSDateOrDateTimeProperty {
62 type?: 'date' | 'date-time';
65 value: VcalDateValue | VcalDateTimeValue;
68 export type VcalDateOrDateTimeProperty = VcalDateProperty | VcalDateTimeProperty;
70 export type VcalRruleFreqValue = 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' | undefined | string;
71 export interface VcalRrulePropertyValue {
72 freq: VcalRruleFreqValue;
75 until?: VcalDateOrDateTimeValue;
76 bysetpos?: number | number[];
77 byday?: string | string[];
78 bymonthday?: number | number[];
79 bymonth?: number | number[];
80 bysecond?: number | number[];
81 byminute?: number | number[];
82 byhour?: number | number[];
83 byyearday?: number | number[];
84 byweekno?: number | number[];
88 export interface VcalRruleProperty {
89 value: VcalRrulePropertyValue;
92 export interface VcalDurationValue {
101 export interface VcalTriggerRelativeProperty {
102 value: VcalDurationValue;
109 export type VcalTriggerProperty = VcalTriggerRelativeProperty | VcalDateTimeProperty;
111 export interface VcalUidProperty {
115 export interface VcalStringProperty {
119 export interface VcalStringProperyWithParams {
121 parameters: { [key: string]: string };
124 export interface VcalNumberProperty {
128 export interface VcalBooleanProperty {
129 value: 'true' | 'false';
130 parameters: { type: 'boolean' };
133 export interface VcalStringArrayProperty {
137 export interface VcalNumberArrayProperty {
141 interface VcalDurationProperty {
142 value: VcalDurationValue;
145 interface VcalURIProperty {
147 params: { type: 'uri' };
150 interface VcalBinaryProperty {
158 type VcalImageProperty = VcalURIProperty | VcalBinaryProperty;
160 export interface VcalValarmComponent<T = VcalTriggerProperty> {
162 action: VcalStringProperty;
164 duration?: VcalDurationProperty;
165 repeat?: VcalStringProperty;
166 description?: VcalStringProperty;
167 summary?: VcalStringProperty;
168 attendee?: VcalAttendeeProperty[];
169 attach?: VcalStringProperty;
172 export type VcalValarmRelativeComponent = VcalValarmComponent<VcalTriggerRelativeProperty>;
174 export type VcalValarmAbsoluteComponent = VcalValarmComponent<VcalDateTimeProperty>;
176 export interface VcalStringWithParamsProperty {
178 params?: { [key: string]: string };
181 export interface VcalOrganizerPropertyParameters {
189 export interface VcalOrganizerProperty {
191 parameters?: VcalOrganizerPropertyParameters;
194 export interface VcalStatusProperty {
195 value: ICAL_EVENT_STATUS | string;
198 export interface VcalDescriptionPropertyParameters {
203 export interface VcalDescriptionProperty {
205 parameters?: VcalDescriptionPropertyParameters;
208 export interface VcalAttendeePropertyParameters extends VcalOrganizerPropertyParameters {
212 role?: ICAL_ATTENDEE_ROLE | string;
213 partstat?: ICAL_ATTENDEE_STATUS | string;
214 rsvp?: ICAL_ATTENDEE_RSVP | string;
215 'delegated-from'?: string;
216 'delegated-to'?: string;
217 'x-pm-token'?: string;
220 export interface VcalAttendeeProperty {
222 parameters?: VcalAttendeePropertyParameters;
225 export interface VcalAttendeePropertyWithCn extends VcalAttendeeProperty {
226 parameters: VcalAttendeePropertyParameters & Required<Pick<VcalAttendeePropertyParameters, 'cn'>>;
229 export interface VcalAttendeePropertyWithPartstat extends VcalAttendeeProperty {
230 parameters: VcalAttendeePropertyParameters & Required<Pick<VcalAttendeePropertyParameters, 'partstat'>>;
233 export interface VcalAttendeePropertyWithRole extends VcalAttendeeProperty {
234 parameters: VcalAttendeePropertyParameters & Required<Pick<VcalAttendeePropertyParameters, 'role'>>;
237 export interface VcalAttendeePropertyWithToken extends VcalAttendeeProperty {
238 parameters: VcalAttendeePropertyParameters & Required<Pick<VcalAttendeePropertyParameters, 'x-pm-token'>>;
241 export type VcalPmAttendee = VcalAttendeePropertyWithCn & VcalAttendeePropertyWithToken;
243 export interface VcalCategoryProperty {
247 export interface VcalVeventComponent {
249 components?: VcalValarmComponent[]; // Not complete. Can be other components.
250 uid: VcalUidProperty;
251 dtstamp: VcalDateTimeProperty;
252 dtstart: VcalDateOrDateTimeProperty;
253 dtend?: VcalDateOrDateTimeProperty;
254 rrule?: VcalRruleProperty;
255 'recurrence-id'?: VcalDateOrDateTimeProperty;
256 exdate?: VcalDateOrDateTimeProperty[];
257 organizer?: VcalOrganizerProperty;
258 attendee?: VcalAttendeeProperty[];
259 description?: VcalDescriptionProperty;
260 summary?: VcalStringProperty;
261 duration?: VcalDurationProperty;
262 location?: VcalDescriptionProperty;
263 geo?: VcalNumberArrayProperty;
264 class?: VcalStringProperty;
265 priority?: VcalNumberProperty;
266 sequence?: VcalNumberProperty;
267 status?: VcalStatusProperty;
268 created?: VcalDateTimeProperty;
269 'last-modified'?: VcalDateTimeProperty;
270 transp?: VcalStringProperty;
271 url?: VcalStringProperty;
272 attach?: VcalStringWithParamsProperty[];
273 categories?: VcalCategoryProperty[];
274 comment?: VcalStringWithParamsProperty[];
275 contact?: VcalStringWithParamsProperty[];
276 'request-status'?: VcalStringArrayProperty[];
277 'related-to'?: VcalStringWithParamsProperty[];
278 resources?: VcalStringWithParamsProperty[];
279 rdate?: VcalDateTimeProperty[];
280 'x-pm-proton-reply'?: VcalBooleanProperty;
281 'x-pm-session-key'?: VcalStringProperty;
282 'x-pm-shared-event-id'?: VcalStringProperty;
283 'x-yahoo-yid'?: VcalStringProperty;
284 'x-yahoo-user-status'?: VcalStringProperty;
285 'x-pm-conference-id'?: VcalStringProperyWithParams;
286 'x-pm-conference-url'?: VcalStringProperyWithParams;
287 color?: VcalStringProperty;
290 export type VcalComponentKeys = keyof VcalVeventComponent;
292 export interface VcalPmVeventComponent extends Omit<VcalVeventComponent, 'attendee'> {
293 attendee?: VcalAttendeePropertyWithToken[];
296 export interface VcalVtodoComponent {
298 components?: VcalValarmComponent[]; // Not complete. Can be other components.
299 uid: VcalUidProperty;
302 export interface VcalVjournalComponent {
303 component: 'vjournal';
304 components?: VcalValarmComponent[]; // Not complete. Can be other components.
305 uid: VcalUidProperty;
308 export interface VcalFreeBusyStartEndValue {
309 start: VcalDateTimeValue;
310 end: VcalDateTimeValue;
313 export interface VcalFreeBusyStartDurationValue {
314 start: VcalDateTimeValue;
315 duration: VcalDurationValue;
318 type VcalFreeBusyValue = VcalFreeBusyStartEndValue | VcalFreeBusyStartDurationValue;
320 export interface VcalFreeBusyProperty {
321 value: VcalFreeBusyValue[];
324 export interface VcalVfreebusyComponent {
325 component: 'vfreebusy';
326 components?: VcalValarmComponent[]; // Not complete. Can be other components.
327 uid: VcalUidProperty;
328 dtstamp: VcalDateTimeProperty;
329 dtstart?: VcalDateOrDateTimeProperty;
330 dtend?: VcalDateOrDateTimeProperty;
331 organizer?: VcalOrganizerProperty;
332 attendee?: VcalAttendeeProperty[];
333 freebusy?: VcalFreeBusyProperty[];
334 url?: VcalStringProperty;
335 comment?: VcalStringProperty[];
338 export interface VcalVtimezoneComponent {
339 component: 'vtimezone';
340 tzid: VcalStringProperty;
343 export interface VcalXOrIanaComponent {
347 export type VcalCalendarComponent =
348 | VcalVeventComponent
350 | VcalVjournalComponent
351 | VcalVfreebusyComponent
352 | VcalVtimezoneComponent
353 | VcalXOrIanaComponent
356 export interface VcalErrorComponent {
361 export interface VcalVcalendar {
364 | VcalVeventComponent
366 | VcalVjournalComponent
367 | VcalVfreebusyComponent
368 | VcalVtimezoneComponent
369 | VcalXOrIanaComponent
371 prodid: VcalStringProperty;
372 version: VcalStringProperty;
373 calscale?: VcalStringProperty;
374 method?: VcalStringProperty;
375 'x-wr-timezone'?: VcalStringProperty;
376 'x-wr-calname'?: VcalStringProperty;
378 name?: VcalStringProperty;
379 description?: VcalStringProperty;
380 uid?: VcalStringProperty;
381 url?: VcalStringProperty;
382 'last-modified'?: VcalDateTimeProperty;
383 categories?: VcalStringWithParamsProperty[];
384 'refresh-interval'?: VcalDurationProperty;
385 source?: VcalURIProperty;
386 color?: VcalStringProperty;
387 image?: VcalImageProperty;
388 conference?: VcalURIProperty;
391 export interface VcalVeventComponentWithMaybeErrors extends Omit<VcalVeventComponent, 'components'> {
392 components?: (VcalErrorComponent | VcalValarmComponent)[];
395 export interface VcalVtodoComponentWithMaybeErrors extends Omit<VcalVtodoComponent, 'components'> {
396 components?: (VcalErrorComponent | VcalValarmComponent)[];
399 export interface VcalVjournalComponentWithMaybeErrors extends Omit<VcalVjournalComponent, 'components'> {
400 components?: (VcalErrorComponent | VcalValarmComponent)[];
403 export interface VcalVfreebusyComponentWithMaybeErrors extends Omit<VcalVfreebusyComponent, 'components'> {
404 components?: (VcalErrorComponent | VcalValarmComponent)[];
407 export type VcalCalendarComponentWithMaybeErrors =
408 | VcalVeventComponentWithMaybeErrors
409 | VcalVtodoComponentWithMaybeErrors
410 | VcalVjournalComponentWithMaybeErrors
411 | VcalVfreebusyComponentWithMaybeErrors
412 | VcalVtimezoneComponent
413 | VcalXOrIanaComponent;
415 export interface VcalVcalendarWithMaybeErrors extends Omit<VcalVcalendar, 'components'> {
416 components?: (VcalCalendarComponentWithMaybeErrors | VcalErrorComponent)[];