@ebarooni/capacitor-calendar 6.6.0 → 6.6.1

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 CHANGED
@@ -107,11 +107,11 @@ The video is just for showing the functionality, otherwise the `createEventWithP
107
107
 
108
108
  ## Permissions
109
109
 
110
- To be able to use the plugin, you will need to add the required permissions to your app. The required platform-specific
111
- permissions can be found below:
110
+ To be able to use the plugin, you will need to add the required usage descriptions to your app. The required platform-specific
111
+ usage descriptions can be found below:
112
112
 
113
- - [iOS](./ios/PERMISSIONS.md)
114
- - [Android](./android/PERMISSIONS.md)
113
+ - [iOS](./docs/usage-descriptions/ios.md)
114
+ - [Android](./docs/usage-descriptions/android.md)
115
115
 
116
116
  ## 📋 API
117
117
 
@@ -153,10 +153,11 @@ permissions can be found below:
153
153
 
154
154
  ## 📚 Documentation
155
155
 
156
- For detailed explanations, usage examples, and additional information:
156
+ For comprehensive explanations, usage examples, and additional information, please refer to the following resources:
157
157
 
158
- - **documentation.md**: Autogenerated docs are available in the [documentation](documentation.md) file.
159
- - **definitions.ts**: Complete documentation with usage examples is available in the [src/definitions.ts](src/definitions.ts) file.
158
+ - **[Online Documentation](https://ebarooni.github.io/capacitor-calendar/)**
159
+ - **[API Reference](docs/api-reference.md)**
160
+ - **[Type Definitions and Examples](src/definitions.ts)**
160
161
 
161
162
  ## 💙 Contributions
162
163
 
package/dist/docs.json CHANGED
@@ -926,7 +926,7 @@
926
926
  },
927
927
  {
928
928
  "name": "since",
929
- "text": "5.6.0"
929
+ "text": "6.6.0"
930
930
  },
931
931
  {
932
932
  "name": "platform",
@@ -974,7 +974,7 @@
974
974
  },
975
975
  {
976
976
  "name": "since",
977
- "text": "5.6.0"
977
+ "text": "6.6.0"
978
978
  },
979
979
  {
980
980
  "name": "platform",
@@ -1024,6 +1024,10 @@
1024
1024
  "name": "platform",
1025
1025
  "text": "iOS"
1026
1026
  },
1027
+ {
1028
+ "name": "permissions",
1029
+ "text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n</ul>"
1030
+ },
1027
1031
  {
1028
1032
  "name": "returns",
1029
1033
  "text": "A promise that resolves with an array of\ncalendar sources."
@@ -1056,6 +1060,10 @@
1056
1060
  "name": "platform",
1057
1061
  "text": "iOS"
1058
1062
  },
1063
+ {
1064
+ "name": "permissions",
1065
+ "text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n</ul>"
1066
+ },
1059
1067
  {
1060
1068
  "name": "returns",
1061
1069
  "text": "A promise that resolves with an array of\nreminders sources."
@@ -581,7 +581,7 @@ export interface CapacitorCalendarPlugin {
581
581
  * Opens a native prompt to modify an event given its id.
582
582
  *
583
583
  * @async
584
- * @since 5.6.0
584
+ * @since 6.6.0
585
585
  * @platform iOS, Android
586
586
  * @permissions
587
587
  * <h3>Runtime Permissions:</h3>
@@ -629,7 +629,7 @@ export interface CapacitorCalendarPlugin {
629
629
  * Modifies an event given its id and update details.
630
630
  *
631
631
  * @async
632
- * @since 5.6.0
632
+ * @since 6.6.0
633
633
  * @platform iOS, Android
634
634
  * @permissions
635
635
  * <h3>Runtime Permissions:</h3>
@@ -677,6 +677,11 @@ export interface CapacitorCalendarPlugin {
677
677
  * @async
678
678
  * @since 6.6.0
679
679
  * @platform iOS
680
+ * @permissions
681
+ * <h3>Runtime Permissions:</h3>
682
+ * <ul>
683
+ * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
684
+ * </ul>
680
685
  * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of
681
686
  * calendar sources.
682
687
  * @example
@@ -692,6 +697,11 @@ export interface CapacitorCalendarPlugin {
692
697
  * @async
693
698
  * @since 6.6.0
694
699
  * @platform iOS
700
+ * @permissions
701
+ * <h3>Runtime Permissions:</h3>
702
+ * <ul>
703
+ * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
704
+ * </ul>
695
705
  * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of
696
706
  * reminders sources.
697
707
  * @example
@@ -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 { 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
+ {"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 6.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 6.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 * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * </ul>\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 * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * </ul>\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"]}
@@ -611,7 +611,7 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
611
611
  dict["eventColor"] = hexStringFromColor(color: color)
612
612
  }
613
613
  if let url = event.url {
614
- dict["url"] = url
614
+ dict["url"] = url.absoluteString
615
615
  }
616
616
  dict["isAllDay"] = event.isAllDay
617
617
  dict["calendarId"] = event.calendar.calendarIdentifier
@@ -343,7 +343,7 @@ public class CapacitorReminders: NSObject {
343
343
  dict["title"] = title
344
344
  }
345
345
  if let url = event.url {
346
- dict["url"] = url
346
+ dict["url"] = url.absoluteString
347
347
  }
348
348
  if let notes = event.notes {
349
349
  dict["notes"] = notes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebarooni/capacitor-calendar",
3
- "version": "6.6.0",
3
+ "version": "6.6.1",
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",
@@ -59,10 +59,11 @@
59
59
  "fmt:md": "npx prettier --write \"**/*.md\"",
60
60
  "fmt:kt": "npm run ktlint -- -F",
61
61
  "fmt": "npm run fmt:ts-html && npm run fmt:css && npm run fmt:swift && npm run fmt:md && npm run fmt:kt",
62
- "docgen:api": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json",
62
+ "docgen:api-reference": "docgen --api CapacitorCalendarPlugin --output-readme docs/api-reference.md --output-json dist/docs.json",
63
63
  "docgen:readme": "docgen --api CapacitorCalendarPlugin --output-readme README.md",
64
+ "typedoc:index": "npx typedoc",
64
65
  "clean": "rm -rf ./dist",
65
- "build": "npm run clean && npm run docgen:api && npm run docgen:readme && tsc && rollup -c rollup.config.mjs",
66
+ "build": "npm run clean && npm run docgen:api-reference && npm run docgen:readme && tsc && rollup -c rollup.config.mjs",
66
67
  "prepublishOnly": "npm run build",
67
68
  "serve": "cd example && npx ng serve"
68
69
  },
@@ -73,7 +74,7 @@
73
74
  "@capacitor/core": "^6.0.0",
74
75
  "@capacitor/docgen": "^0.0.18",
75
76
  "@capacitor/ios": "^6.0.0",
76
- "@ebarooni/eslint-config": "^1.0.0",
77
+ "@ebarooni/eslint-config": "^1.0.1",
77
78
  "@ebarooni/prettier-config": "^1.1.0",
78
79
  "@ebarooni/stylelint-config": "^1.1.0",
79
80
  "@ebarooni/swiftlint-config": "^1.1.0",
@@ -90,8 +91,9 @@
90
91
  "stylelint-config-standard-scss": "^13.1.0",
91
92
  "stylelint-prettier": "^5.0.0",
92
93
  "swiftlint": "^1.0.2",
94
+ "typedoc": "^0.26.5",
93
95
  "typescript": "~5.4.2",
94
- "typescript-eslint": "^8.0.0-alpha.20"
96
+ "typescript-eslint": "^8.0.1"
95
97
  },
96
98
  "peerDependencies": {
97
99
  "@capacitor/core": "^6.0.0"