forked from vonovak/react-native-add-calendar-event
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
107 lines (94 loc) · 2.6 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
declare module "react-native-add-calendar-event" {
interface NavigationBarIOS {
tintColor: string;
barTintColor: string;
backgroundColor: string;
translucent: boolean;
titleColor: string;
}
interface CreateOptions {
title?: string;
/**
* in UTC, format: 'YYYY-MM-DDTHH:mm:ss.SSSZ'
*/
startDate?: string;
/**
* in UTC, format: 'YYYY-MM-DDTHH:mm:ss.SSSZ'
*/
endDate?: string;
location?: string;
allDay?: boolean;
/**
* iOS only
*/
url?: string;
/**
* The notes (iOS) or description (Android) associated with the event.
*/
notes?: string;
navigationBarIOS?: NavigationBarIOS;
}
/**
* These are two different identifiers on iOS.
* On Android, where they are both equal and represent the event id, also strings.
*/
interface SuccessAction {
action: "SAVED";
calendarItemIdentifier: string;
eventIdentifier: string;
}
interface CancelAction {
action: "CANCELED";
}
interface DeletedAction {
action: "DELETED";
}
interface DoneAction {
action: "DONE";
}
interface RespondedAction {
action: "RESPONDED";
}
type CreateResult = SuccessAction | CancelAction;
interface EditOptions {
/**
* Id of edited event.
*/
eventId: string;
/**
* `ACTION_EDIT` should work for editing events but this doesn't always seem to be the case.
* This option leaves the choice up to you. By default, the module will use `ACTION_VIEW` which will only
* show the event, but from there it is easy for the user to tap the edit button and make changes.
*/
useEditIntent?: boolean;
navigationBarIOS?: NavigationBarIOS;
}
type EditResult = SuccessAction | CancelAction | DeletedAction;
interface ViewOptions {
/**
* Id of edited event.
*/
eventId: string;
/**
* iOS only
* https://developer.apple.com/documentation/eventkitui/ekeventviewcontroller/1613964-allowsediting?language=objc
*/
allowsEditing?: boolean;
/**
* iOS only
* https://developer.apple.com/documentation/eventkitui/ekeventviewcontroller/1613956-allowscalendarpreview?language=objc
*/
allowsCalendarPreview?: boolean;
navigationBarIOS?: NavigationBarIOS;
}
type ViewResult = DoneAction | RespondedAction | DeletedAction;
export function presentEventCreatingDialog(
options: CreateOptions
): Promise<CreateResult>;
export function presentEventEditingDialog(
options: EditOptions
): Promise<EditResult>;
export function presentEventViewingDialog(
options: ViewOptions
): Promise<ViewResult>;
}