@ebarooni/capacitor-calendar 6.5.0 → 6.6.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.
Files changed (40) hide show
  1. package/README.md +53 -5
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +178 -119
  4. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +73 -0
  5. package/assets/images/text-logo.png +0 -0
  6. package/dist/docs.json +453 -60
  7. package/dist/esm/definitions.d.ts +164 -34
  8. package/dist/esm/definitions.js.map +1 -1
  9. package/dist/esm/index.d.ts +18 -14
  10. package/dist/esm/index.js +12 -9
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/schemas/enums/calendar-source-type.d.ts +38 -0
  13. package/dist/esm/schemas/enums/calendar-source-type.js +40 -0
  14. package/dist/esm/schemas/enums/calendar-source-type.js.map +1 -0
  15. package/dist/esm/schemas/enums/calendar-type.d.ts +28 -0
  16. package/dist/esm/schemas/enums/calendar-type.js +30 -0
  17. package/dist/esm/schemas/enums/calendar-type.js.map +1 -0
  18. package/dist/esm/schemas/enums/event-span.d.ts +16 -0
  19. package/dist/esm/schemas/enums/event-span.js +18 -0
  20. package/dist/esm/schemas/enums/event-span.js.map +1 -0
  21. package/dist/esm/schemas/interfaces/calendar-event.d.ts +14 -3
  22. package/dist/esm/schemas/interfaces/calendar-event.js.map +1 -1
  23. package/dist/esm/schemas/interfaces/calendar-source.d.ts +15 -0
  24. package/dist/esm/schemas/interfaces/calendar-source.js +2 -0
  25. package/dist/esm/schemas/interfaces/calendar-source.js.map +1 -0
  26. package/dist/esm/schemas/interfaces/calendar.d.ts +43 -2
  27. package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
  28. package/dist/esm/web.d.ts +49 -9
  29. package/dist/esm/web.js +13 -2
  30. package/dist/esm/web.js.map +1 -1
  31. package/dist/plugin.cjs.js +101 -2
  32. package/dist/plugin.cjs.js.map +1 -1
  33. package/dist/plugin.js +101 -2
  34. package/dist/plugin.js.map +1 -1
  35. package/ios/Plugin/CapacitorCalendar.swift +210 -17
  36. package/ios/Plugin/CapacitorCalendarPlugin.m +4 -0
  37. package/ios/Plugin/CapacitorCalendarPlugin.swift +111 -1
  38. package/ios/Plugin/CapacitorReminders.swift +62 -8
  39. package/ios/Plugin/EventCreationParameters.swift +1 -1
  40. package/package.json +28 -18
@@ -1,18 +1,20 @@
1
- import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';
2
- import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';
3
- import { PluginPermission } from './schemas/enums/plugin-permission';
4
- import type { PermissionState } from '@capacitor/core';
5
- import type { Calendar } from './schemas/interfaces/calendar';
6
- import type { RemindersList } from './schemas/interfaces/reminders-list';
7
- import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
8
- import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';
9
- import type { CalendarEvent } from './schemas/interfaces/calendar-event';
10
- import type { Reminder } from './schemas/interfaces/reminder';
1
+ import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style";
2
+ import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style";
3
+ import { PluginPermission } from "./schemas/enums/plugin-permission";
4
+ import { EventSpan } from "./schemas/enums/event-span";
5
+ import type { PermissionState } from "@capacitor/core";
6
+ import type { Calendar } from "./schemas/interfaces/calendar";
7
+ import type { RemindersList } from "./schemas/interfaces/reminders-list";
8
+ import type { PluginPermissionsMap } from "./schemas/interfaces/plugin-permissions-map";
9
+ import type { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule";
10
+ import type { CalendarEvent } from "./schemas/interfaces/calendar-event";
11
+ import type { Reminder } from "./schemas/interfaces/reminder";
12
+ import type { CalendarSource } from "./schemas/interfaces/calendar-source";
11
13
  export interface CapacitorCalendarPlugin {
12
14
  /**
13
15
  * Checks the current authorization status of a specific permission.
14
16
  *
15
- * @method checkPermission
17
+ * @async
16
18
  * @since 0.1.0
17
19
  * @platform iOS, Android
18
20
  * @param options An object with the name of the permission
@@ -28,7 +30,7 @@ export interface CapacitorCalendarPlugin {
28
30
  /**
29
31
  * Checks the current authorization status of all the required permissions for the plugin.
30
32
  *
31
- * @method checkAllPermissions
33
+ * @async
32
34
  * @since 0.1.0
33
35
  * @platform iOS, Android
34
36
  * @returns {Promise<PluginPermissionsMap>} A promise that resolves with an object containing all the permissions and their status.
@@ -40,7 +42,7 @@ export interface CapacitorCalendarPlugin {
40
42
  * Requests authorization to a specific permission, if not already granted.
41
43
  * If the permission is already granted, it will directly return the status.
42
44
  *
43
- * @method requestPermission
45
+ * @async
44
46
  * @since 0.1.0
45
47
  * @platform iOS, Android
46
48
  * @param options An object with the name of the permission
@@ -56,7 +58,7 @@ export interface CapacitorCalendarPlugin {
56
58
  /**
57
59
  * Requests authorization to all the required permissions for the plugin, if they have not already been granted.
58
60
  *
59
- * @method requestAllPermissions
61
+ * @async
60
62
  * @since 0.1.0
61
63
  * @platform iOS, Android
62
64
  * @returns {Promise<PluginPermissionsMap>} A promise that resolves with the new permission statuses after the request is made.
@@ -68,7 +70,7 @@ export interface CapacitorCalendarPlugin {
68
70
  * Creates an event in the calendar by using the native calendar.
69
71
  * On iOS opens a native sheet and on Android opens an intent.
70
72
  *
71
- * @method createEventWithPrompt
73
+ * @async
72
74
  * @since 0.1.0
73
75
  * @platform iOS, Android
74
76
  * @permissions
@@ -124,7 +126,7 @@ export interface CapacitorCalendarPlugin {
124
126
  /**
125
127
  * Presents a prompt to the user to select calendars. This method is available only on iOS.
126
128
  *
127
- * @method selectCalendarsWithPrompt
129
+ * @async
128
130
  * @since 0.2.0
129
131
  * @platform iOS
130
132
  * @permissions
@@ -153,7 +155,6 @@ export interface CapacitorCalendarPlugin {
153
155
  * Retrieves a list of calendars available on the device.
154
156
  *
155
157
  * @async
156
- * @method listCalendars
157
158
  * @platform iOS, Android
158
159
  * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.
159
160
  * Each calendar object in the array contains an ID and a title.
@@ -167,7 +168,7 @@ export interface CapacitorCalendarPlugin {
167
168
  /**
168
169
  * Retrieves the default calendar set on the device.
169
170
  *
170
- * @method getDefaultCalendar
171
+ * @async
171
172
  * @since 0.3.0
172
173
  * @platform iOS, Android
173
174
  * @permissions
@@ -188,7 +189,7 @@ export interface CapacitorCalendarPlugin {
188
189
  /**
189
190
  * Creates an event with the provided options.
190
191
  *
191
- * @method createEvent
192
+ * @async
192
193
  * @since 0.4.0
193
194
  * @platform iOS, Android
194
195
  * @permissions
@@ -241,7 +242,7 @@ export interface CapacitorCalendarPlugin {
241
242
  /**
242
243
  * Retrieves the default reminders list set on the device.
243
244
  *
244
- * @method getDefaultRemindersList
245
+ * @async
245
246
  * @platform iOS
246
247
  * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.
247
248
  * The returned reminders list object contains an ID and a title.
@@ -256,7 +257,6 @@ export interface CapacitorCalendarPlugin {
256
257
  * Retrieves all available reminders lists on the device.
257
258
  *
258
259
  * @async
259
- * @method getRemindersLists
260
260
  * @platform iOS
261
261
  * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.
262
262
  * Each reminders list object in the array contains an ID and a title.
@@ -270,7 +270,7 @@ export interface CapacitorCalendarPlugin {
270
270
  /**
271
271
  * Creates a reminder with the provided options.
272
272
  *
273
- * @method createReminder
273
+ * @async
274
274
  * @since 0.5.0
275
275
  * @platform iOS
276
276
  * @permissions
@@ -333,7 +333,7 @@ export interface CapacitorCalendarPlugin {
333
333
  * Opens the calendar app. Since the user leaves your app, use this method with caution.
334
334
  * It will open the calendar on today's date if no date is provided.
335
335
  *
336
- * @method openCalendar
336
+ * @async
337
337
  * @platform iOS, Android
338
338
  * @param {object} options - Options for opening the calendar.
339
339
  * @param {number} options.date - The date at which the calendar should be opened. (Optional)
@@ -347,7 +347,7 @@ export interface CapacitorCalendarPlugin {
347
347
  /**
348
348
  * Opens the reminders app. Since the user leaves your app, use this method with caution.
349
349
  *
350
- * @method openReminders
350
+ * @async
351
351
  * @platform iOS
352
352
  * @returns {Promise<void>}
353
353
  * @example
@@ -357,7 +357,7 @@ export interface CapacitorCalendarPlugin {
357
357
  /**
358
358
  * Retrieves the list of calendar events present in the given date range.
359
359
  *
360
- * @method listEventsInRange
360
+ * @async
361
361
  * @since 0.10.0
362
362
  * @platform iOS, Android
363
363
  * @permissions
@@ -385,7 +385,7 @@ export interface CapacitorCalendarPlugin {
385
385
  /**
386
386
  * Deletes events from the calendar given their IDs.
387
387
  *
388
- * @method deleteEventsById
388
+ * @async
389
389
  * @since 0.11.0
390
390
  * @platform iOS, Android
391
391
  * @permissions
@@ -417,7 +417,7 @@ export interface CapacitorCalendarPlugin {
417
417
  /**
418
418
  * Creates a calendar
419
419
  *
420
- * @method createCalendar
420
+ * @async
421
421
  * @since 5.2.0
422
422
  * @platform iOS
423
423
  * @permissions
@@ -429,24 +429,30 @@ export interface CapacitorCalendarPlugin {
429
429
  * @param {string} options.title The title of the calendar to create.
430
430
  * @param {string} options.color The color of the calendar to create.
431
431
  * The color should be a HEX string. (Optional)
432
+ * @param {string} options.sourceId The id of the source of the calendar.
433
+ * If not provided, the source of the default calendar will be used. It is
434
+ * recommended to use fetchAllCalendarSources method to fetch the id of the
435
+ * desired source type.
432
436
  * @returns {Promise<{ result: string }>} The id of the created calendar.
433
437
  * @example
434
438
  * { result } = await CapacitorCalendar.createCalendar({
435
439
  * title: 'New Calendar',
436
440
  * color: '#1d00fc',
441
+ * sourceId: 'local-source-id',
437
442
  * });
438
443
  * console.log(result); // 'CALENDAR_ID'
439
444
  */
440
445
  createCalendar(options: {
441
446
  title: string;
442
447
  color?: string;
448
+ sourceId?: string;
443
449
  }): Promise<{
444
450
  result: string;
445
451
  }>;
446
452
  /**
447
453
  * Deletes a calendar by id
448
454
  *
449
- * @method deleteCalendar
455
+ * @async
450
456
  * @since 5.2.0
451
457
  * @platform iOS
452
458
  * @permissions
@@ -465,7 +471,7 @@ export interface CapacitorCalendarPlugin {
465
471
  /**
466
472
  * Retrieves the list of reminders present in the given date range.
467
473
  *
468
- * @method getRemindersFromLists
474
+ * @async
469
475
  * @since 5.3.0
470
476
  * @platform iOS
471
477
  * @permissions
@@ -491,7 +497,7 @@ export interface CapacitorCalendarPlugin {
491
497
  /**
492
498
  * Deletes reminders given their IDs.
493
499
  *
494
- * @method deleteRemindersById
500
+ * @async
495
501
  * @since 5.3.0
496
502
  * @platform iOS
497
503
  * @permissions
@@ -522,7 +528,7 @@ export interface CapacitorCalendarPlugin {
522
528
  /**
523
529
  * Requests write access for the calendar. If its already granted, it will directly return the state.
524
530
  *
525
- * @method requestWriteOnlyCalendarAccess
531
+ * @async
526
532
  * @since 5.4.0
527
533
  * @platform iOS, Android
528
534
  * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the write access permission.
@@ -535,7 +541,7 @@ export interface CapacitorCalendarPlugin {
535
541
  /**
536
542
  * Requests read access for the calendar. If its already granted, it will directly return the state.
537
543
  *
538
- * @method requestReadOnlyCalendarAccess
544
+ * @async
539
545
  * @since 5.4.0
540
546
  * @platform Android
541
547
  * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the read access permission.
@@ -548,7 +554,7 @@ export interface CapacitorCalendarPlugin {
548
554
  /**
549
555
  * Requests read and write access for the calendar. If its already granted, it will directly return the state.
550
556
  *
551
- * @method requestFullCalendarAccess
557
+ * @async
552
558
  * @since 5.4.0
553
559
  * @platform iOS, Android
554
560
  * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.
@@ -561,7 +567,7 @@ export interface CapacitorCalendarPlugin {
561
567
  /**
562
568
  * Requests read and write access for the reminders. If its already granted, it will directly return the state.
563
569
  *
564
- * @method requestFullRemindersAccess
570
+ * @async
565
571
  * @since 5.4.0
566
572
  * @platform iOS
567
573
  * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.
@@ -571,4 +577,128 @@ export interface CapacitorCalendarPlugin {
571
577
  requestFullRemindersAccess(): Promise<{
572
578
  result: PermissionState;
573
579
  }>;
580
+ /**
581
+ * Opens a native prompt to modify an event given its id.
582
+ *
583
+ * @async
584
+ * @since 5.6.0
585
+ * @platform iOS, Android
586
+ * @permissions
587
+ * <h3>Runtime Permissions:</h3>
588
+ * <ul>
589
+ * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
590
+ * <li><strong>Android:</strong> writeCalendar, readCalendar</li>
591
+ * </ul>
592
+ * @param {Object} options The options for modifying an event.
593
+ * @param {string} options.id The id of the event to be modified.
594
+ * @param {object} options.update The set of event properties to be modified. (Optional)
595
+ * If a property is not supported, it will be ignored. Setting alerts with prompt
596
+ * is only supported on iOS.
597
+ * @returns {Promise<{ result: string[] }>} On iOS, the promise resolves with an array containing
598
+ * the initial event id if the modifications were saved and empty if it was cancelled. However, on
599
+ * Android the array will be empty either way.
600
+ * @throws {Error} throws an error if an event for the given id is not found.
601
+ * @example
602
+ * const { result } = await CapacitorCalendar.modifyEventWithPrompt({
603
+ * id: 'EVENT_ID_ONE',
604
+ * update: {
605
+ * title: 'newTitle',
606
+ * startDate: Date.now(),
607
+ * },
608
+ * });
609
+ *
610
+ * console.log(result); // ['EVENT_ID_ONE'] or [] if on Android
611
+ */
612
+ modifyEventWithPrompt(options: {
613
+ id: string;
614
+ update?: {
615
+ title?: string;
616
+ calendarId?: string;
617
+ location?: string;
618
+ startDate?: number;
619
+ endDate?: number;
620
+ isAllDay?: boolean;
621
+ alertOffsetInMinutes?: number | number[];
622
+ url?: string;
623
+ notes?: string;
624
+ };
625
+ }): Promise<{
626
+ result: string[];
627
+ }>;
628
+ /**
629
+ * Modifies an event given its id and update details.
630
+ *
631
+ * @async
632
+ * @since 5.6.0
633
+ * @platform iOS, Android
634
+ * @permissions
635
+ * <h3>Runtime Permissions:</h3>
636
+ * <ul>
637
+ * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
638
+ * <li><strong>Android:</strong> writeCalendar, readCalendar</li>
639
+ * </ul>
640
+ * @param {Object} options The options for updating an event.
641
+ * @param {string} options.id The id of the event to be modified.
642
+ * @param {EventSpan} options.span The scope of the modifications.
643
+ * Only supported on iOS. (Optional)
644
+ * @param {Object} options.update The set of event properties to be modified.
645
+ * If a property is not supported, it will be ignored. Modifying the reminder of an
646
+ * event is currently not supported on Android.
647
+ * @returns {Promise<void>} A promise that resolves when the update operation is complete.
648
+ * @throws {Error} throws an error if an event for the given id is not found.
649
+ * @example
650
+ * const { result } = await CapacitorCalendar.modifyEvent({
651
+ * id: 'EVENT_ID_ONE',
652
+ * span: EventSpan.THIS_SPAN,
653
+ * update: {
654
+ * title: 'newTitle',
655
+ * startDate: Date.now(),
656
+ * },
657
+ * });
658
+ */
659
+ modifyEvent(options: {
660
+ id: string;
661
+ span?: EventSpan;
662
+ update: {
663
+ title?: string;
664
+ calendarId?: string;
665
+ location?: string;
666
+ startDate?: number;
667
+ endDate?: number;
668
+ isAllDay?: boolean;
669
+ alertOffsetInMinutes?: number | number[];
670
+ url?: string;
671
+ notes?: string;
672
+ };
673
+ }): Promise<void>;
674
+ /**
675
+ * Retrieves a list of calendar sources.
676
+ *
677
+ * @async
678
+ * @since 6.6.0
679
+ * @platform iOS
680
+ * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of
681
+ * calendar sources.
682
+ * @example
683
+ * const { result } = await fetchAllCalendarSources();
684
+ * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]
685
+ */
686
+ fetchAllCalendarSources(): Promise<{
687
+ result: CalendarSource[];
688
+ }>;
689
+ /**
690
+ * Retrieves a list of reminders sources.
691
+ *
692
+ * @async
693
+ * @since 6.6.0
694
+ * @platform iOS
695
+ * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of
696
+ * reminders sources.
697
+ * @example
698
+ * const { result } = await fetchAllRemindersSources();
699
+ * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]
700
+ */
701
+ fetchAllRemindersSources(): Promise<{
702
+ result: CalendarSource[];
703
+ }>;
574
704
  }
@@ -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';\nimport type { Reminder } from './schemas/interfaces/reminder';\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method checkPermission\n * @since 0.1.0\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} A promise that resolves with the current status of the requested permission.\n * @example\n * const { result } = 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 checkAllPermissions\n * @since 0.1.0\n * @platform iOS, Android\n * @returns {Promise&lt;PluginPermissionsMap&gt;} A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<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 requestPermission\n * @since 0.1.0\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} A promise that resolves with the new permission status after the request is made.\n * @example\n * const { result } = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: 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 requestAllPermissions\n * @since 0.1.0\n * @platform iOS, Android\n * @returns {Promise&lt;PluginPermissionsMap&gt;} A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<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] If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * The parameter is not supported on Android. Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (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, 30],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin',\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: [0, 1440],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\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 | number[];\n url?: string;\n notes?: string;\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 * @since 0.3.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 * @returns {Promise<{ result: Calendar | null }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title. Returns null if there is no default calendar found.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar | null }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @since 0.4.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> 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. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (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 * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\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 | number[];\n url?: string;\n notes?: string;\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 /**\n * Retrieves the list of reminders present in the given date range.\n *\n * @method getRemindersFromLists\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readReminders</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * It Will fetch all reminders from all available lists if not provided. (Optional)\n * @param {string[]} options.listIds An array of reminder list ids.\n * @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.\n * @example\n * const now = Date.now();\n * const { result } = await CapacitorCalendar.getRemindersFromLists({\n * listIds: ['LIST_ID_1', 'LIST_ID_2'],\n * });\n */\n getRemindersFromLists(options?: { listIds: string[] }): Promise<{ result: Reminder[] }>;\n\n /**\n * Deletes reminders given their IDs.\n *\n * @method deleteRemindersById\n * @since 5.3.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 defining reminder IDs.\n * @param {number} options.ids An array of reminder 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.deleteRemindersById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteRemindersById(options: { ids: string[] }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Requests write access for the calendar. If its already granted, it will directly return the state.\n *\n * @method requestWriteOnlyCalendarAccess\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the write access permission.\n * @example\n * const { result } = await this.requestWriteOnlyCalendarAccess();\n */\n requestWriteOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read access for the calendar. If its already granted, it will directly return the state.\n *\n * @method requestReadOnlyCalendarAccess\n * @since 5.4.0\n * @platform Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the read access permission.\n * @example\n * const { result } = await this.requestReadOnlyCalendarAccess();\n */\n requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the calendar. If its already granted, it will directly return the state.\n *\n * @method requestFullCalendarAccess\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullCalendarAccess();\n */\n requestFullCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the reminders. If its already granted, it will directly return the state.\n *\n * @method requestFullRemindersAccess\n * @since 5.4.0\n * @platform iOS\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullRemindersAccess();\n */\n requestFullRemindersAccess(): Promise<{ result: PermissionState }>;\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 { EventSpan } from \"./schemas/enums/event-span\";\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\";\nimport type { Reminder } from \"./schemas/interfaces/reminder\";\nimport type { CalendarSource } from \"./schemas/interfaces/calendar-source\";\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @async\n * @since 0.1.0\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} A promise that resolves with the current status of the requested permission.\n * @example\n * const { result } = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @async\n * @since 0.1.0\n * @platform iOS, Android\n * @returns {Promise&lt;PluginPermissionsMap&gt;} A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<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 * @async\n * @since 0.1.0\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} A promise that resolves with the new permission status after the request is made.\n * @example\n * const { result } = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: {\n alias: PluginPermission;\n }): 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 * @async\n * @since 0.1.0\n * @platform iOS, Android\n * @returns {Promise&lt;PluginPermissionsMap&gt;} A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<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 * @async\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] If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * The parameter is not supported on Android. Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (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, 30],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin',\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: [0, 1440],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\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 | number[];\n url?: string;\n notes?: string;\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 * @async\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 * @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 * @async\n * @since 0.3.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 * @returns {Promise<{ result: Calendar | null }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title. Returns null if there is no default calendar found.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar | null }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @async\n * @since 0.4.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> 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. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (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 * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\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 | number[];\n url?: string;\n notes?: string;\n }): Promise<{ result: string }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @async\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 * @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 * @async\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 * @async\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 * @async\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 * @async\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: {\n startDate: number;\n endDate: number;\n }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @async\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: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Creates a calendar\n *\n * @async\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 * @param {string} options.sourceId The id of the source of the calendar.\n * If not provided, the source of the default calendar will be used. It is\n * recommended to use fetchAllCalendarSources method to fetch the id of the\n * desired source type.\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 * sourceId: 'local-source-id',\n * });\n * console.log(result); // 'CALENDAR_ID'\n */\n createCalendar(options: {\n title: string;\n color?: string;\n sourceId?: string;\n }): Promise<{ result: string }>;\n\n /**\n * Deletes a calendar by id\n *\n * @async\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 /**\n * Retrieves the list of reminders present in the given date range.\n *\n * @async\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readReminders</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * It Will fetch all reminders from all available lists if not provided. (Optional)\n * @param {string[]} options.listIds An array of reminder list ids.\n * @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.\n * @example\n * const now = Date.now();\n * const { result } = await CapacitorCalendar.getRemindersFromLists({\n * listIds: ['LIST_ID_1', 'LIST_ID_2'],\n * });\n */\n getRemindersFromLists(options?: {\n listIds: string[];\n }): Promise<{ result: Reminder[] }>;\n\n /**\n * Deletes reminders given their IDs.\n *\n * @async\n * @since 5.3.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 defining reminder IDs.\n * @param {number} options.ids An array of reminder 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.deleteRemindersById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteRemindersById(options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Requests write access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the write access permission.\n * @example\n * const { result } = await this.requestWriteOnlyCalendarAccess();\n */\n requestWriteOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the read access permission.\n * @example\n * const { result } = await this.requestReadOnlyCalendarAccess();\n */\n requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullCalendarAccess();\n */\n requestFullCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the reminders. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullRemindersAccess();\n */\n requestFullRemindersAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Opens a native prompt to modify an event given its id.\n *\n * @async\n * @since 5.6.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * <li><strong>Android:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @param {Object} options The options for modifying an event.\n * @param {string} options.id The id of the event to be modified.\n * @param {object} options.update The set of event properties to be modified. (Optional)\n * If a property is not supported, it will be ignored. Setting alerts with prompt\n * is only supported on iOS.\n * @returns {Promise<{ result: string[] }>} On iOS, the promise resolves with an array containing\n * the initial event id if the modifications were saved and empty if it was cancelled. However, on\n * Android the array will be empty either way.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.modifyEventWithPrompt({\n * id: 'EVENT_ID_ONE',\n * update: {\n * title: 'newTitle',\n * startDate: Date.now(),\n * },\n * });\n *\n * console.log(result); // ['EVENT_ID_ONE'] or [] if on Android\n */\n modifyEventWithPrompt(options: {\n id: string;\n update?: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<{ result: string[] }>;\n\n /**\n * Modifies an event given its id and update details.\n *\n * @async\n * @since 5.6.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * <li><strong>Android:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @param {Object} options The options for updating an event.\n * @param {string} options.id The id of the event to be modified.\n * @param {EventSpan} options.span The scope of the modifications.\n * Only supported on iOS. (Optional)\n * @param {Object} options.update The set of event properties to be modified.\n * If a property is not supported, it will be ignored. Modifying the reminder of an\n * event is currently not supported on Android.\n * @returns {Promise<void>} A promise that resolves when the update operation is complete.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.modifyEvent({\n * id: 'EVENT_ID_ONE',\n * span: EventSpan.THIS_SPAN,\n * update: {\n * title: 'newTitle',\n * startDate: Date.now(),\n * },\n * });\n */\n modifyEvent(options: {\n id: string;\n span?: EventSpan;\n update: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<void>;\n\n /**\n * Retrieves a list of calendar sources.\n *\n * @async\n * @since 6.6.0\n * @platform iOS\n * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of\n * calendar sources.\n * @example\n * const { result } = await fetchAllCalendarSources();\n * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]\n */\n fetchAllCalendarSources(): Promise<{ result: CalendarSource[] }>;\n\n /**\n * Retrieves a list of reminders sources.\n *\n * @async\n * @since 6.6.0\n * @platform iOS\n * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of\n * reminders sources.\n * @example\n * const { result } = await fetchAllRemindersSources();\n * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]\n */\n fetchAllRemindersSources(): Promise<{ result: CalendarSource[] }>;\n}\n"]}
@@ -1,15 +1,19 @@
1
- import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';
2
- import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';
3
- import { PluginPermission } from './schemas/enums/plugin-permission';
4
- import { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';
5
- import type { CapacitorCalendarPlugin } from './definitions';
6
- import type { Calendar } from './schemas/interfaces/calendar';
7
- import type { RemindersList } from './schemas/interfaces/reminders-list';
8
- import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
9
- import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';
10
- import type { CalendarEvent } from './schemas/interfaces/calendar-event';
11
- import type { Reminder } from './schemas/interfaces/reminder';
1
+ import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style";
2
+ import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style";
3
+ import { PluginPermission } from "./schemas/enums/plugin-permission";
4
+ import { ReminderRecurrenceFrequency } from "./schemas/enums/reminder-recurrence-frequency";
5
+ import { EventSpan } from "./schemas/enums/event-span";
6
+ import { CalendarSourceType } from "./schemas/enums/calendar-source-type";
7
+ import { CalendarType } from "./schemas/enums/calendar-type";
8
+ import type { CapacitorCalendarPlugin } from "./definitions";
9
+ import type { Calendar } from "./schemas/interfaces/calendar";
10
+ import type { RemindersList } from "./schemas/interfaces/reminders-list";
11
+ import type { PluginPermissionsMap } from "./schemas/interfaces/plugin-permissions-map";
12
+ import type { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule";
13
+ import type { CalendarEvent } from "./schemas/interfaces/calendar-event";
14
+ import type { Reminder } from "./schemas/interfaces/reminder";
15
+ import type { CalendarSource } from "./schemas/interfaces/calendar-source";
12
16
  declare const CapacitorCalendar: CapacitorCalendarPlugin;
13
- export * from './definitions';
14
- export type { Calendar, RemindersList, ReminderRecurrenceRule };
15
- export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CalendarEvent, Reminder, CapacitorCalendar, };
17
+ export * from "./definitions";
18
+ export type { Calendar, RemindersList, ReminderRecurrenceRule, CalendarSource };
19
+ export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CalendarEvent, Reminder, EventSpan, CalendarSourceType, CalendarType, CapacitorCalendar, };
package/dist/esm/index.js CHANGED
@@ -1,11 +1,14 @@
1
- import { registerPlugin } from '@capacitor/core';
2
- import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';
3
- import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';
4
- import { PluginPermission } from './schemas/enums/plugin-permission';
5
- import { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';
6
- const CapacitorCalendar = registerPlugin('CapacitorCalendar', {
7
- web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),
1
+ import { registerPlugin } from "@capacitor/core";
2
+ import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style";
3
+ import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style";
4
+ import { PluginPermission } from "./schemas/enums/plugin-permission";
5
+ import { ReminderRecurrenceFrequency } from "./schemas/enums/reminder-recurrence-frequency";
6
+ import { EventSpan } from "./schemas/enums/event-span";
7
+ import { CalendarSourceType } from "./schemas/enums/calendar-source-type";
8
+ import { CalendarType } from "./schemas/enums/calendar-type";
9
+ const CapacitorCalendar = registerPlugin("CapacitorCalendar", {
10
+ web: () => import("./web").then((m) => new m.CapacitorCalendarWeb()),
8
11
  });
9
- export * from './definitions';
10
- export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };
12
+ export * from "./definitions";
13
+ export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, EventSpan, CalendarSourceType, CalendarType, CapacitorCalendar, };
11
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAS5F,MAAM,iBAAiB,GAAG,cAAc,CAA0B,mBAAmB,EAAE;IACrF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAEhB,2BAA2B,EAG3B,iBAAiB,GAClB,CAAC","sourcesContent":["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';\nimport type { CapacitorCalendarPlugin } from './definitions';\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';\nimport type { Reminder } from './schemas/interfaces/reminder';\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\n\nexport * from './definitions';\nexport type { Calendar, RemindersList, ReminderRecurrenceRule };\nexport {\n CalendarChooserSelectionStyle,\n CalendarChooserDisplayStyle,\n PluginPermission,\n PluginPermissionsMap,\n ReminderRecurrenceFrequency,\n CalendarEvent,\n Reminder,\n CapacitorCalendar,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAU7D,MAAM,iBAAiB,GAAG,cAAc,CACtC,mBAAmB,EACnB;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CACF,CAAC;AAEF,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAEhB,2BAA2B,EAG3B,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,GAClB,CAAC","sourcesContent":["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\";\nimport { EventSpan } from \"./schemas/enums/event-span\";\nimport { CalendarSourceType } from \"./schemas/enums/calendar-source-type\";\nimport { CalendarType } from \"./schemas/enums/calendar-type\";\nimport type { CapacitorCalendarPlugin } from \"./definitions\";\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\";\nimport type { Reminder } from \"./schemas/interfaces/reminder\";\nimport type { CalendarSource } from \"./schemas/interfaces/calendar-source\";\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>(\n \"CapacitorCalendar\",\n {\n web: () => import(\"./web\").then((m) => new m.CapacitorCalendarWeb()),\n },\n);\n\nexport * from \"./definitions\";\nexport type { Calendar, RemindersList, ReminderRecurrenceRule, CalendarSource };\nexport {\n CalendarChooserSelectionStyle,\n CalendarChooserDisplayStyle,\n PluginPermission,\n PluginPermissionsMap,\n ReminderRecurrenceFrequency,\n CalendarEvent,\n Reminder,\n EventSpan,\n CalendarSourceType,\n CalendarType,\n CapacitorCalendar,\n};\n"]}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Represents the different types of sources from which calendars can originate.
3
+ *
4
+ * @enum CalendarSourceType
5
+ * @platform iOS
6
+ */
7
+ export declare enum CalendarSourceType {
8
+ /**
9
+ * Calendars that are stored locally on the device. These calendars are not
10
+ * synced with any external service.
11
+ */
12
+ LOCAL = 0,
13
+ /**
14
+ * Calendars that are associated with an Exchange server. Exchange is a
15
+ * popular calendar and email service used by many enterprises.
16
+ */
17
+ EXCHANGE = 1,
18
+ /**
19
+ * Calendars that use the CalDAV protocol for synchronization.
20
+ * This includes calendars from services like Google Calendar and Yahoo Calendar.
21
+ */
22
+ CAL_DAV = 2,
23
+ /**
24
+ * Calendars that were previously associated with MobileMe, Apple's cloud
25
+ * service before iCloud. This source type is largely obsolete now.
26
+ */
27
+ MOBILE_ME = 3,
28
+ /**
29
+ * Calendars that the user has subscribed to. These are read-only calendars
30
+ * that can be added by subscribing to a calendar URL.
31
+ */
32
+ SUBSCRIBED = 4,
33
+ /**
34
+ * The built-in Birthdays calendar, which shows birthdays of contacts from the user's address book.
35
+ * This calendar is typically read-only and is managed by the system.
36
+ */
37
+ BIRTHDAYS = 5
38
+ }