@ebarooni/capacitor-calendar 6.1.0 → 6.2.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/README.md +36 -18
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +15 -3
- package/dist/docs.json +96 -8
- package/dist/esm/definitions.d.ts +57 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +9 -0
- package/dist/esm/web.js +12 -6
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +12 -6
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +12 -6
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendar.swift +32 -5
- package/ios/Plugin/CapacitorCalendarPlugin.m +2 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +32 -1
- package/ios/Plugin/CapacitorCalendarPluginError.swift +3 -2
- package/ios/Plugin/UIColorExtensions.swift +28 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -36,8 +36,17 @@
|
|
|
36
36
|
|
|
37
37
|
## Install
|
|
38
38
|
|
|
39
|
+
### Capacitor 6
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install @ebarooni/capacitor-calendar@latest
|
|
43
|
+
npx cap sync
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Capacitor 5
|
|
47
|
+
|
|
39
48
|
```bash
|
|
40
|
-
npm install @ebarooni/capacitor-calendar
|
|
49
|
+
npm install @ebarooni/capacitor-calendar@^5
|
|
41
50
|
npx cap sync
|
|
42
51
|
```
|
|
43
52
|
|
|
@@ -62,28 +71,37 @@ permissions can be found below:
|
|
|
62
71
|
|
|
63
72
|
## 📋 API
|
|
64
73
|
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
<docgen-index>
|
|
75
|
+
|
|
76
|
+
* [`checkPermission(...)`](#checkpermission)
|
|
77
|
+
* [`checkAllPermissions()`](#checkallpermissions)
|
|
78
|
+
* [`requestPermission(...)`](#requestpermission)
|
|
79
|
+
* [`requestAllPermissions()`](#requestallpermissions)
|
|
80
|
+
* [`createEventWithPrompt(...)`](#createeventwithprompt)
|
|
81
|
+
* [`selectCalendarsWithPrompt(...)`](#selectcalendarswithprompt)
|
|
82
|
+
* [`listCalendars()`](#listcalendars)
|
|
83
|
+
* [`getDefaultCalendar()`](#getdefaultcalendar)
|
|
84
|
+
* [`createEvent(...)`](#createevent)
|
|
85
|
+
* [`getDefaultRemindersList()`](#getdefaultreminderslist)
|
|
86
|
+
* [`getRemindersLists()`](#getreminderslists)
|
|
87
|
+
* [`createReminder(...)`](#createreminder)
|
|
88
|
+
* [`openCalendar(...)`](#opencalendar)
|
|
89
|
+
* [`openReminders()`](#openreminders)
|
|
90
|
+
* [`listEventsInRange(...)`](#listeventsinrange)
|
|
91
|
+
* [`deleteEventsById(...)`](#deleteeventsbyid)
|
|
92
|
+
* [`createCalendar(...)`](#createcalendar)
|
|
93
|
+
* [`deleteCalendar(...)`](#deletecalendar)
|
|
94
|
+
* [Interfaces](#interfaces)
|
|
95
|
+
* [Type Aliases](#type-aliases)
|
|
96
|
+
* [Enums](#enums)
|
|
97
|
+
|
|
98
|
+
</docgen-index>
|
|
81
99
|
|
|
82
100
|
## 📚 Documentation
|
|
83
101
|
|
|
84
102
|
For detailed explanations, usage examples, and additional information:
|
|
85
103
|
|
|
86
|
-
- **documentation.md**: Autogenerated
|
|
104
|
+
- **documentation.md**: Autogenerated docs are available in the [documentation](documentation.md) file.
|
|
87
105
|
- **definitions.ts**: Complete documentation with usage examples is available in the [src/definitions.ts](src/definitions.ts) file.
|
|
88
106
|
|
|
89
107
|
## 💙 Contributions
|
|
@@ -51,9 +51,9 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
51
51
|
intent.putExtra(CalendarContract.Events.TITLE, title)
|
|
52
52
|
calendarId?.let { intent.putExtra(CalendarContract.Events.CALENDAR_ID, it) }
|
|
53
53
|
location?.let { intent.putExtra(CalendarContract.Events.EVENT_LOCATION, it) }
|
|
54
|
-
startDate?.let { intent.putExtra(CalendarContract.
|
|
55
|
-
endDate?.let { intent.putExtra(CalendarContract.
|
|
56
|
-
isAllDay?.let { intent.putExtra(CalendarContract.
|
|
54
|
+
startDate?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, it) }
|
|
55
|
+
endDate?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, it) }
|
|
56
|
+
isAllDay?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, if (it) 1 else 0) }
|
|
57
57
|
|
|
58
58
|
return startActivityForResult(
|
|
59
59
|
call,
|
|
@@ -279,4 +279,16 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
279
279
|
return
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
+
|
|
283
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
284
|
+
fun createCalendar(call: PluginCall) {
|
|
285
|
+
call.unimplemented("[CapacitorCalendar.${::createCalendar.name}] Not implemented on Android")
|
|
286
|
+
return
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
290
|
+
fun deleteCalendar(call: PluginCall) {
|
|
291
|
+
call.unimplemented("[CapacitorCalendar.${::deleteCalendar.name}] Not implemented on Android")
|
|
292
|
+
return
|
|
293
|
+
}
|
|
282
294
|
}
|
package/dist/docs.json
CHANGED
|
@@ -152,7 +152,8 @@
|
|
|
152
152
|
"returns": "Promise<{ result: string[]; }>",
|
|
153
153
|
"tags": [
|
|
154
154
|
{
|
|
155
|
-
"name": "method"
|
|
155
|
+
"name": "method",
|
|
156
|
+
"text": "createEventWithPrompt"
|
|
156
157
|
},
|
|
157
158
|
{
|
|
158
159
|
"name": "since",
|
|
@@ -174,10 +175,6 @@
|
|
|
174
175
|
"name": "returns",
|
|
175
176
|
"text": "A promise that resolves with an array of the ids of created events."
|
|
176
177
|
},
|
|
177
|
-
{
|
|
178
|
-
"name": "throws",
|
|
179
|
-
"text": "Error If prompt gets cancelled."
|
|
180
|
-
},
|
|
181
178
|
{
|
|
182
179
|
"name": "example",
|
|
183
180
|
"text": "if (capacitor.getPlatform() === 'android') {\n await this.requestPermission({ alias: 'readCalendar' });\n { result } = result = await this.createEventWithPrompt({\n title: 'Title',\n alertOffsetInMinutes: 5,\n });\n} else {\n { result } = result = await this.createEventWithPrompt({\n title: 'Title',\n alertOffsetInMinutes: 5,\n });\n}"
|
|
@@ -203,16 +200,21 @@
|
|
|
203
200
|
"name": "method",
|
|
204
201
|
"text": "selectCalendarsWithPrompt"
|
|
205
202
|
},
|
|
203
|
+
{
|
|
204
|
+
"name": "since",
|
|
205
|
+
"text": "0.2.0"
|
|
206
|
+
},
|
|
206
207
|
{
|
|
207
208
|
"name": "platform",
|
|
208
209
|
"text": "iOS"
|
|
209
210
|
},
|
|
210
211
|
{
|
|
211
|
-
"name": "
|
|
212
|
-
"text": "
|
|
212
|
+
"name": "permissions",
|
|
213
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> writeCalendar</li>\n</ul>"
|
|
213
214
|
},
|
|
214
215
|
{
|
|
215
|
-
"name": "
|
|
216
|
+
"name": "param",
|
|
217
|
+
"text": "options - Options for customizing the display and selection styles of the calendar chooser."
|
|
216
218
|
},
|
|
217
219
|
{
|
|
218
220
|
"name": "returns",
|
|
@@ -594,6 +596,92 @@
|
|
|
594
596
|
"docs": "Deletes events from the calendar given their IDs.",
|
|
595
597
|
"complexTypes": [],
|
|
596
598
|
"slug": "deleteeventsbyid"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"name": "createCalendar",
|
|
602
|
+
"signature": "(options: { title: string; color?: string; }) => Promise<{ result: string; }>",
|
|
603
|
+
"parameters": [
|
|
604
|
+
{
|
|
605
|
+
"name": "options",
|
|
606
|
+
"docs": "Options for creating a calendar.",
|
|
607
|
+
"type": "{ title: string; color?: string | undefined; }"
|
|
608
|
+
}
|
|
609
|
+
],
|
|
610
|
+
"returns": "Promise<{ result: string; }>",
|
|
611
|
+
"tags": [
|
|
612
|
+
{
|
|
613
|
+
"name": "method",
|
|
614
|
+
"text": "createCalendar"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"name": "since",
|
|
618
|
+
"text": "5.2.0"
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"name": "platform",
|
|
622
|
+
"text": "iOS"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"name": "permissions",
|
|
626
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n</ul>"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"name": "param",
|
|
630
|
+
"text": "options Options for creating a calendar."
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "returns",
|
|
634
|
+
"text": "The id of the created calendar."
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"name": "example",
|
|
638
|
+
"text": "{ result } = await CapacitorCalendar.createCalendar({\n title: 'New Calendar',\n color: '#1d00fc',\n });\n console.log(result); // 'CALENDAR_ID'"
|
|
639
|
+
}
|
|
640
|
+
],
|
|
641
|
+
"docs": "Creates a calendar",
|
|
642
|
+
"complexTypes": [],
|
|
643
|
+
"slug": "createcalendar"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "deleteCalendar",
|
|
647
|
+
"signature": "(options: { id: string; }) => Promise<void>",
|
|
648
|
+
"parameters": [
|
|
649
|
+
{
|
|
650
|
+
"name": "options",
|
|
651
|
+
"docs": "Options for deleting a calendar.",
|
|
652
|
+
"type": "{ id: string; }"
|
|
653
|
+
}
|
|
654
|
+
],
|
|
655
|
+
"returns": "Promise<void>",
|
|
656
|
+
"tags": [
|
|
657
|
+
{
|
|
658
|
+
"name": "method",
|
|
659
|
+
"text": "deleteCalendar"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"name": "since",
|
|
663
|
+
"text": "5.2.0"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "platform",
|
|
667
|
+
"text": "iOS"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"name": "permissions",
|
|
671
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n</ul>"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"name": "param",
|
|
675
|
+
"text": "options Options for deleting a calendar."
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "example",
|
|
679
|
+
"text": "await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });"
|
|
680
|
+
}
|
|
681
|
+
],
|
|
682
|
+
"docs": "Deletes a calendar by id",
|
|
683
|
+
"complexTypes": [],
|
|
684
|
+
"slug": "deletecalendar"
|
|
597
685
|
}
|
|
598
686
|
],
|
|
599
687
|
"properties": []
|
|
@@ -63,7 +63,7 @@ export interface CapacitorCalendarPlugin {
|
|
|
63
63
|
* Creates an event in the calendar by using the native calendar.
|
|
64
64
|
* On iOS opens a native sheet and on Android opens an intent.
|
|
65
65
|
*
|
|
66
|
-
* @method
|
|
66
|
+
* @method createEventWithPrompt
|
|
67
67
|
* @since 0.1.0
|
|
68
68
|
* @platform iOS, Android
|
|
69
69
|
* @permissions
|
|
@@ -82,7 +82,6 @@ export interface CapacitorCalendarPlugin {
|
|
|
82
82
|
* an alert will be set for the event this many minutes *before* the event.
|
|
83
83
|
* Negative values are ignored. (Optional)
|
|
84
84
|
* @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.
|
|
85
|
-
* @throws Error If prompt gets cancelled.
|
|
86
85
|
* @example
|
|
87
86
|
* if (capacitor.getPlatform() === 'android') {
|
|
88
87
|
* await this.requestPermission({ alias: 'readCalendar' });
|
|
@@ -112,9 +111,16 @@ export interface CapacitorCalendarPlugin {
|
|
|
112
111
|
* Presents a prompt to the user to select calendars. This method is available only on iOS.
|
|
113
112
|
*
|
|
114
113
|
* @method selectCalendarsWithPrompt
|
|
114
|
+
* @since 0.2.0
|
|
115
115
|
* @platform iOS
|
|
116
|
+
* @permissions
|
|
117
|
+
* <h3>Runtime Permissions:</h3>
|
|
118
|
+
* <ul>
|
|
119
|
+
* <li><strong>iOS:</strong> writeCalendar</li>
|
|
120
|
+
* </ul>
|
|
116
121
|
* @param {object} options - Options for customizing the display and selection styles of the calendar chooser.
|
|
117
|
-
* @
|
|
122
|
+
* @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.
|
|
123
|
+
* @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.
|
|
118
124
|
* @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,
|
|
119
125
|
* where each calendar object contains an ID and a title.
|
|
120
126
|
* @example
|
|
@@ -378,4 +384,52 @@ export interface CapacitorCalendarPlugin {
|
|
|
378
384
|
failed: string[];
|
|
379
385
|
};
|
|
380
386
|
}>;
|
|
387
|
+
/**
|
|
388
|
+
* Creates a calendar
|
|
389
|
+
*
|
|
390
|
+
* @method createCalendar
|
|
391
|
+
* @since 5.2.0
|
|
392
|
+
* @platform iOS
|
|
393
|
+
* @permissions
|
|
394
|
+
* <h3>Runtime Permissions:</h3>
|
|
395
|
+
* <ul>
|
|
396
|
+
* <li><strong>iOS:</strong> readCalendar, writeCalendar</li>
|
|
397
|
+
* </ul>
|
|
398
|
+
* @param {object} options Options for creating a calendar.
|
|
399
|
+
* @param {string} options.title The title of the calendar to create.
|
|
400
|
+
* @param {string} options.color The color of the calendar to create.
|
|
401
|
+
* The color should be a HEX string. (Optional)
|
|
402
|
+
* @returns {Promise<{ result: string }>} The id of the created calendar.
|
|
403
|
+
* @example
|
|
404
|
+
* { result } = await CapacitorCalendar.createCalendar({
|
|
405
|
+
* title: 'New Calendar',
|
|
406
|
+
* color: '#1d00fc',
|
|
407
|
+
* });
|
|
408
|
+
* console.log(result); // 'CALENDAR_ID'
|
|
409
|
+
*/
|
|
410
|
+
createCalendar(options: {
|
|
411
|
+
title: string;
|
|
412
|
+
color?: string;
|
|
413
|
+
}): Promise<{
|
|
414
|
+
result: string;
|
|
415
|
+
}>;
|
|
416
|
+
/**
|
|
417
|
+
* Deletes a calendar by id
|
|
418
|
+
*
|
|
419
|
+
* @method deleteCalendar
|
|
420
|
+
* @since 5.2.0
|
|
421
|
+
* @platform iOS
|
|
422
|
+
* @permissions
|
|
423
|
+
* <h3>Runtime Permissions:</h3>
|
|
424
|
+
* <ul>
|
|
425
|
+
* <li><strong>iOS:</strong> readCalendar, writeCalendar</li>
|
|
426
|
+
* </ul>
|
|
427
|
+
* @param {object} options Options for deleting a calendar.
|
|
428
|
+
* @param {string} options.id The id of the calendar to delete.
|
|
429
|
+
* @example
|
|
430
|
+
* await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });
|
|
431
|
+
*/
|
|
432
|
+
deleteCalendar(options: {
|
|
433
|
+
id: string;
|
|
434
|
+
}): Promise<void>;
|
|
381
435
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport type { PermissionState } from '@capacitor/core';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\nimport type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';\nimport type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – 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: PluginPermission }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise<PluginPermissionsMap>} – 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<PluginPermissionsMap>;\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 * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – 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: PluginPermission }): 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 * @platform iOS, Android\n * @returns {Promise<PluginPermissionsMap>} – 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<PluginPermissionsMap>;\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 *\n * @method\n * @since 0.1.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - Ignored on Android. If a number >= 0 is provided,\n * an alert will be set for the event this many minutes *before* the event.\n * Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @throws Error If prompt gets cancelled.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * }\n */\n createEventWithPrompt(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @platform iOS\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 { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @platform iOS, Android\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 { result } = await listCalendars();\n * console.log(result); // [{ 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 * @method getDefaultCalendar\n * @platform iOS, Android\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 { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false,\n * alertOffsetInMinutes: 5,\n * };\n * const { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @method getDefaultRemindersList\n * @platform iOS\n * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.\n * The returned reminders list object contains an ID and a title.\n * @example\n * const { result } = await getDefaultRemindersList();\n * console.log(result); // { id: '1', title: 'Default Reminders List' }\n */\n getDefaultRemindersList(): Promise<{ result: RemindersList }>;\n\n /**\n * Retrieves all available reminders lists on the device.\n *\n * @async\n * @method getRemindersLists\n * @platform iOS\n * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.\n * Each reminders list object in the array contains an ID and a title.\n * @example\n * const { result } = await getRemindersLists();\n * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]\n */\n getRemindersLists(): Promise<{ result: RemindersList[] }>;\n\n /**\n * Creates a reminder with the provided options.\n *\n * @method createReminder\n * @since 0.5.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { result } = await createReminder(reminderOptions);\n * console.log(result); // 'ID_1'\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }>;\n\n /**\n * Opens the calendar app. Since the user leaves your app, use this method with caution.\n * It will open the calendar on today's date if no date is provided.\n *\n * @method openCalendar\n * @platform iOS, Android\n * @param {object} options - Options for opening the calendar.\n * @param {number} options.date - The date at which the calendar should be opened. (Optional)\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openCalendar({ date: Date.now() });\n */\n openCalendar(options: { date?: number }): Promise<void>;\n\n /**\n * Opens the reminders app. Since the user leaves your app, use this method with caution.\n *\n * @method openReminders\n * @platform iOS\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openReminders();\n */\n openReminders(): Promise<void>;\n\n /**\n * Retrieves the list of calendar events present in the given date range.\n *\n * @method listEventsInRange\n * @since 0.10.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * @param {number} options.startDate The start of the date range.\n * @param {number} options.endDate The end of the date range.\n * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.\n * @example\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * startDate: Date.now(),\n * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n * })\n */\n listEventsInRange(options: { startDate: number; endDate: number }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @method deleteEventsById\n * @since 0.11.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options Options for defining event IDs.\n * @param {number} options.ids An array of event IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteEventsById(options: { ids: string[] }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport type { PermissionState } from '@capacitor/core';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\nimport type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';\nimport type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – 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: PluginPermission }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise<PluginPermissionsMap>} – 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<PluginPermissionsMap>;\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 * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – 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: PluginPermission }): 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 * @platform iOS, Android\n * @returns {Promise<PluginPermissionsMap>} – 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<PluginPermissionsMap>;\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 *\n * @method createEventWithPrompt\n * @since 0.1.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - Ignored on Android. If a number >= 0 is provided,\n * an alert will be set for the event this many minutes *before* the event.\n * Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * }\n */\n createEventWithPrompt(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @since 0.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.\n * @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.\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 { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @platform iOS, Android\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 { result } = await listCalendars();\n * console.log(result); // [{ 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 * @method getDefaultCalendar\n * @platform iOS, Android\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 { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false,\n * alertOffsetInMinutes: 5,\n * };\n * const { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @method getDefaultRemindersList\n * @platform iOS\n * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.\n * The returned reminders list object contains an ID and a title.\n * @example\n * const { result } = await getDefaultRemindersList();\n * console.log(result); // { id: '1', title: 'Default Reminders List' }\n */\n getDefaultRemindersList(): Promise<{ result: RemindersList }>;\n\n /**\n * Retrieves all available reminders lists on the device.\n *\n * @async\n * @method getRemindersLists\n * @platform iOS\n * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.\n * Each reminders list object in the array contains an ID and a title.\n * @example\n * const { result } = await getRemindersLists();\n * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]\n */\n getRemindersLists(): Promise<{ result: RemindersList[] }>;\n\n /**\n * Creates a reminder with the provided options.\n *\n * @method createReminder\n * @since 0.5.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { result } = await createReminder(reminderOptions);\n * console.log(result); // 'ID_1'\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }>;\n\n /**\n * Opens the calendar app. Since the user leaves your app, use this method with caution.\n * It will open the calendar on today's date if no date is provided.\n *\n * @method openCalendar\n * @platform iOS, Android\n * @param {object} options - Options for opening the calendar.\n * @param {number} options.date - The date at which the calendar should be opened. (Optional)\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openCalendar({ date: Date.now() });\n */\n openCalendar(options: { date?: number }): Promise<void>;\n\n /**\n * Opens the reminders app. Since the user leaves your app, use this method with caution.\n *\n * @method openReminders\n * @platform iOS\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openReminders();\n */\n openReminders(): Promise<void>;\n\n /**\n * Retrieves the list of calendar events present in the given date range.\n *\n * @method listEventsInRange\n * @since 0.10.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * @param {number} options.startDate The start of the date range.\n * @param {number} options.endDate The end of the date range.\n * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.\n * @example\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * startDate: Date.now(),\n * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n * })\n */\n listEventsInRange(options: { startDate: number; endDate: number }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @method deleteEventsById\n * @since 0.11.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options Options for defining event IDs.\n * @param {number} options.ids An array of event IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteEventsById(options: { ids: string[] }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Creates a calendar\n *\n * @method createCalendar\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating a calendar.\n * @param {string} options.title The title of the calendar to create.\n * @param {string} options.color The color of the calendar to create.\n * The color should be a HEX string. (Optional)\n * @returns {Promise<{ result: string }>} The id of the created calendar.\n * @example\n * { result } = await CapacitorCalendar.createCalendar({\n * title: 'New Calendar',\n * color: '#1d00fc',\n * });\n * console.log(result); // 'CALENDAR_ID'\n */\n createCalendar(options: { title: string; color?: string }): Promise<{ result: string }>;\n\n /**\n * Deletes a calendar by id\n *\n * @method deleteCalendar\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for deleting a calendar.\n * @param {string} options.id The id of the calendar to delete.\n * @example\n * await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });\n */\n deleteCalendar(options: { id: string }): Promise<void>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -89,4 +89,13 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
89
89
|
failed: string[];
|
|
90
90
|
};
|
|
91
91
|
}>;
|
|
92
|
+
createCalendar(_options: {
|
|
93
|
+
title: string;
|
|
94
|
+
color?: string;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
result: string;
|
|
97
|
+
}>;
|
|
98
|
+
deleteCalendar(_options: {
|
|
99
|
+
id: string;
|
|
100
|
+
}): Promise<void>;
|
|
92
101
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -17,7 +17,7 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
17
17
|
throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
|
|
18
18
|
}
|
|
19
19
|
selectCalendarsWithPrompt() {
|
|
20
|
-
throw this.unimplemented(`${this.
|
|
20
|
+
throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);
|
|
21
21
|
}
|
|
22
22
|
listCalendars() {
|
|
23
23
|
throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);
|
|
@@ -32,22 +32,28 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
32
32
|
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
33
33
|
}
|
|
34
34
|
getDefaultRemindersList() {
|
|
35
|
-
throw this.unimplemented(`${this.
|
|
35
|
+
throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);
|
|
36
36
|
}
|
|
37
37
|
getRemindersLists() {
|
|
38
|
-
throw this.unimplemented(`${this.
|
|
38
|
+
throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);
|
|
39
39
|
}
|
|
40
40
|
openCalendar(_options) {
|
|
41
|
-
throw this.unimplemented(`${this.
|
|
41
|
+
throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);
|
|
42
42
|
}
|
|
43
43
|
openReminders() {
|
|
44
|
-
throw this.unimplemented(`${this.
|
|
44
|
+
throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);
|
|
45
45
|
}
|
|
46
46
|
listEventsInRange(_options) {
|
|
47
|
-
throw this.unimplemented(`${this.
|
|
47
|
+
throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);
|
|
48
48
|
}
|
|
49
49
|
deleteEventsById(_options) {
|
|
50
50
|
throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);
|
|
51
51
|
}
|
|
52
|
+
createCalendar(_options) {
|
|
53
|
+
throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);
|
|
54
|
+
}
|
|
55
|
+
deleteCalendar(_options) {
|
|
56
|
+
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
59
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS7D,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,eAAe,CAAC,QAAqC;QAC1D,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACzF,CAAC;IAEM,mBAAmB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,iBAAiB,CAAC,QAAqC;QAC5D,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC3F,CAAC;IAEM,qBAAqB;QAC1B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CA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QAA2C;QAC/D,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;IAEM,cAAc,CAAC,QAAwB;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { PermissionState, WebPlugin } from '@capacitor/core';\nimport { CapacitorCalendarPlugin } from './definitions';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\nimport type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\n\nexport class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {\n public checkPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n\n public checkAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string[] }> {\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.selectCalendarsWithPrompt.name} is not implemented on the web`);\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar }> {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n\n public createEvent(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{\n result: string;\n }> {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n\n public createReminder(_options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public getDefaultRemindersList(): Promise<{ result: RemindersList }> {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n\n public openCalendar(_options: { date?: number }): Promise<void> {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n\n public openReminders(): Promise<void> {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n\n public listEventsInRange(_options: { startDate: number; endDate: number }): Promise<{ result: CalendarEvent[] }> {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n\n public deleteEventsById(_options: { ids: string[] }): Promise<{\n result: { deleted: string[]; failed: string[] };\n }> {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n\n public createCalendar(_options: { title: string; color?: string }): Promise<{ result: string }> {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n\n public deleteCalendar(_options: { id: string }): Promise<void> {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -146,7 +146,7 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
146
146
|
throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
|
|
147
147
|
}
|
|
148
148
|
selectCalendarsWithPrompt() {
|
|
149
|
-
throw this.unimplemented(`${this.
|
|
149
|
+
throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);
|
|
150
150
|
}
|
|
151
151
|
listCalendars() {
|
|
152
152
|
throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);
|
|
@@ -161,23 +161,29 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
161
161
|
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
162
162
|
}
|
|
163
163
|
getDefaultRemindersList() {
|
|
164
|
-
throw this.unimplemented(`${this.
|
|
164
|
+
throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);
|
|
165
165
|
}
|
|
166
166
|
getRemindersLists() {
|
|
167
|
-
throw this.unimplemented(`${this.
|
|
167
|
+
throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);
|
|
168
168
|
}
|
|
169
169
|
openCalendar(_options) {
|
|
170
|
-
throw this.unimplemented(`${this.
|
|
170
|
+
throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);
|
|
171
171
|
}
|
|
172
172
|
openReminders() {
|
|
173
|
-
throw this.unimplemented(`${this.
|
|
173
|
+
throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);
|
|
174
174
|
}
|
|
175
175
|
listEventsInRange(_options) {
|
|
176
|
-
throw this.unimplemented(`${this.
|
|
176
|
+
throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);
|
|
177
177
|
}
|
|
178
178
|
deleteEventsById(_options) {
|
|
179
179
|
throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);
|
|
180
180
|
}
|
|
181
|
+
createCalendar(_options) {
|
|
182
|
+
throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);
|
|
183
|
+
}
|
|
184
|
+
deleteCalendar(_options) {
|
|
185
|
+
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);
|
|
186
|
+
}
|
|
181
187
|
}
|
|
182
188
|
|
|
183
189
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\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=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\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//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { 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(_options) {\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 createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACWA,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;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,CAAC;AAC9F,KAAK;AACL,IAAI,iBAAiB,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,YAAY,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,gBAAgB,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAChG,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\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=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\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//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { 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(_options) {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.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 createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n createCalendar(_options) {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n deleteCalendar(_options) {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACWA,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;;AChBrE;AACA;AACA;AACA;AACA;AACA;AACWC,+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;;AChBzE;AACA;AACA;AACA;AACA;AACA;AACWC,kCAAiB;AA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C,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACjG,KAAK;AACL,IAAI,gBAAgB,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAChG,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -145,7 +145,7 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
145
145
|
throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);
|
|
146
146
|
}
|
|
147
147
|
selectCalendarsWithPrompt() {
|
|
148
|
-
throw this.unimplemented(`${this.
|
|
148
|
+
throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);
|
|
149
149
|
}
|
|
150
150
|
listCalendars() {
|
|
151
151
|
throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);
|
|
@@ -160,23 +160,29 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
160
160
|
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
161
161
|
}
|
|
162
162
|
getDefaultRemindersList() {
|
|
163
|
-
throw this.unimplemented(`${this.
|
|
163
|
+
throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);
|
|
164
164
|
}
|
|
165
165
|
getRemindersLists() {
|
|
166
|
-
throw this.unimplemented(`${this.
|
|
166
|
+
throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);
|
|
167
167
|
}
|
|
168
168
|
openCalendar(_options) {
|
|
169
|
-
throw this.unimplemented(`${this.
|
|
169
|
+
throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);
|
|
170
170
|
}
|
|
171
171
|
openReminders() {
|
|
172
|
-
throw this.unimplemented(`${this.
|
|
172
|
+
throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);
|
|
173
173
|
}
|
|
174
174
|
listEventsInRange(_options) {
|
|
175
|
-
throw this.unimplemented(`${this.
|
|
175
|
+
throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);
|
|
176
176
|
}
|
|
177
177
|
deleteEventsById(_options) {
|
|
178
178
|
throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);
|
|
179
179
|
}
|
|
180
|
+
createCalendar(_options) {
|
|
181
|
+
throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);
|
|
182
|
+
}
|
|
183
|
+
deleteCalendar(_options) {
|
|
184
|
+
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);
|
|
185
|
+
}
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\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=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\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//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { 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(_options) {\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 createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;IChBrE;IACA;IACA;IACA;IACA;IACA;AACWC,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC;;IChBzE;IACA;IACA;IACA;IACA;IACA;AACWC,sCAAiB;IAC5B,CAAC,UAAU,gBAAgB,EAAE;IAC7B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAI,gBAAgB,CAAC,eAAe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AC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAChG,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\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=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\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//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { 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(_options) {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.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 createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n createCalendar(_options) {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n deleteCalendar(_options) {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2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apacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarChooserDelegate {
|
|
6
6
|
private let bridge: (any CAPBridgeProtocol)?
|
|
7
7
|
private let eventStore: EKEventStore
|
|
8
|
-
private var currentCreateEventContinuation: CheckedContinuation<String, any Error>?
|
|
8
|
+
private var currentCreateEventContinuation: CheckedContinuation<[String], any Error>?
|
|
9
9
|
private var currentSelectCalendarsContinuation: CheckedContinuation<[[String: String]], any Error>?
|
|
10
10
|
|
|
11
11
|
init(bridge: (any CAPBridgeProtocol)?, eventStore: EKEventStore) {
|
|
@@ -13,7 +13,7 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
13
13
|
self.eventStore = eventStore
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
public func createEventWithPrompt(with parameters: EventCreationParameters) async throws -> String {
|
|
16
|
+
public func createEventWithPrompt(with parameters: EventCreationParameters) async throws -> [String] {
|
|
17
17
|
let newEvent = EKEvent(eventStore: eventStore)
|
|
18
18
|
if let calendarId = parameters.calendarId, let calendar = eventStore.calendar(withIdentifier: calendarId) {
|
|
19
19
|
newEvent.calendar = calendar
|
|
@@ -310,6 +310,33 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
+
public func createCalendar(title: String, color: String?) throws -> String {
|
|
314
|
+
let newCalendar = EKCalendar(for: .event, eventStore: eventStore)
|
|
315
|
+
newCalendar.title = title
|
|
316
|
+
if let calendarColor = color {
|
|
317
|
+
newCalendar.cgColor = UIColor(hex: calendarColor)?.cgColor
|
|
318
|
+
} else {
|
|
319
|
+
newCalendar.cgColor = eventStore.defaultCalendarForNewEvents?.cgColor
|
|
320
|
+
}
|
|
321
|
+
newCalendar.source = eventStore.defaultCalendarForNewEvents?.source
|
|
322
|
+
|
|
323
|
+
do {
|
|
324
|
+
try eventStore.saveCalendar(newCalendar, commit: true)
|
|
325
|
+
} catch {
|
|
326
|
+
throw CapacitorCalendarPluginError.unableToCreateCalendar
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return newCalendar.calendarIdentifier
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
public func deleteCalendar(id: String) throws {
|
|
333
|
+
if let calendar = eventStore.calendar(withIdentifier: id) {
|
|
334
|
+
try eventStore.removeCalendar(calendar, commit: true)
|
|
335
|
+
} else {
|
|
336
|
+
throw CapacitorCalendarPluginError.calendarNotFound
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
313
340
|
public func eventEditViewController(
|
|
314
341
|
_ controller: EKEventEditViewController,
|
|
315
342
|
didCompleteWith action: EKEventEditViewAction
|
|
@@ -317,13 +344,13 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
317
344
|
controller.dismiss(animated: true) {
|
|
318
345
|
if action == .saved {
|
|
319
346
|
if let event = controller.event {
|
|
320
|
-
self.currentCreateEventContinuation?.resume(returning: event.eventIdentifier)
|
|
347
|
+
self.currentCreateEventContinuation?.resume(returning: [event.eventIdentifier])
|
|
321
348
|
} else {
|
|
322
349
|
self.currentCreateEventContinuation?.resume(throwing: CapacitorCalendarPluginError.undefinedEvent)
|
|
323
350
|
return
|
|
324
351
|
}
|
|
325
352
|
} else if action == .canceled {
|
|
326
|
-
self.currentCreateEventContinuation?.resume(
|
|
353
|
+
self.currentCreateEventContinuation?.resume(returning: [])
|
|
327
354
|
} else {
|
|
328
355
|
self.currentCreateEventContinuation?.resume(throwing: CapacitorCalendarPluginError.unknownActionEventCreationPrompt)
|
|
329
356
|
}
|
|
@@ -339,7 +366,7 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
339
366
|
|
|
340
367
|
public func calendarChooserDidCancel(_ calendarChooser: EKCalendarChooser) {
|
|
341
368
|
bridge?.viewController?.dismiss(animated: true) {
|
|
342
|
-
self.currentSelectCalendarsContinuation?.resume(
|
|
369
|
+
self.currentSelectCalendarsContinuation?.resume(returning: [])
|
|
343
370
|
}
|
|
344
371
|
}
|
|
345
372
|
|
|
@@ -20,4 +20,6 @@ CAP_PLUGIN(CapacitorCalendarPlugin, "CapacitorCalendar",
|
|
|
20
20
|
CAP_PLUGIN_METHOD(openReminders, CAPPluginReturnNone);
|
|
21
21
|
CAP_PLUGIN_METHOD(listEventsInRange, CAPPluginReturnPromise);
|
|
22
22
|
CAP_PLUGIN_METHOD(deleteEventsById, CAPPluginReturnPromise);
|
|
23
|
+
CAP_PLUGIN_METHOD(createCalendar, CAPPluginReturnPromise);
|
|
24
|
+
CAP_PLUGIN_METHOD(deleteCalendar, CAPPluginReturnNone);
|
|
23
25
|
)
|
|
@@ -145,7 +145,7 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
145
145
|
Task {
|
|
146
146
|
do {
|
|
147
147
|
let result = try await calendar.createEventWithPrompt(with: eventParameters)
|
|
148
|
-
call.resolve(["result":
|
|
148
|
+
call.resolve(["result": result])
|
|
149
149
|
} catch {
|
|
150
150
|
call.reject("[CapacitorCalendar.\(#function)] Unable to retrieve view controller")
|
|
151
151
|
return
|
|
@@ -354,4 +354,35 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
+
|
|
358
|
+
@objc public func createCalendar(_ call: CAPPluginCall) {
|
|
359
|
+
guard let title = call.getString("title") else {
|
|
360
|
+
call.reject("[CapacitorCalendar.\(#function)] A title for the calendar was not provided")
|
|
361
|
+
return
|
|
362
|
+
}
|
|
363
|
+
let color = call.getString("color")
|
|
364
|
+
|
|
365
|
+
do {
|
|
366
|
+
let id = try calendar.createCalendar(title: title, color: color)
|
|
367
|
+
call.resolve(["result": id])
|
|
368
|
+
} catch {
|
|
369
|
+
call.reject("[CapacitorCalendar.\(#function)] Could not create calendar")
|
|
370
|
+
return
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
@objc public func deleteCalendar(_ call: CAPPluginCall) {
|
|
375
|
+
guard let id = call.getString("id") else {
|
|
376
|
+
call.reject("[CapacitorCalendar.\(#function)] An id for the calendar to delete should be provided")
|
|
377
|
+
return
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
do {
|
|
381
|
+
try calendar.deleteCalendar(id: id)
|
|
382
|
+
call.resolve()
|
|
383
|
+
} catch {
|
|
384
|
+
call.reject("[CapacitorCalendar.\(#function)] Could not delete calendar")
|
|
385
|
+
return
|
|
386
|
+
}
|
|
387
|
+
}
|
|
357
388
|
}
|
|
@@ -13,10 +13,11 @@ public enum CapacitorCalendarPluginError: Error {
|
|
|
13
13
|
case eventStoreAuthorization
|
|
14
14
|
case viewControllerUnavailable
|
|
15
15
|
case unknownActionEventCreationPrompt
|
|
16
|
-
case canceledCalendarsSelectionPrompt
|
|
17
16
|
case noDefaultCalendar
|
|
18
17
|
case unableToOpenCalendar
|
|
19
18
|
case unableToOpenReminders
|
|
20
19
|
case undefinedEvent
|
|
21
|
-
case
|
|
20
|
+
case unableToParseColor
|
|
21
|
+
case unableToCreateCalendar
|
|
22
|
+
case calendarNotFound
|
|
22
23
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// UIColorExtensions.swift
|
|
3
|
+
// Plugin
|
|
4
|
+
//
|
|
5
|
+
// Created by Ehsan Barooni on 03.05.24.
|
|
6
|
+
// Copyright © 2024 Max Lynch. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
import UIKit
|
|
12
|
+
|
|
13
|
+
extension UIColor {
|
|
14
|
+
convenience init?(hex: String) {
|
|
15
|
+
var hexSanitized = hex.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
16
|
+
hexSanitized = hexSanitized.replacingOccurrences(of: "#", with: "")
|
|
17
|
+
|
|
18
|
+
var rgb: UInt64 = 0
|
|
19
|
+
|
|
20
|
+
Scanner(string: hexSanitized).scanHexInt64(&rgb)
|
|
21
|
+
|
|
22
|
+
let red = CGFloat((rgb & 0xFF0000) >> 16) / 255.0
|
|
23
|
+
let green = CGFloat((rgb & 0x00FF00) >> 8) / 255.0
|
|
24
|
+
let blue = CGFloat(rgb & 0x0000FF) / 255.0
|
|
25
|
+
|
|
26
|
+
self.init(red: red, green: green, blue: blue, alpha: 1.0)
|
|
27
|
+
}
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebarooni/capacitor-calendar",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -57,9 +57,10 @@
|
|
|
57
57
|
"fmt:md": "npx prettier --write \"**/*.md\"",
|
|
58
58
|
"fmt:kt": "npm run ktlint -- -F",
|
|
59
59
|
"fmt": "npm run fmt:ts && npm run fmt:html && npm run fmt:css && npm run fmt:swift && npm run fmt:md && npm run fmt:kt",
|
|
60
|
-
"docgen": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json",
|
|
60
|
+
"docgen:api": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json",
|
|
61
|
+
"docgen:readme": "docgen --api CapacitorCalendarPlugin --output-readme README.md",
|
|
61
62
|
"clean": "rm -rf ./dist",
|
|
62
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
63
|
+
"build": "npm run clean && npm run docgen:api && npm run docgen:readme && tsc && rollup -c rollup.config.mjs",
|
|
63
64
|
"prepublishOnly": "npm run build"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|