-
Notifications
You must be signed in to change notification settings - Fork 154
/
index.d.ts
136 lines (109 loc) · 3.2 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
export type DateTime = DateArray | number | string;
export type DateArray =
| [number, number, number, number, number]
| [number, number, number, number]
| [number, number, number];
export type DurationObject = {
weeks?: number;
days?: number;
hours?: number;
minutes?: number;
seconds?: number;
before?: boolean;
};
export type GeoCoordinates = {
lat: number;
lon: number;
};
export type EventStatus = 'TENTATIVE' | 'CONFIRMED' | 'CANCELLED';
export type ParticipationStatus =
| 'NEEDS-ACTION'
| 'ACCEPTED'
| 'DECLINED'
| 'TENTATIVE'
| 'DELEGATED'
| 'COMPLETED'
| 'IN-PROCESS';
export type ParticipationRole =
| 'CHAIR'
| 'REQ-PARTICIPANT'
| 'OPT-PARTICIPANT'
| 'NON-PARTICIPANT';
export type ParticipationType =
| 'INDIVIDUAL'
| 'GROUP'
| 'RESOURCE'
| 'ROOM'
| 'UNKNOWN';
export type Person = {
name?: string;
email?: string;
dir?: string;
};
export type Attendee = Person & {
rsvp?: boolean;
partstat?: ParticipationStatus;
role?: ParticipationRole;
cutype?: ParticipationType;
xNumGuests?: number;
};
export type ActionType = 'audio' | 'display' | 'email' | 'procedure';
/**
* This property defines the access classification for a calendar component.
*/
export type classificationType = 'PUBLIC' | 'PRIVATE' | 'CONFIDENTIAL' | string;
export type Alarm = {
action?: ActionType;
description?: string;
summary?: string;
duration?: DurationObject;
trigger?: DurationObject | DateTime;
repeat?: number;
attachType?: string;
attach?: string;
};
export type HeaderAttributes = {
productId?: string;
method?: string;
calName?: string;
}
export type EventAttributes = {
start: DateTime;
startInputType?: 'local' | 'utc';
startOutputType?: 'local' | 'utc';
endInputType?: 'local' | 'utc';
endOutputType?: 'local' | 'utc';
title?: string;
description?: string;
location?: string;
geo?: GeoCoordinates;
url?: string;
status?: EventStatus;
busyStatus?: 'FREE' | 'BUSY' | 'TENTATIVE' | 'OOF';
transp?: 'TRANSPARENT' | 'OPAQUE';
organizer?: Person & {
sentBy?: string;
};
attendees?: Attendee[];
categories?: string[];
alarms?: Alarm[];
productId?: HeaderAttributes['productId'];
uid?: string;
method?: HeaderAttributes['method'];
recurrenceRule?: string;
exclusionDates?: DateTime[];
sequence?: number;
calName?: HeaderAttributes['calName'];
classification?: classificationType;
created?: DateTime;
lastModified?: DateTime;
htmlContent?: string;
} & ({ end: DateTime } | { duration: DurationObject });
export type ReturnObject = { error?: Error; value?: string };
type NodeCallback = (error: Error | undefined, value: string) => void;
export function createEvent(attributes: EventAttributes, callback: NodeCallback): void;
export function createEvent(attributes: EventAttributes): ReturnObject;
export function createEvents(events: EventAttributes[], callback: NodeCallback): void;
export function createEvents(events: EventAttributes[], headerAttributes?: HeaderAttributes): ReturnObject;
export function createEvents(events: EventAttributes[], headerAttributes: HeaderAttributes, callback: NodeCallback): void;
export function convertTimestampToArray(timestamp: Number, inputType: String): DateArray;