@ebarooni/capacitor-calendar 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs.json CHANGED
@@ -12,7 +12,7 @@
12
12
  {
13
13
  "name": "options",
14
14
  "docs": "An object with the name of the permission",
15
- "type": "{ alias: 'readCalendar'; }"
15
+ "type": "{ alias: keyof CalendarPermissionStatus; }"
16
16
  }
17
17
  ],
18
18
  "returns": "Promise<{ result: PermissionState; }>",
@@ -71,7 +71,7 @@
71
71
  {
72
72
  "name": "options",
73
73
  "docs": "An object with the name of the permission",
74
- "type": "{ alias: 'readCalendar'; }"
74
+ "type": "{ alias: keyof CalendarPermissionStatus; }"
75
75
  }
76
76
  ],
77
77
  "returns": "Promise<{ result: PermissionState; }>",
@@ -125,27 +125,121 @@
125
125
  },
126
126
  {
127
127
  "name": "createEventWithPrompt",
128
- "signature": "() => Promise<{ result: CalendarEventActionResult; }>",
128
+ "signature": "() => Promise<{ eventCreated: boolean; }>",
129
129
  "parameters": [],
130
- "returns": "Promise<{ result: CalendarEventActionResult; }>",
130
+ "returns": "Promise<{ eventCreated: boolean; }>",
131
131
  "tags": [
132
132
  {
133
133
  "name": "method"
134
134
  },
135
135
  {
136
136
  "name": "returns",
137
- "text": ";{ result: CalendarEventActionResult }&gt;} – A promise that resolves with the result of the action."
137
+ "text": ";{ eventCreated: boolean }&gt;} – A promise that resolves with the result of the action."
138
138
  },
139
139
  {
140
140
  "name": "example",
141
- "text": "let result: CalendarEventActionResult;\nif (capacitor.getPlatform() === 'android') {\n const readCalendarStatus = this.requestPermission({ alias: 'readCalendar' }).result;\n if (readCalendarStatus === 'granted') {\n result = await this.createEventWithPrompt();\n } else {\n // handle the case when user rejects the permission\n }\n} else {\n result = await this.createEventWithPrompt();\n}"
141
+ "text": "let result: CalendarEventActionResult;\nif (capacitor.getPlatform() === 'android') {\n const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n if (readCalendarStatus === 'granted') {\n result = await this.createEventWithPrompt();\n } else {\n // handle the case when user rejects the permission\n }\n} else {\n result = await this.createEventWithPrompt();\n}"
142
142
  }
143
143
  ],
144
144
  "docs": "Creates an event in the calendar by using the native calendar.\nOn iOS opens a native sheet and on Android opens an intent.\nThis method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\nOn Android, the user has to authorize for read access.",
145
+ "complexTypes": [],
146
+ "slug": "createeventwithprompt"
147
+ },
148
+ {
149
+ "name": "selectCalendarsWithPrompt",
150
+ "signature": "(options: { displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; }) => Promise<{ result: Calendar[]; }>",
151
+ "parameters": [
152
+ {
153
+ "name": "options",
154
+ "docs": "- Options for customizing the display and selection styles of the calendar chooser.",
155
+ "type": "{ displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; }"
156
+ }
157
+ ],
158
+ "returns": "Promise<{ result: Calendar[]; }>",
159
+ "tags": [
160
+ {
161
+ "name": "method",
162
+ "text": "selectCalendarsWithPrompt"
163
+ },
164
+ {
165
+ "name": "param",
166
+ "text": "options - Options for customizing the display and selection styles of the calendar chooser."
167
+ },
168
+ {
169
+ "name": "async"
170
+ },
171
+ {
172
+ "name": "returns",
173
+ "text": "A promise that resolves with an array of selected calendars,\nwhere each calendar object contains an ID and a title."
174
+ },
175
+ {
176
+ "name": "example",
177
+ "text": "if (capacitor.getPlatform() === 'ios') {\n const selectedCalendars = await selectCalendarsWithPrompt();\n console.log(selectedCalendars); // [{ id: '1', title: 'Work Calendar' }]\n}"
178
+ }
179
+ ],
180
+ "docs": "Presents a prompt to the user to select calendars. This method is available only on iOS.",
145
181
  "complexTypes": [
146
- "CalendarEventActionResult"
182
+ "Calendar",
183
+ "CalendarChooserDisplayStyle",
184
+ "CalendarChooserSelectionStyle"
147
185
  ],
148
- "slug": "createeventwithprompt"
186
+ "slug": "selectcalendarswithprompt"
187
+ },
188
+ {
189
+ "name": "listCalendars",
190
+ "signature": "() => Promise<{ result: Calendar[]; }>",
191
+ "parameters": [],
192
+ "returns": "Promise<{ result: Calendar[]; }>",
193
+ "tags": [
194
+ {
195
+ "name": "async"
196
+ },
197
+ {
198
+ "name": "method",
199
+ "text": "listCalendars"
200
+ },
201
+ {
202
+ "name": "returns",
203
+ "text": "A promise that resolves with an array of calendars available on the device.\nEach calendar object in the array contains an ID and a title."
204
+ },
205
+ {
206
+ "name": "example",
207
+ "text": "const calendars = await listCalendars();\nconsole.log(calendars); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]"
208
+ }
209
+ ],
210
+ "docs": "Retrieves a list of calendars available on the device.",
211
+ "complexTypes": [
212
+ "Calendar"
213
+ ],
214
+ "slug": "listcalendars"
215
+ },
216
+ {
217
+ "name": "getDefaultCalendar",
218
+ "signature": "() => Promise<{ result: Calendar; }>",
219
+ "parameters": [],
220
+ "returns": "Promise<{ result: Calendar; }>",
221
+ "tags": [
222
+ {
223
+ "name": "async"
224
+ },
225
+ {
226
+ "name": "method",
227
+ "text": "getDefaultCalendar"
228
+ },
229
+ {
230
+ "name": "returns",
231
+ "text": "A promise that resolves with the default calendar set on the device.\nThe returned calendar object contains an ID and a title."
232
+ },
233
+ {
234
+ "name": "example",
235
+ "text": "const defaultCalendar = await getDefaultCalendar();\nconsole.log(defaultCalendar); // { id: '1', title: 'Default Calendar' }"
236
+ }
237
+ ],
238
+ "docs": "Retrieves the default calendar set on the device.",
239
+ "complexTypes": [
240
+ "Calendar"
241
+ ],
242
+ "slug": "getdefaultcalendar"
149
243
  }
150
244
  ],
151
245
  "properties": []
@@ -170,32 +264,85 @@
170
264
  "PermissionState"
171
265
  ],
172
266
  "type": "PermissionState"
267
+ },
268
+ {
269
+ "name": "writeCalendar",
270
+ "tags": [],
271
+ "docs": "",
272
+ "complexTypes": [
273
+ "PermissionState"
274
+ ],
275
+ "type": "PermissionState"
276
+ }
277
+ ]
278
+ },
279
+ {
280
+ "name": "Calendar",
281
+ "slug": "calendar",
282
+ "docs": "Represents a calendar object with an ID and title.",
283
+ "tags": [
284
+ {
285
+ "text": "Calendar",
286
+ "name": "interface"
287
+ },
288
+ {
289
+ "text": "{string} id - The unique identifier of the calendar.",
290
+ "name": "property"
291
+ },
292
+ {
293
+ "text": "{string} title - The title or name of the calendar.",
294
+ "name": "property"
295
+ }
296
+ ],
297
+ "methods": [],
298
+ "properties": [
299
+ {
300
+ "name": "id",
301
+ "tags": [],
302
+ "docs": "",
303
+ "complexTypes": [],
304
+ "type": "string"
305
+ },
306
+ {
307
+ "name": "title",
308
+ "tags": [],
309
+ "docs": "",
310
+ "complexTypes": [],
311
+ "type": "string"
173
312
  }
174
313
  ]
175
314
  }
176
315
  ],
177
316
  "enums": [
178
317
  {
179
- "name": "CalendarEventActionResult",
180
- "slug": "calendareventactionresult",
318
+ "name": "CalendarChooserDisplayStyle",
319
+ "slug": "calendarchooserdisplaystyle",
181
320
  "members": [
182
321
  {
183
- "name": "Saved",
184
- "value": "'saved'",
322
+ "name": "ALL_CALENDARS",
185
323
  "tags": [],
186
- "docs": ""
324
+ "docs": "Display all calendars available for selection."
187
325
  },
188
326
  {
189
- "name": "Canceled",
190
- "value": "'canceled'",
327
+ "name": "WRITABLE_CALENDARS_ONLY",
328
+ "tags": [],
329
+ "docs": "Display only writable calendars available for selection."
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "name": "CalendarChooserSelectionStyle",
335
+ "slug": "calendarchooserselectionstyle",
336
+ "members": [
337
+ {
338
+ "name": "SINGLE",
191
339
  "tags": [],
192
- "docs": ""
340
+ "docs": "Allows only a single selection in the calendar chooser."
193
341
  },
194
342
  {
195
- "name": "Error",
196
- "value": "'error'",
343
+ "name": "MULTIPLE",
197
344
  "tags": [],
198
- "docs": ""
345
+ "docs": "Allows multiple selections in the calendar chooser."
199
346
  }
200
347
  ]
201
348
  }
@@ -1,15 +1,43 @@
1
1
  import type { PermissionState } from '@capacitor/core';
2
2
  /**
3
- * Enum for the possible results of actions performed on a calendar event.
4
- * "saved" for completion of an operation. "Canceled" for a canceled process and "error"
5
- * for when something went wrong.
6
- *
3
+ * Enum representing the selection style for the calendar chooser.
4
+ * @readonly
5
+ * @enum
6
+ */
7
+ export declare enum CalendarChooserSelectionStyle {
8
+ /**
9
+ * Allows only a single selection in the calendar chooser.
10
+ */
11
+ SINGLE = 0,
12
+ /**
13
+ * Allows multiple selections in the calendar chooser.
14
+ */
15
+ MULTIPLE = 1
16
+ }
17
+ /**
18
+ * Enum representing the display styles for the calendar chooser.
7
19
  * @enum
8
20
  */
9
- export declare enum CalendarEventActionResult {
10
- Saved = "saved",
11
- Canceled = "canceled",
12
- Error = "error"
21
+ export declare enum CalendarChooserDisplayStyle {
22
+ /**
23
+ * Display all calendars available for selection.
24
+ */
25
+ ALL_CALENDARS = 0,
26
+ /**
27
+ * Display only writable calendars available for selection.
28
+ */
29
+ WRITABLE_CALENDARS_ONLY = 1
30
+ }
31
+ /**
32
+ * Represents a calendar object with an ID and title.
33
+ *
34
+ * @interface Calendar
35
+ * @property {string} id - The unique identifier of the calendar.
36
+ * @property {string} title - The title or name of the calendar.
37
+ */
38
+ export interface Calendar {
39
+ id: string;
40
+ title: string;
13
41
  }
14
42
  /**
15
43
  * Describes the permission status for reading from the calendar.
@@ -18,6 +46,7 @@ export declare enum CalendarEventActionResult {
18
46
  */
19
47
  export interface CalendarPermissionStatus {
20
48
  readCalendar: PermissionState;
49
+ writeCalendar: PermissionState;
21
50
  }
22
51
  export interface CapacitorCalendarPlugin {
23
52
  /**
@@ -74,11 +103,11 @@ export interface CapacitorCalendarPlugin {
74
103
  * On Android, the user has to authorize for read access.
75
104
  *
76
105
  * @method
77
- * @returns {Promise&lt;{ result: CalendarEventActionResult }&gt;} – A promise that resolves with the result of the action.
106
+ * @returns {Promise&lt;{ eventCreated: boolean }&gt;} – A promise that resolves with the result of the action.
78
107
  * @example
79
108
  * let result: CalendarEventActionResult;
80
109
  * if (capacitor.getPlatform() === 'android') {
81
- * const readCalendarStatus = this.requestPermission({ alias: 'readCalendar' }).result;
110
+ * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;
82
111
  * if (readCalendarStatus === 'granted') {
83
112
  * result = await this.createEventWithPrompt();
84
113
  * } else {
@@ -89,6 +118,54 @@ export interface CapacitorCalendarPlugin {
89
118
  * }
90
119
  */
91
120
  createEventWithPrompt(): Promise<{
92
- result: CalendarEventActionResult;
121
+ eventCreated: boolean;
122
+ }>;
123
+ /**
124
+ * Presents a prompt to the user to select calendars. This method is available only on iOS.
125
+ *
126
+ * @method selectCalendarsWithPrompt
127
+ * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.
128
+ * @async
129
+ * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,
130
+ * where each calendar object contains an ID and a title.
131
+ * @example
132
+ * if (capacitor.getPlatform() === 'ios') {
133
+ * const selectedCalendars = await selectCalendarsWithPrompt();
134
+ * console.log(selectedCalendars); // [{ id: '1', title: 'Work Calendar' }]
135
+ * }
136
+ */
137
+ selectCalendarsWithPrompt(options: {
138
+ displayStyle: CalendarChooserDisplayStyle;
139
+ selectionStyle: CalendarChooserSelectionStyle;
140
+ }): Promise<{
141
+ result: Calendar[];
142
+ }>;
143
+ /**
144
+ * Retrieves a list of calendars available on the device.
145
+ *
146
+ * @async
147
+ * @method listCalendars
148
+ * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.
149
+ * Each calendar object in the array contains an ID and a title.
150
+ * @example
151
+ * const calendars = await listCalendars();
152
+ * console.log(calendars); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]
153
+ */
154
+ listCalendars(): Promise<{
155
+ result: Calendar[];
156
+ }>;
157
+ /**
158
+ * Retrieves the default calendar set on the device.
159
+ *
160
+ * @async
161
+ * @method getDefaultCalendar
162
+ * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.
163
+ * The returned calendar object contains an ID and a title.
164
+ * @example
165
+ * const defaultCalendar = await getDefaultCalendar();
166
+ * console.log(defaultCalendar); // { id: '1', title: 'Default Calendar' }
167
+ */
168
+ getDefaultCalendar(): Promise<{
169
+ result: Calendar;
93
170
  }>;
94
171
  }
@@ -1,14 +1,32 @@
1
1
  /**
2
- * Enum for the possible results of actions performed on a calendar event.
3
- * "saved" for completion of an operation. "Canceled" for a canceled process and "error"
4
- * for when something went wrong.
5
- *
2
+ * Enum representing the selection style for the calendar chooser.
3
+ * @readonly
6
4
  * @enum
7
5
  */
8
- export var CalendarEventActionResult;
9
- (function (CalendarEventActionResult) {
10
- CalendarEventActionResult["Saved"] = "saved";
11
- CalendarEventActionResult["Canceled"] = "canceled";
12
- CalendarEventActionResult["Error"] = "error";
13
- })(CalendarEventActionResult || (CalendarEventActionResult = {}));
6
+ export var CalendarChooserSelectionStyle;
7
+ (function (CalendarChooserSelectionStyle) {
8
+ /**
9
+ * Allows only a single selection in the calendar chooser.
10
+ */
11
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["SINGLE"] = 0] = "SINGLE";
12
+ /**
13
+ * Allows multiple selections in the calendar chooser.
14
+ */
15
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
16
+ })(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));
17
+ /**
18
+ * Enum representing the display styles for the calendar chooser.
19
+ * @enum
20
+ */
21
+ export var CalendarChooserDisplayStyle;
22
+ (function (CalendarChooserDisplayStyle) {
23
+ /**
24
+ * Display all calendars available for selection.
25
+ */
26
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
27
+ /**
28
+ * Display only writable calendars available for selection.
29
+ */
30
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
31
+ })(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));
14
32
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,4CAAe,CAAA;IACf,kDAAqB,CAAA;IACrB,4CAAe,CAAA;AACjB,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Enum for the possible results of actions performed on a calendar event.\n * \"saved\" for completion of an operation. \"Canceled\" for a canceled process and \"error\"\n * for when something went wrong.\n *\n * @enum\n */\nexport enum CalendarEventActionResult {\n Saved = 'saved',\n Canceled = 'canceled',\n Error = 'error'\n}\n\n/**\n * Describes the permission status for reading from the calendar.\n *\n * @interface\n */\nexport interface CalendarPermissionStatus {\n readCalendar: PermissionState;\n}\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the current status of the requested permission.\n * @example\n * const status = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Requests authorization to a specific permission, if not already granted.\n * If the permission is already granted, it will directly return the status.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the new permission status after the request is made.\n * @example\n * const result = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Requests authorization to all the required permissions for the plugin, if they have not already been granted.\n *\n * @method\n * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @returns {Promise&lt;{ result: CalendarEventActionResult }&gt;} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = this.requestPermission({ alias: 'readCalendar' }).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ result: CalendarEventActionResult }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAN,IAAY,6BAUX;AAVD,WAAY,6BAA6B;IACvC;;OAEG;IACH,qFAAM,CAAA;IAEN;;OAEG;IACH,yFAAQ,CAAA;AACV,CAAC,EAVW,6BAA6B,KAA7B,6BAA6B,QAUxC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAUX;AAVD,WAAY,2BAA2B;IACrC;;OAEG;IACH,+FAAa,CAAA;IAEb;;OAEG;IACH,mHAAuB,CAAA;AACzB,CAAC,EAVW,2BAA2B,KAA3B,2BAA2B,QAUtC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport enum CalendarChooserSelectionStyle {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n SINGLE,\n\n /**\n * Allows multiple selections in the calendar chooser.\n */\n MULTIPLE\n}\n\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport enum CalendarChooserDisplayStyle {\n /**\n * Display all calendars available for selection.\n */\n ALL_CALENDARS,\n\n /**\n * Display only writable calendars available for selection.\n */\n WRITABLE_CALENDARS_ONLY\n}\n\n/**\n * Represents a calendar object with an ID and title.\n *\n * @interface Calendar\n * @property {string} id - The unique identifier of the calendar.\n * @property {string} title - The title or name of the calendar.\n */\nexport interface Calendar {\n id: string;\n title: string;\n}\n\n/**\n * Describes the permission status for reading from the calendar.\n *\n * @interface\n */\nexport interface CalendarPermissionStatus {\n readCalendar: PermissionState;\n writeCalendar: PermissionState;\n}\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the current status of the requested permission.\n * @example\n * const status = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Requests authorization to a specific permission, if not already granted.\n * If the permission is already granted, it will directly return the status.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the new permission status after the request is made.\n * @example\n * const result = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Requests authorization to all the required permissions for the plugin, if they have not already been granted.\n *\n * @method\n * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @returns {Promise&lt;{ eventCreated: boolean }&gt;} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const selectedCalendars = await selectCalendarsWithPrompt();\n * console.log(selectedCalendars); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle,\n selectionStyle: CalendarChooserSelectionStyle\n }): Promise<{ result: Calendar[] }>\n\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.\n * Each calendar object in the array contains an ID and a title.\n * @example\n * const calendars = await listCalendars();\n * console.log(calendars); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]\n */\n listCalendars(): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves the default calendar set on the device.\n *\n * @async\n * @method getDefaultCalendar\n * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title.\n * @example\n * const defaultCalendar = await getDefaultCalendar();\n * console.log(defaultCalendar); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PermissionState, WebPlugin } from '@capacitor/core';
2
- import { CapacitorCalendarPlugin, CalendarEventActionResult, CalendarPermissionStatus } from './definitions';
2
+ import { CapacitorCalendarPlugin, CalendarPermissionStatus, Calendar } from './definitions';
3
3
  export declare class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {
4
4
  checkPermission(_options: {
5
5
  alias: keyof CalendarPermissionStatus;
@@ -14,6 +14,15 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
14
14
  }>;
15
15
  requestAllPermissions(): Promise<CalendarPermissionStatus>;
16
16
  createEventWithPrompt(): Promise<{
17
- result: CalendarEventActionResult;
17
+ eventCreated: boolean;
18
+ }>;
19
+ selectCalendarsWithPrompt(): Promise<{
20
+ result: Calendar[];
21
+ }>;
22
+ listCalendars(): Promise<{
23
+ result: Calendar[];
24
+ }>;
25
+ getDefaultCalendar(): Promise<{
26
+ result: Calendar;
18
27
  }>;
19
28
  }
package/dist/esm/web.js CHANGED
@@ -15,5 +15,14 @@ export class CapacitorCalendarWeb extends WebPlugin {
15
15
  createEventWithPrompt() {
16
16
  throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
17
17
  }
18
+ selectCalendarsWithPrompt() {
19
+ throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
20
+ }
21
+ listCalendars() {
22
+ throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);
23
+ }
24
+ getDefaultCalendar() {
25
+ throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
26
+ }
18
27
  }
19
28
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI3D,MAAM,OAAO,oBACT,SAAQ,SAAS;IAGV,eAAe,CAAC,QAAmD;QACtE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAA;IAC1F,CAAC;IAEM,mBAAmB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC/F,CAAC;IAEM,iBAAiB,CAAC,QAAmD;QACxE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;CACJ","sourcesContent":["import {PermissionState, WebPlugin} from '@capacitor/core';\n\nimport {CapacitorCalendarPlugin, CalendarEventActionResult, CalendarPermissionStatus} from './definitions';\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`)\n }\n\n public checkAllPermissions(): Promise<CalendarPermissionStatus> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<CalendarPermissionStatus> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(): Promise<{ result: CalendarEventActionResult}> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI3D,MAAM,OAAO,oBACT,SAAQ,SAAS;IAGV,eAAe,CAAC,QAAmD;QACtE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAA;IAC1F,CAAC;IAEM,mBAAmB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC/F,CAAC;IAEM,iBAAiB,CAAC,QAAmD;QACxE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,yBAAyB;QAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAED,aAAa;QACT,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACzF,CAAC;IAED,kBAAkB;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC9F,CAAC;CACJ","sourcesContent":["import {PermissionState, WebPlugin} from '@capacitor/core';\n\nimport {CapacitorCalendarPlugin, CalendarPermissionStatus, Calendar} from './definitions';\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`)\n }\n\n public checkAllPermissions(): Promise<CalendarPermissionStatus> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<CalendarPermissionStatus> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(): Promise<{ eventCreated: boolean}> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n\n getDefaultCalendar(): Promise<{ result: Calendar }> {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n}\n"]}
@@ -5,18 +5,36 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var core = require('@capacitor/core');
6
6
 
7
7
  /**
8
- * Enum for the possible results of actions performed on a calendar event.
9
- * "saved" for completion of an operation. "Canceled" for a canceled process and "error"
10
- * for when something went wrong.
11
- *
8
+ * Enum representing the selection style for the calendar chooser.
9
+ * @readonly
12
10
  * @enum
13
11
  */
14
- exports.CalendarEventActionResult = void 0;
15
- (function (CalendarEventActionResult) {
16
- CalendarEventActionResult["Saved"] = "saved";
17
- CalendarEventActionResult["Canceled"] = "canceled";
18
- CalendarEventActionResult["Error"] = "error";
19
- })(exports.CalendarEventActionResult || (exports.CalendarEventActionResult = {}));
12
+ exports.CalendarChooserSelectionStyle = void 0;
13
+ (function (CalendarChooserSelectionStyle) {
14
+ /**
15
+ * Allows only a single selection in the calendar chooser.
16
+ */
17
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["SINGLE"] = 0] = "SINGLE";
18
+ /**
19
+ * Allows multiple selections in the calendar chooser.
20
+ */
21
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
22
+ })(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
23
+ /**
24
+ * Enum representing the display styles for the calendar chooser.
25
+ * @enum
26
+ */
27
+ exports.CalendarChooserDisplayStyle = void 0;
28
+ (function (CalendarChooserDisplayStyle) {
29
+ /**
30
+ * Display all calendars available for selection.
31
+ */
32
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
33
+ /**
34
+ * Display only writable calendars available for selection.
35
+ */
36
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
37
+ })(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {}));
20
38
 
21
39
  const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', {
22
40
  web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorCalendarWeb()),
@@ -38,6 +56,15 @@ class CapacitorCalendarWeb extends core.WebPlugin {
38
56
  createEventWithPrompt() {
39
57
  throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
40
58
  }
59
+ selectCalendarsWithPrompt() {
60
+ throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
61
+ }
62
+ listCalendars() {
63
+ throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);
64
+ }
65
+ getDefaultCalendar() {
66
+ throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
67
+ }
41
68
  }
42
69
 
43
70
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum for the possible results of actions performed on a calendar event.\n * \"saved\" for completion of an operation. \"Canceled\" for a canceled process and \"error\"\n * for when something went wrong.\n *\n * @enum\n */\nexport var CalendarEventActionResult;\n(function (CalendarEventActionResult) {\n CalendarEventActionResult[\"Saved\"] = \"saved\";\n CalendarEventActionResult[\"Canceled\"] = \"canceled\";\n CalendarEventActionResult[\"Error\"] = \"error\";\n})(CalendarEventActionResult || (CalendarEventActionResult = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorCalendar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarEventActionResult","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACWA,2CAA0B;AACrC,CAAC,UAAU,yBAAyB,EAAE;AACtC,IAAI,yBAAyB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACjD,IAAI,yBAAyB,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;AACvD,IAAI,yBAAyB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AACjD,CAAC,EAAEA,iCAAyB,KAAKA,iCAAyB,GAAG,EAAE,CAAC,CAAC;;ACX5D,MAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;AACpD,IAAI,eAAe,CAAC,QAAQ,EAAE;AAC9B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC/F,KAAK;AACL,IAAI,mBAAmB,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACnG,KAAK;AACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACjG,KAAK;AACL,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorCalendar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserSelectionStyle","CalendarChooserDisplayStyle","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACWA,+CAA8B;AACzC,CAAC,UAAU,6BAA6B,EAAE;AAC1C;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1F;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC,CAAC;AAC1E;AACA;AACA;AACA;AACWC,6CAA4B;AACvC,CAAC,UAAU,2BAA2B,EAAE;AACxC;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;AACpG;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;AACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;AC7BhE,MAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;AACpD,IAAI,eAAe,CAAC,QAAQ,EAAE;AAC9B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC/F,KAAK;AACL,IAAI,mBAAmB,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACnG,KAAK;AACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACjG,KAAK;AACL,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL,IAAI,qBAAqB,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL,IAAI,yBAAyB,GAAG;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC7F,KAAK;AACL,IAAI,kBAAkB,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAClG,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -2,18 +2,36 @@ var capacitorCapacitorCalendar = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
4
  /**
5
- * Enum for the possible results of actions performed on a calendar event.
6
- * "saved" for completion of an operation. "Canceled" for a canceled process and "error"
7
- * for when something went wrong.
8
- *
5
+ * Enum representing the selection style for the calendar chooser.
6
+ * @readonly
9
7
  * @enum
10
8
  */
11
- exports.CalendarEventActionResult = void 0;
12
- (function (CalendarEventActionResult) {
13
- CalendarEventActionResult["Saved"] = "saved";
14
- CalendarEventActionResult["Canceled"] = "canceled";
15
- CalendarEventActionResult["Error"] = "error";
16
- })(exports.CalendarEventActionResult || (exports.CalendarEventActionResult = {}));
9
+ exports.CalendarChooserSelectionStyle = void 0;
10
+ (function (CalendarChooserSelectionStyle) {
11
+ /**
12
+ * Allows only a single selection in the calendar chooser.
13
+ */
14
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["SINGLE"] = 0] = "SINGLE";
15
+ /**
16
+ * Allows multiple selections in the calendar chooser.
17
+ */
18
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
19
+ })(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
20
+ /**
21
+ * Enum representing the display styles for the calendar chooser.
22
+ * @enum
23
+ */
24
+ exports.CalendarChooserDisplayStyle = void 0;
25
+ (function (CalendarChooserDisplayStyle) {
26
+ /**
27
+ * Display all calendars available for selection.
28
+ */
29
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
30
+ /**
31
+ * Display only writable calendars available for selection.
32
+ */
33
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
34
+ })(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {}));
17
35
 
18
36
  const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', {
19
37
  web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorCalendarWeb()),
@@ -35,6 +53,15 @@ var capacitorCapacitorCalendar = (function (exports, core) {
35
53
  createEventWithPrompt() {
36
54
  throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
37
55
  }
56
+ selectCalendarsWithPrompt() {
57
+ throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
58
+ }
59
+ listCalendars() {
60
+ throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);
61
+ }
62
+ getDefaultCalendar() {
63
+ throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
64
+ }
38
65
  }
39
66
 
40
67
  var web = /*#__PURE__*/Object.freeze({