@ebarooni/capacitor-calendar 6.7.2 → 7.1.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 (255) hide show
  1. package/EbarooniCapacitorCalendar.podspec +2 -2
  2. package/Package.swift +28 -0
  3. package/README.md +1197 -119
  4. package/android/build.gradle +8 -7
  5. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +267 -317
  6. package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +47 -0
  7. package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +348 -0
  8. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/CalendarEvent.kt +25 -0
  9. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/CalendarInfo.kt +14 -0
  10. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventGuest.kt +9 -0
  11. package/android/src/main/java/dev/barooni/capacitor/calendar/models/enums/CalendarPermissionScope.kt +15 -0
  12. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CheckPermissionInput.kt +20 -0
  13. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateCalendarInput.kt +18 -0
  14. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventInput.kt +27 -0
  15. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventWithPromptInput.kt +36 -0
  16. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteCalendarInput.kt +10 -0
  17. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventInput.kt +10 -0
  18. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventWithPromptInput.kt +14 -0
  19. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventsByIdInput.kt +11 -0
  20. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ListEventsInRangeInput.kt +14 -0
  21. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEvent.kt +25 -0
  22. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEventWithPromptInput.kt +37 -0
  23. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/OpenCalendarInput.kt +10 -0
  24. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/RequestAllPermissionsInput.kt +9 -0
  25. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/RequestPermissionInput.kt +40 -0
  26. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CheckAllPermissionsResult.kt +17 -0
  27. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CheckPermissionResult.kt +15 -0
  28. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CreateCalendarResult.kt +21 -0
  29. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CreateEventResult.kt +21 -0
  30. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CreateEventWithPromptResult.kt +12 -0
  31. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/DeleteEventWithPromptResult.kt +14 -0
  32. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/DeleteEventsByIdResult.kt +27 -0
  33. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/GetDefaultCalendarResult.kt +34 -0
  34. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListCalendarsResult.kt +39 -0
  35. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListEventsInRangeResult.kt +58 -0
  36. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ModifyEventWithPromptResult.kt +12 -0
  37. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/RequestAllPermissionsResult.kt +30 -0
  38. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/RequestPermissionResult.kt +42 -0
  39. package/android/src/main/java/dev/barooni/capacitor/calendar/models/templates/JSResult.kt +7 -0
  40. package/android/src/main/java/dev/barooni/capacitor/calendar/utils/ImplementationHelper.kt +387 -0
  41. package/dist/docs.json +3808 -1126
  42. package/dist/esm/definitions.d.ts +6 -759
  43. package/dist/esm/definitions.js.map +1 -1
  44. package/dist/esm/index.d.ts +40 -12
  45. package/dist/esm/index.js +11 -6
  46. package/dist/esm/index.js.map +1 -1
  47. package/dist/esm/schemas/enums/attendee-role.d.ts +50 -0
  48. package/dist/esm/schemas/enums/attendee-role.js +52 -0
  49. package/dist/esm/schemas/enums/attendee-role.js.map +1 -0
  50. package/dist/esm/schemas/enums/attendee-status.d.ts +55 -0
  51. package/dist/esm/schemas/enums/attendee-status.js +57 -0
  52. package/dist/esm/schemas/enums/attendee-status.js.map +1 -0
  53. package/dist/esm/schemas/enums/attendee-type.d.ts +45 -0
  54. package/dist/esm/schemas/enums/attendee-type.js +47 -0
  55. package/dist/esm/schemas/enums/attendee-type.js.map +1 -0
  56. package/dist/esm/schemas/enums/calendar-chooser-display-style.d.ts +3 -6
  57. package/dist/esm/schemas/enums/calendar-chooser-display-style.js +3 -6
  58. package/dist/esm/schemas/enums/calendar-chooser-display-style.js.map +1 -1
  59. package/dist/esm/schemas/enums/calendar-permission-scope.d.ts +60 -0
  60. package/dist/esm/schemas/enums/calendar-permission-scope.js +62 -0
  61. package/dist/esm/schemas/enums/calendar-permission-scope.js.map +1 -0
  62. package/dist/esm/schemas/enums/calendar-source-type.d.ts +7 -16
  63. package/dist/esm/schemas/enums/calendar-source-type.js +7 -16
  64. package/dist/esm/schemas/enums/calendar-source-type.js.map +1 -1
  65. package/dist/esm/schemas/enums/calendar-type.d.ts +6 -9
  66. package/dist/esm/schemas/enums/calendar-type.js +6 -9
  67. package/dist/esm/schemas/enums/calendar-type.js.map +1 -1
  68. package/dist/esm/schemas/enums/event-availability.d.ts +30 -0
  69. package/dist/esm/schemas/enums/event-availability.js +32 -0
  70. package/dist/esm/schemas/enums/event-availability.js.map +1 -0
  71. package/dist/esm/schemas/enums/event-span.d.ts +3 -6
  72. package/dist/esm/schemas/enums/event-span.js +3 -6
  73. package/dist/esm/schemas/enums/event-span.js.map +1 -1
  74. package/dist/esm/schemas/enums/event-status.d.ts +26 -0
  75. package/dist/esm/schemas/enums/event-status.js +28 -0
  76. package/dist/esm/schemas/enums/event-status.js.map +1 -0
  77. package/dist/esm/schemas/enums/recurrence-frequency.d.ts +21 -0
  78. package/dist/esm/schemas/enums/recurrence-frequency.js +23 -0
  79. package/dist/esm/schemas/enums/recurrence-frequency.js.map +1 -0
  80. package/dist/esm/schemas/enums/reminder-recurrence-frequency.d.ts +5 -8
  81. package/dist/esm/schemas/enums/reminder-recurrence-frequency.js +5 -8
  82. package/dist/esm/schemas/enums/reminder-recurrence-frequency.js.map +1 -1
  83. package/dist/esm/schemas/interfaces/calendar-event.d.ts +116 -48
  84. package/dist/esm/schemas/interfaces/calendar-event.js.map +1 -1
  85. package/dist/esm/schemas/interfaces/calendar-source.d.ts +10 -7
  86. package/dist/esm/schemas/interfaces/calendar-source.js.map +1 -1
  87. package/dist/esm/schemas/interfaces/calendar.d.ts +59 -25
  88. package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
  89. package/dist/esm/schemas/interfaces/create-calendar-options.d.ts +38 -0
  90. package/dist/esm/schemas/interfaces/create-calendar-options.js +2 -0
  91. package/dist/esm/schemas/interfaces/create-calendar-options.js.map +1 -0
  92. package/dist/esm/schemas/interfaces/create-event-options.d.ts +96 -0
  93. package/dist/esm/schemas/interfaces/create-event-options.js +2 -0
  94. package/dist/esm/schemas/interfaces/create-event-options.js.map +1 -0
  95. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.d.ts +70 -0
  96. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.js +2 -0
  97. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.js.map +1 -0
  98. package/dist/esm/schemas/interfaces/create-reminder-options.d.ts +54 -0
  99. package/dist/esm/schemas/interfaces/create-reminder-options.js +2 -0
  100. package/dist/esm/schemas/interfaces/create-reminder-options.js.map +1 -0
  101. package/dist/esm/schemas/interfaces/delete-calendar-options.d.ts +9 -0
  102. package/dist/esm/schemas/interfaces/delete-calendar-options.js +2 -0
  103. package/dist/esm/schemas/interfaces/delete-calendar-options.js.map +1 -0
  104. package/dist/esm/schemas/interfaces/delete-event-options.d.ts +18 -0
  105. package/dist/esm/schemas/interfaces/delete-event-options.js +2 -0
  106. package/dist/esm/schemas/interfaces/delete-event-options.js.map +1 -0
  107. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.d.ts +48 -0
  108. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js +2 -0
  109. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js.map +1 -0
  110. package/dist/esm/schemas/interfaces/delete-events-by-id-options.d.ts +18 -0
  111. package/dist/esm/schemas/interfaces/delete-events-by-id-options.js +2 -0
  112. package/dist/esm/schemas/interfaces/delete-events-by-id-options.js.map +1 -0
  113. package/dist/esm/schemas/interfaces/delete-reminder-options.d.ts +9 -0
  114. package/dist/esm/schemas/interfaces/delete-reminder-options.js +2 -0
  115. package/dist/esm/schemas/interfaces/delete-reminder-options.js.map +1 -0
  116. package/dist/esm/schemas/interfaces/delete-reminders-by-id-options.d.ts +9 -0
  117. package/dist/esm/schemas/interfaces/delete-reminders-by-id-options.js +2 -0
  118. package/dist/esm/schemas/interfaces/delete-reminders-by-id-options.js.map +1 -0
  119. package/dist/esm/schemas/interfaces/event-guest.d.ts +13 -0
  120. package/dist/esm/schemas/interfaces/event-guest.js +2 -0
  121. package/dist/esm/schemas/interfaces/event-guest.js.map +1 -0
  122. package/dist/esm/schemas/interfaces/get-reminder-by-id-options.d.ts +6 -0
  123. package/dist/esm/schemas/interfaces/get-reminder-by-id-options.js +2 -0
  124. package/dist/esm/schemas/interfaces/get-reminder-by-id-options.js.map +1 -0
  125. package/dist/esm/schemas/interfaces/get-reminders-from-lists-options.d.ts +9 -0
  126. package/dist/esm/schemas/interfaces/get-reminders-from-lists-options.js +2 -0
  127. package/dist/esm/schemas/interfaces/get-reminders-from-lists-options.js.map +1 -0
  128. package/dist/esm/schemas/interfaces/list-events-in-range-options.d.ts +17 -0
  129. package/dist/esm/schemas/interfaces/list-events-in-range-options.js +2 -0
  130. package/dist/esm/schemas/interfaces/list-events-in-range-options.js.map +1 -0
  131. package/dist/esm/schemas/interfaces/modify-event-options.d.ts +103 -0
  132. package/dist/esm/schemas/interfaces/modify-event-options.js +2 -0
  133. package/dist/esm/schemas/interfaces/modify-event-options.js.map +1 -0
  134. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.d.ts +13 -0
  135. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.js +2 -0
  136. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.js.map +1 -0
  137. package/dist/esm/schemas/interfaces/modify-reminder-options.d.ts +58 -0
  138. package/dist/esm/schemas/interfaces/modify-reminder-options.js +2 -0
  139. package/dist/esm/schemas/interfaces/modify-reminder-options.js.map +1 -0
  140. package/dist/esm/schemas/interfaces/open-calendar-options.d.ts +10 -0
  141. package/dist/esm/schemas/interfaces/open-calendar-options.js +2 -0
  142. package/dist/esm/schemas/interfaces/open-calendar-options.js.map +1 -0
  143. package/dist/esm/schemas/interfaces/recurrence-rule.d.ts +22 -0
  144. package/dist/esm/schemas/interfaces/recurrence-rule.js +2 -0
  145. package/dist/esm/schemas/interfaces/recurrence-rule.js.map +1 -0
  146. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.d.ts +7 -25
  147. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js.map +1 -1
  148. package/dist/esm/schemas/interfaces/reminder.d.ts +29 -38
  149. package/dist/esm/schemas/interfaces/reminder.js.map +1 -1
  150. package/dist/esm/schemas/interfaces/reminders-list.d.ts +5 -3
  151. package/dist/esm/schemas/interfaces/reminders-list.js.map +1 -1
  152. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.d.ts +18 -0
  153. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.js +2 -0
  154. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.js.map +1 -0
  155. package/dist/esm/schemas/types/event-edit-action.d.ts +4 -0
  156. package/dist/esm/schemas/types/event-edit-action.js +2 -0
  157. package/dist/esm/schemas/types/event-edit-action.js.map +1 -0
  158. package/dist/esm/sub-definitions/calendar-access.d.ts +114 -0
  159. package/dist/esm/sub-definitions/calendar-access.js +2 -0
  160. package/dist/esm/sub-definitions/calendar-access.js.map +1 -0
  161. package/dist/esm/sub-definitions/calendar-operations.d.ts +77 -0
  162. package/dist/esm/sub-definitions/calendar-operations.js +2 -0
  163. package/dist/esm/sub-definitions/calendar-operations.js.map +1 -0
  164. package/dist/esm/sub-definitions/event-operations.d.ts +111 -0
  165. package/dist/esm/sub-definitions/event-operations.js +2 -0
  166. package/dist/esm/sub-definitions/event-operations.js.map +1 -0
  167. package/dist/esm/sub-definitions/reminders-access.d.ts +22 -0
  168. package/dist/esm/sub-definitions/reminders-access.js +2 -0
  169. package/dist/esm/sub-definitions/reminders-access.js.map +1 -0
  170. package/dist/esm/sub-definitions/reminders-operations.d.ts +110 -0
  171. package/dist/esm/sub-definitions/reminders-operations.js +2 -0
  172. package/dist/esm/sub-definitions/reminders-operations.js.map +1 -0
  173. package/dist/esm/web.d.ts +86 -151
  174. package/dist/esm/web.js +67 -49
  175. package/dist/esm/web.js.map +1 -1
  176. package/dist/plugin.cjs.js +392 -172
  177. package/dist/plugin.cjs.js.map +1 -1
  178. package/dist/plugin.js +392 -172
  179. package/dist/plugin.js.map +1 -1
  180. package/ios/Sources/CapacitorCalendarPlugin/CapacitorCalendarPlugin.swift +348 -0
  181. package/ios/Sources/CapacitorCalendarPlugin/Implementation/CapacitorCalendar.swift +554 -0
  182. package/ios/Sources/CapacitorCalendarPlugin/Models/Enums/CAPPermissionState.swift +6 -0
  183. package/ios/Sources/CapacitorCalendarPlugin/Models/Enums/CalendarPermissionScope.swift +6 -0
  184. package/ios/Sources/CapacitorCalendarPlugin/Models/Enums/EventEditAction.swift +20 -0
  185. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CheckPermissionInput.swift +19 -0
  186. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CreateCalendarInput.swift +32 -0
  187. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CreateEventInput.swift +61 -0
  188. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CreateEventWithPromptInput.swift +89 -0
  189. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CreateReminderInput.swift +116 -0
  190. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/DeleteCalendarInput.swift +16 -0
  191. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/DeleteEventInput.swift +27 -0
  192. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/DeleteEventWithPromptInput.swift +57 -0
  193. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/DeleteEventsByIdInput.swift +27 -0
  194. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/DeleteReminderInput.swift +16 -0
  195. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/DeleteRemindersByIdInput.swift +16 -0
  196. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/GetReminderByIdInput.swift +16 -0
  197. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/GetRemindersFromListsInput.swift +24 -0
  198. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/ListEventsInRangeInput.swift +25 -0
  199. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/ModifyEventInput.swift +117 -0
  200. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/ModifyEventWithPromptInput.swift +83 -0
  201. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/ModifyReminderInput.swift +118 -0
  202. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/OpenCalendarInput.swift +17 -0
  203. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/RequestPermissionInput.swift +19 -0
  204. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/SelectCalendarsWithPromptInput.swift +32 -0
  205. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/CheckAllPermissionsResult.swift +15 -0
  206. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/CheckPermissionResult.swift +16 -0
  207. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/CreateCalendarResult.swift +18 -0
  208. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/CreateEventResult.swift +18 -0
  209. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/CreateEventWithPromptResult.swift +15 -0
  210. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/CreateReminderResult.swift +16 -0
  211. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/DeleteEventWithPromptResult.swift +15 -0
  212. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/DeleteEventsByIdResult.swift +23 -0
  213. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/DeleteRemindersByIdResult.swift +23 -0
  214. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/FetchAllCalendarSourcesResult.swift +16 -0
  215. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/GetDefaultCalendarResult.swift +16 -0
  216. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/GetReminderByIdResult.swift +20 -0
  217. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/GetRemindersFromListsResult.swift +16 -0
  218. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/ListCalendarsResult.swift +16 -0
  219. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/ListEventsInRangeResult.swift +16 -0
  220. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/ModifyEventWithPromptResult.swift +16 -0
  221. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/RequestAllPermissionsResult.swift +20 -0
  222. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/RequestPermissionResult.swift +15 -0
  223. package/ios/Sources/CapacitorCalendarPlugin/Models/Results/SelectCalendarsWithPromptResult.swift +16 -0
  224. package/ios/Sources/CapacitorCalendarPlugin/Models/Templates/JSResult.swift +5 -0
  225. package/ios/Sources/CapacitorCalendarPlugin/PluginConfig.swift +42 -0
  226. package/ios/Sources/CapacitorCalendarPlugin/PluginError.swift +87 -0
  227. package/ios/Sources/CapacitorCalendarPlugin/Utils/ImplementationHelper.swift +361 -0
  228. package/ios/Sources/CapacitorCalendarPlugin/Utils/UIColorFromHexExtension.swift +32 -0
  229. package/ios/Tests/CapacitorCalendarPluginTests/CapacitorCalendarPluginTests.swift +15 -0
  230. package/package.json +68 -72
  231. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +0 -358
  232. package/assets/images/text-logo.png +0 -0
  233. package/dist/esm/schemas/enums/calendar-chooser-selection-style.d.ts +0 -16
  234. package/dist/esm/schemas/enums/calendar-chooser-selection-style.js +0 -18
  235. package/dist/esm/schemas/enums/calendar-chooser-selection-style.js.map +0 -1
  236. package/dist/esm/schemas/enums/plugin-permission.d.ts +0 -58
  237. package/dist/esm/schemas/enums/plugin-permission.js +0 -60
  238. package/dist/esm/schemas/enums/plugin-permission.js.map +0 -1
  239. package/dist/esm/schemas/interfaces/plugin-permissions-map.d.ts +0 -4
  240. package/dist/esm/schemas/interfaces/plugin-permissions-map.js +0 -2
  241. package/dist/esm/schemas/interfaces/plugin-permissions-map.js.map +0 -1
  242. package/ios/Plugin/CapacitorCalendar.swift +0 -635
  243. package/ios/Plugin/CapacitorCalendarPlugin.h +0 -10
  244. package/ios/Plugin/CapacitorCalendarPlugin.m +0 -36
  245. package/ios/Plugin/CapacitorCalendarPlugin.swift +0 -648
  246. package/ios/Plugin/CapacitorCalendarPluginError.swift +0 -22
  247. package/ios/Plugin/CapacitorReminders.swift +0 -456
  248. package/ios/Plugin/EventCreationParameters.swift +0 -22
  249. package/ios/Plugin/EventDeleteResults.swift +0 -14
  250. package/ios/Plugin/Info.plist +0 -24
  251. package/ios/Plugin/PermissionState.swift +0 -16
  252. package/ios/Plugin/RecurrenceParameters.swift +0 -15
  253. package/ios/Plugin/ReminderCreationParameters.swift +0 -23
  254. package/ios/Plugin/UIColorExtensions.swift +0 -28
  255. /package/{LICENSE.txt → LICENSE} +0 -0
@@ -1,760 +1,7 @@
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";
13
- export interface CapacitorCalendarPlugin {
14
- /**
15
- * Checks the current authorization status of a specific permission.
16
- *
17
- * @async
18
- * @since 0.1.0
19
- * @platform iOS, Android
20
- * @param options An object with the name of the permission
21
- * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the current status of the requested permission.
22
- * @example
23
- * const { result } = await this.checkPermission({ alias: 'readCalendar' });
24
- */
25
- checkPermission(options: {
26
- alias: PluginPermission;
27
- }): Promise<{
28
- result: PermissionState;
29
- }>;
30
- /**
31
- * Checks the current authorization status of all the required permissions for the plugin.
32
- *
33
- * @async
34
- * @since 0.1.0
35
- * @platform iOS, Android
36
- * @returns {Promise&lt;PluginPermissionsMap&gt;} A promise that resolves with an object containing all the permissions and their status.
37
- * @example
38
- * const permissionsStatus = await this.checkAllPermissions();
39
- */
40
- checkAllPermissions(): Promise<PluginPermissionsMap>;
41
- /**
42
- * Requests authorization to a specific permission, if not already granted.
43
- * If the permission is already granted, it will directly return the status.
44
- *
45
- * @async
46
- * @since 0.1.0
47
- * @platform iOS, Android
48
- * @param options An object with the name of the permission
49
- * @returns {Promise&lt;{ result: PermissionState }&gt;} A promise that resolves with the new permission status after the request is made.
50
- * @example
51
- * const { result } = await this.requestPermission({ alias: 'readCalendar' });
52
- */
53
- requestPermission(options: {
54
- alias: PluginPermission;
55
- }): Promise<{
56
- result: PermissionState;
57
- }>;
58
- /**
59
- * Requests authorization to all the required permissions for the plugin, if they have not already been granted.
60
- *
61
- * @async
62
- * @since 0.1.0
63
- * @platform iOS, Android
64
- * @returns {Promise&lt;PluginPermissionsMap&gt;} A promise that resolves with the new permission statuses after the request is made.
65
- * @example
66
- * const permissionResults = await this.requestAllPermissions();
67
- */
68
- requestAllPermissions(): Promise<PluginPermissionsMap>;
69
- /**
70
- * Creates an event in the calendar by using the native calendar.
71
- * On iOS opens a native sheet and on Android opens an intent.
72
- *
73
- * @async
74
- * @since 0.1.0
75
- * @platform iOS, Android
76
- * @permissions
77
- * <h3>Runtime Permissions:</h3>
78
- * <ul>
79
- * <li><strong>Android:</strong> readCalendar</li>
80
- * </ul>
81
- * @param {object} options Options for creating the event.
82
- * @param {string} options.title The title of the event.
83
- * @param {string} options.calendarId The id of the destination calendar. (Optional)
84
- * @param {string} [options.location] The location of the event. (Optional)
85
- * @param {number} [options.startDate] The start date and time of the event. (Optional)
86
- * @param {number} [options.endDate] The end date and time of the event. (Optional)
87
- * @param {boolean} [options.isAllDay] Weather the event is for the entire day or not. (Optional)
88
- * @param {number} [options.alertOffsetInMinutes] If a number >= 0 is provided, an alert will be set for the event this many
89
- * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.
90
- * On iOS only the first two valid elements of the array are taken into account.
91
- * The parameter is not supported on Android. Negative values are ignored. (Optional)
92
- * @param {string} [options.url] The URL of the event. (Optional)
93
- * @param {string} [options.notes] The notes of the event. (Optional)
94
- * @param {boolean} [options.eventIdOptional] Only for Android. If set to true,
95
- * READ_CALENDAR permission is not needed to call the method. However, the method will not
96
- * return the id of the generated event and instead, the returned array will be empty (even if an event is successfully created).
97
- * The default value is false. This property is ignored on iOS as it is not relevant. (Optional)
98
- * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.
99
- * @example
100
- * if (capacitor.getPlatform() === 'android') {
101
- * await this.requestPermission({ alias: 'readCalendar' });
102
- * { result } = result = await this.createEventWithPrompt({
103
- * title: 'Title',
104
- * alertOffsetInMinutes: [5, 30],
105
- * url: 'https://capacitor-calendar.pages.dev',
106
- * notes: 'A CapacitorJS plugin',
107
- * });
108
- * } else {
109
- * { result } = result = await this.createEventWithPrompt({
110
- * title: 'Title',
111
- * alertOffsetInMinutes: [0, 1440],
112
- * url: 'https://capacitor-calendar.pages.dev',
113
- * notes: 'A CapacitorJS plugin'
114
- * });
115
- * }
116
- */
117
- createEventWithPrompt(options: {
118
- title: string;
119
- calendarId?: string;
120
- location?: string;
121
- startDate?: number;
122
- endDate?: number;
123
- isAllDay?: boolean;
124
- alertOffsetInMinutes?: number | number[];
125
- url?: string;
126
- notes?: string;
127
- eventIdOptional?: boolean;
128
- }): Promise<{
129
- result: string[];
130
- }>;
131
- /**
132
- * Presents a prompt to the user to select calendars. This method is available only on iOS.
133
- *
134
- * @async
135
- * @since 0.2.0
136
- * @platform iOS
137
- * @permissions
138
- * <h3>Runtime Permissions:</h3>
139
- * <ul>
140
- * <li><strong>iOS:</strong> writeCalendar</li>
141
- * </ul>
142
- * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.
143
- * @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.
144
- * @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.
145
- * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,
146
- * where each calendar object contains an ID and a title.
147
- * @example
148
- * if (capacitor.getPlatform() === 'ios') {
149
- * const { result } = await selectCalendarsWithPrompt();
150
- * console.log(result); // [{ id: '1', title: 'Work Calendar' }]
151
- * }
152
- */
153
- selectCalendarsWithPrompt(options: {
154
- displayStyle: CalendarChooserDisplayStyle;
155
- selectionStyle: CalendarChooserSelectionStyle;
156
- }): Promise<{
157
- result: Calendar[];
158
- }>;
159
- /**
160
- * Retrieves a list of calendars available on the device.
161
- *
162
- * @async
163
- * @platform iOS, Android
164
- * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.
165
- * Each calendar object in the array contains an ID and a title.
166
- * @example
167
- * const { result } = await listCalendars();
168
- * console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]
169
- */
170
- listCalendars(): Promise<{
171
- result: Calendar[];
172
- }>;
173
- /**
174
- * Retrieves the default calendar set on the device.
175
- *
176
- * @async
177
- * @since 0.3.0
178
- * @platform iOS, Android
179
- * @permissions
180
- * <h3>Runtime Permissions:</h3>
181
- * <ul>
182
- * <li><strong>iOS:</strong> readCalendar</li>
183
- * <li><strong>Android:</strong> readCalendar</li>
184
- * </ul>
185
- * @returns {Promise<{ result: Calendar | null }>} A promise that resolves with the default calendar set on the device.
186
- * The returned calendar object contains an ID and a title. Returns null if there is no default calendar found.
187
- * @example
188
- * const { result } = await getDefaultCalendar();
189
- * console.log(result); // { id: '1', title: 'Default Calendar' }
190
- */
191
- getDefaultCalendar(): Promise<{
192
- result: Calendar | null;
193
- }>;
194
- /**
195
- * Creates an event with the provided options.
196
- *
197
- * @async
198
- * @since 0.4.0
199
- * @platform iOS, Android
200
- * @permissions
201
- * <h3>Runtime Permissions:</h3>
202
- * <ul>
203
- * <li><strong>iOS:</strong> writeCalendar</li>
204
- * <li><strong>Android:</strong> readCalendar, writeCalendar</li>
205
- * </ul>
206
- * @param {object} options Options for creating the event.
207
- * @param {string} options.title The title of the event.
208
- * @param {string} options.calendarId The id of the destination calendar. (Optional)
209
- * @param {string} [options.location] The location of the event. (Optional)
210
- * @param {number} [options.startDate] The start date and time of the event. (Optional)
211
- * @param {number} [options.endDate] The end date and time of the event. (Optional)
212
- * @param {boolean} [options.isAllDay] Weather the event is for the entire day or not. (Optional)
213
- * @param {number} [options.alertOffsetInMinutes] If a number >= 0 is provided, an alert will be set for the event this many
214
- * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.
215
- * On iOS only the first two valid elements of the array are taken into account.
216
- * Negative values are ignored. (Optional)
217
- * @param {string} [options.url] The URL of the event. (Optional)
218
- * @param {string} [options.notes] The notes of the event. (Optional)
219
- * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.
220
- * @example
221
- * const now = Date.now();
222
- * const eventOptions = {
223
- * title: 'Team Meeting',
224
- * location: 'Conference Room A',
225
- * startDate: now,
226
- * endDate: now + 2 * 60 * 60 * 1000,
227
- * isAllDay: false,
228
- * alertOffsetInMinutes: 5,
229
- * url: 'https://capacitor-calendar.pages.dev',
230
- * notes: 'A CapacitorJS plugin'
231
- * };
232
- * const { result } = await createEvent(eventOptions);
233
- */
234
- createEvent(options: {
235
- title: string;
236
- calendarId?: string;
237
- location?: string;
238
- startDate?: number;
239
- endDate?: number;
240
- isAllDay?: boolean;
241
- alertOffsetInMinutes?: number | number[];
242
- url?: string;
243
- notes?: string;
244
- }): Promise<{
245
- result: string;
246
- }>;
247
- /**
248
- * Retrieves the default reminders list set on the device.
249
- *
250
- * @async
251
- * @platform iOS
252
- * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.
253
- * The returned reminders list object contains an ID and a title.
254
- * @example
255
- * const { result } = await getDefaultRemindersList();
256
- * console.log(result); // { id: '1', title: 'Default Reminders List' }
257
- */
258
- getDefaultRemindersList(): Promise<{
259
- result: RemindersList;
260
- }>;
261
- /**
262
- * Retrieves all available reminders lists on the device.
263
- *
264
- * @async
265
- * @platform iOS
266
- * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.
267
- * Each reminders list object in the array contains an ID and a title.
268
- * @example
269
- * const { result } = await getRemindersLists();
270
- * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]
271
- */
272
- getRemindersLists(): Promise<{
273
- result: RemindersList[];
274
- }>;
275
- /**
276
- * Creates a reminder with the provided options.
277
- *
278
- * @async
279
- * @since 0.5.0
280
- * @platform iOS
281
- * @permissions
282
- * <h3>Runtime Permissions:</h3>
283
- * <ul>
284
- * <li><strong>iOS:</strong> writeReminders</li>
285
- * </ul>
286
- * @param {object} options - Options for creating the reminder.
287
- * @param {string} options.title - The title of the reminder.
288
- * @param {string} options.listId - The id of the destination reminders list. (Optional)
289
- * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine
290
- * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the
291
- * nearest border. (Optional)
292
- * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)
293
- * @param {number} [options.startDate] - The start date of the reminder. (Optional)
294
- * @param {number} [options.dueDate] - The due date of the reminder. (Optional)
295
- * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)
296
- * @param {string} [options.notes] - Additional notes about the reminder. (Optional)
297
- * @param {string} [options.url] - A URL to save under the reminder. (Optional)
298
- * @param {string} [options.location] - A location to save under the reminder. (Optional)
299
- * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)
300
- * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder
301
- * @example
302
- * const now = Date.now();
303
- * const rules: ReminderRecurrenceRule = {
304
- * frequency: ReminderRecurrenceFrequency.MONTHLY,
305
- * interval: 10,
306
- * end: Date.now()
307
- * }
308
- * const reminderOptions = {
309
- * title: 'Buy cucumber',
310
- * listId: 'ABC12',
311
- * priority: 5,
312
- * isCompleted: false,
313
- * startDateComponents: now,
314
- * notes: 'Also buy tomatoes',
315
- * url: 'https://capacitor-calendar.pages.dev/',
316
- * location: 'My Local Supermarket',
317
- * recurrence: rules
318
- * };
319
- * const { result } = await createReminder(reminderOptions);
320
- * console.log(result); // 'ID_1'
321
- */
322
- createReminder(options: {
323
- title: string;
324
- listId?: string;
325
- priority?: number;
326
- isCompleted?: boolean;
327
- startDate?: number;
328
- dueDate?: number;
329
- completionDate?: number;
330
- notes?: string;
331
- url?: string;
332
- location?: string;
333
- recurrence?: ReminderRecurrenceRule;
334
- }): Promise<{
335
- result: string;
336
- }>;
337
- /**
338
- * Opens the calendar app. Since the user leaves your app, use this method with caution.
339
- * It will open the calendar on today's date if no date is provided.
340
- *
341
- * @async
342
- * @platform iOS, Android
343
- * @param {object} options - Options for opening the calendar.
344
- * @param {number} options.date - The date at which the calendar should be opened. (Optional)
345
- * @returns {Promise<void>}
346
- * @example
347
- * void CapacitorCalendar.openCalendar({ date: Date.now() });
348
- */
349
- openCalendar(options: {
350
- date?: number;
351
- }): Promise<void>;
352
- /**
353
- * Opens the reminders app. Since the user leaves your app, use this method with caution.
354
- *
355
- * @async
356
- * @platform iOS
357
- * @returns {Promise<void>}
358
- * @example
359
- * void CapacitorCalendar.openReminders();
360
- */
361
- openReminders(): Promise<void>;
362
- /**
363
- * Retrieves the list of calendar events present in the given date range.
364
- *
365
- * @async
366
- * @since 0.10.0
367
- * @platform iOS, Android
368
- * @permissions
369
- * <h3>Runtime Permissions:</h3>
370
- * <ul>
371
- * <li><strong>iOS:</strong> readCalendar</li>
372
- * <li><strong>Android:</strong> readCalendar</li>
373
- * </ul>
374
- * @param {object} options Options for defining the date range.
375
- * @param {number} options.startDate The start of the date range.
376
- * @param {number} options.endDate The end of the date range.
377
- * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.
378
- * @example
379
- * const { result } = await CapacitorCalendar.listEventsInRange({
380
- * startDate: Date.now(),
381
- * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now
382
- * })
383
- */
384
- listEventsInRange(options: {
385
- startDate: number;
386
- endDate: number;
387
- }): Promise<{
388
- result: CalendarEvent[];
389
- }>;
390
- /**
391
- * Deletes events from the calendar given their IDs.
392
- *
393
- * @async
394
- * @since 0.11.0
395
- * @platform iOS, Android
396
- * @permissions
397
- * <h3>Runtime Permissions:</h3>
398
- * <ul>
399
- * <li><strong>iOS:</strong> writeCalendar</li>
400
- * <li><strong>Android:</strong> writeCalendar</li>
401
- * </ul>
402
- * @param {object} options Options for defining event IDs.
403
- * @param {number} options.ids An array of event IDs to be deleted.
404
- * @returns {Promise<{ deleted: string[], failed: string[] }>}
405
- * A promise that resolves to an object with two properties:
406
- * - deleted: string[] - An array of IDs that were successfully deleted.
407
- * - failed: string[] - An array of IDs that could not be deleted.
408
- * @example
409
- * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];
410
- * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)
411
- * console.log(result.deleted) // ['ID_1', 'ID_2']
412
- * console.log(result.failed) // ['ID_DOES_NOT_EXIST']
413
- */
414
- deleteEventsById(options: {
415
- ids: string[];
416
- }): Promise<{
417
- result: {
418
- deleted: string[];
419
- failed: string[];
420
- };
421
- }>;
422
- /**
423
- * Creates a calendar
424
- *
425
- * @async
426
- * @since 5.2.0
427
- * @platform iOS
428
- * @permissions
429
- * <h3>Runtime Permissions:</h3>
430
- * <ul>
431
- * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>
432
- * </ul>
433
- * @param {object} options Options for creating a calendar.
434
- * @param {string} options.title The title of the calendar to create.
435
- * @param {string} options.color The color of the calendar to create.
436
- * The color should be a HEX string. (Optional)
437
- * @param {string} options.sourceId The id of the source of the calendar.
438
- * If not provided, the source of the default calendar will be used. It is
439
- * recommended to use fetchAllCalendarSources method to fetch the id of the
440
- * desired source type.
441
- * @returns {Promise<{ result: string }>} The id of the created calendar.
442
- * @example
443
- * { result } = await CapacitorCalendar.createCalendar({
444
- * title: 'New Calendar',
445
- * color: '#1d00fc',
446
- * sourceId: 'local-source-id',
447
- * });
448
- * console.log(result); // 'CALENDAR_ID'
449
- */
450
- createCalendar(options: {
451
- title: string;
452
- color?: string;
453
- sourceId?: string;
454
- }): Promise<{
455
- result: string;
456
- }>;
457
- /**
458
- * Deletes a calendar by id
459
- *
460
- * @async
461
- * @since 5.2.0
462
- * @platform iOS
463
- * @permissions
464
- * <h3>Runtime Permissions:</h3>
465
- * <ul>
466
- * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>
467
- * </ul>
468
- * @param {object} options Options for deleting a calendar.
469
- * @param {string} options.id The id of the calendar to delete.
470
- * @example
471
- * await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });
472
- */
473
- deleteCalendar(options: {
474
- id: string;
475
- }): Promise<void>;
476
- /**
477
- * Retrieves the list of reminders present in the given date range.
478
- *
479
- * @async
480
- * @since 5.3.0
481
- * @platform iOS
482
- * @permissions
483
- * <h3>Runtime Permissions:</h3>
484
- * <ul>
485
- * <li><strong>iOS:</strong> readReminders</li>
486
- * </ul>
487
- * @param {object} options Options for defining the date range.
488
- * It Will fetch all reminders from all available lists if not provided. (Optional)
489
- * @param {string[]} options.listIds An array of reminder list ids.
490
- * @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.
491
- * @example
492
- * const now = Date.now();
493
- * const { result } = await CapacitorCalendar.getRemindersFromLists({
494
- * listIds: ['LIST_ID_1', 'LIST_ID_2'],
495
- * });
496
- */
497
- getRemindersFromLists(options?: {
498
- listIds: string[];
499
- }): Promise<{
500
- result: Reminder[];
501
- }>;
502
- /**
503
- * Deletes reminders given their IDs.
504
- *
505
- * @async
506
- * @since 5.3.0
507
- * @platform iOS
508
- * @permissions
509
- * <h3>Runtime Permissions:</h3>
510
- * <ul>
511
- * <li><strong>iOS:</strong> writeReminders</li>
512
- * </ul>
513
- * @param {object} options Options for defining reminder IDs.
514
- * @param {number} options.ids An array of reminder IDs to be deleted.
515
- * @returns {Promise<{ deleted: string[], failed: string[] }>}
516
- * A promise that resolves to an object with two properties:
517
- * - deleted: string[] - An array of IDs that were successfully deleted.
518
- * - failed: string[] - An array of IDs that could not be deleted.
519
- * @example
520
- * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];
521
- * const { result } = await CapacitorCalendar.deleteRemindersById(idsToDelete)
522
- * console.log(result.deleted) // ['ID_1', 'ID_2']
523
- * console.log(result.failed) // ['ID_DOES_NOT_EXIST']
524
- */
525
- deleteRemindersById(options: {
526
- ids: string[];
527
- }): Promise<{
528
- result: {
529
- deleted: string[];
530
- failed: string[];
531
- };
532
- }>;
533
- /**
534
- * Requests write access for the calendar. If its already granted, it will directly return the state.
535
- *
536
- * @async
537
- * @since 5.4.0
538
- * @platform iOS, Android
539
- * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the write access permission.
540
- * @example
541
- * const { result } = await this.requestWriteOnlyCalendarAccess();
542
- */
543
- requestWriteOnlyCalendarAccess(): Promise<{
544
- result: PermissionState;
545
- }>;
546
- /**
547
- * Requests read access for the calendar. If its already granted, it will directly return the state.
548
- *
549
- * @async
550
- * @since 5.4.0
551
- * @platform Android
552
- * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the read access permission.
553
- * @example
554
- * const { result } = await this.requestReadOnlyCalendarAccess();
555
- */
556
- requestReadOnlyCalendarAccess(): Promise<{
557
- result: PermissionState;
558
- }>;
559
- /**
560
- * Requests read and write access for the calendar. If its already granted, it will directly return the state.
561
- *
562
- * @async
563
- * @since 5.4.0
564
- * @platform iOS, Android
565
- * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.
566
- * @example
567
- * const { result } = await this.requestFullCalendarAccess();
568
- */
569
- requestFullCalendarAccess(): Promise<{
570
- result: PermissionState;
571
- }>;
572
- /**
573
- * Requests read and write access for the reminders. If its already granted, it will directly return the state.
574
- *
575
- * @async
576
- * @since 5.4.0
577
- * @platform iOS
578
- * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.
579
- * @example
580
- * const { result } = await this.requestFullRemindersAccess();
581
- */
582
- requestFullRemindersAccess(): Promise<{
583
- result: PermissionState;
584
- }>;
585
- /**
586
- * Opens a native prompt to modify an event given its id.
587
- *
588
- * @async
589
- * @since 6.6.0
590
- * @platform iOS, Android
591
- * @permissions
592
- * <h3>Runtime Permissions:</h3>
593
- * <ul>
594
- * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
595
- * <li><strong>Android:</strong> writeCalendar, readCalendar</li>
596
- * </ul>
597
- * @param {Object} options The options for modifying an event.
598
- * @param {string} options.id The id of the event to be modified.
599
- * @param {object} options.update The set of event properties to be modified. (Optional)
600
- * If a property is not supported, it will be ignored. Setting alerts with prompt
601
- * is only supported on iOS.
602
- * @returns {Promise<{ result: string[] }>} On iOS, the promise resolves with an array containing
603
- * the initial event id if the modifications were saved and empty if it was cancelled. However, on
604
- * Android the array will be empty either way.
605
- * @throws {Error} throws an error if an event for the given id is not found.
606
- * @example
607
- * const { result } = await CapacitorCalendar.modifyEventWithPrompt({
608
- * id: 'EVENT_ID_ONE',
609
- * update: {
610
- * title: 'newTitle',
611
- * startDate: Date.now(),
612
- * },
613
- * });
614
- *
615
- * console.log(result); // ['EVENT_ID_ONE'] or [] if on Android
616
- */
617
- modifyEventWithPrompt(options: {
618
- id: string;
619
- update?: {
620
- title?: string;
621
- calendarId?: string;
622
- location?: string;
623
- startDate?: number;
624
- endDate?: number;
625
- isAllDay?: boolean;
626
- alertOffsetInMinutes?: number | number[];
627
- url?: string;
628
- notes?: string;
629
- };
630
- }): Promise<{
631
- result: string[];
632
- }>;
633
- /**
634
- * Modifies an event given its id and update details.
635
- *
636
- * @async
637
- * @since 6.6.0
638
- * @platform iOS, Android
639
- * @permissions
640
- * <h3>Runtime Permissions:</h3>
641
- * <ul>
642
- * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
643
- * <li><strong>Android:</strong> writeCalendar, readCalendar</li>
644
- * </ul>
645
- * @param {Object} options The options for updating an event.
646
- * @param {string} options.id The id of the event to be modified.
647
- * @param {EventSpan} options.span The scope of the modifications.
648
- * Only supported on iOS. (Optional)
649
- * @param {Object} options.update The set of event properties to be modified.
650
- * If a property is not supported, it will be ignored. Modifying the reminder of an
651
- * event is currently not supported on Android.
652
- * @returns {Promise<void>} A promise that resolves when the update operation is complete.
653
- * @throws {Error} throws an error if an event for the given id is not found.
654
- * @example
655
- * const { result } = await CapacitorCalendar.modifyEvent({
656
- * id: 'EVENT_ID_ONE',
657
- * span: EventSpan.THIS_SPAN,
658
- * update: {
659
- * title: 'newTitle',
660
- * startDate: Date.now(),
661
- * },
662
- * });
663
- */
664
- modifyEvent(options: {
665
- id: string;
666
- span?: EventSpan;
667
- update: {
668
- title?: string;
669
- calendarId?: string;
670
- location?: string;
671
- startDate?: number;
672
- endDate?: number;
673
- isAllDay?: boolean;
674
- alertOffsetInMinutes?: number | number[];
675
- url?: string;
676
- notes?: string;
677
- };
678
- }): Promise<void>;
679
- /**
680
- * Retrieves a list of calendar sources.
681
- *
682
- * @async
683
- * @since 6.6.0
684
- * @platform iOS
685
- * @permissions
686
- * <h3>Runtime Permissions:</h3>
687
- * <ul>
688
- * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
689
- * </ul>
690
- * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of
691
- * calendar sources.
692
- * @example
693
- * const { result } = await fetchAllCalendarSources();
694
- * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]
695
- */
696
- fetchAllCalendarSources(): Promise<{
697
- result: CalendarSource[];
698
- }>;
699
- /**
700
- * Retrieves a list of reminders sources.
701
- *
702
- * @async
703
- * @since 6.6.0
704
- * @platform iOS
705
- * @permissions
706
- * <h3>Runtime Permissions:</h3>
707
- * <ul>
708
- * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>
709
- * </ul>
710
- * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of
711
- * reminders sources.
712
- * @example
713
- * const { result } = await fetchAllRemindersSources();
714
- * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]
715
- */
716
- fetchAllRemindersSources(): Promise<{
717
- result: CalendarSource[];
718
- }>;
719
- /**
720
- * Modifies a reminder given its id and update details.
721
- *
722
- * @async
723
- * @since 6.7.0
724
- * @platform iOS
725
- * @permissions
726
- * <h3>Runtime Permissions:</h3>
727
- * <ul>
728
- * <li><strong>iOS:</strong> writeReminders, readReminders</li>
729
- * </ul>
730
- * @param {Object} options The options for updating a reminder.
731
- * @param {string} options.id The id of the reminder to be modified.
732
- * @param {Object} options.update The set of reminder properties to be modified.
733
- * @returns {Promise<void>} A promise that resolves when the update operation is complete.
734
- * @throws {Error} throws an error if an event for the given id is not found.
735
- * @example
736
- * const { result } = await CapacitorCalendar.reminder({
737
- * id: 'REMINDER_ID_ONE',
738
- * update: {
739
- * title: 'newTitle',
740
- * isCompleted: true
741
- * },
742
- * });
743
- */
744
- modifyReminder(options: {
745
- id: string;
746
- update: {
747
- title?: string;
748
- listId?: string;
749
- priority?: number;
750
- isCompleted?: boolean;
751
- startDate?: number;
752
- dueDate?: number;
753
- completionDate?: number;
754
- notes?: string;
755
- url?: string;
756
- location?: string;
757
- recurrence?: ReminderRecurrenceRule;
758
- };
759
- }): Promise<void>;
1
+ import type { CalendarAccess } from "./sub-definitions/calendar-access";
2
+ import type { CalendarOperations } from "./sub-definitions/calendar-operations";
3
+ import type { EventOperations } from "./sub-definitions/event-operations";
4
+ import type { RemindersAccess } from "./sub-definitions/reminders-access";
5
+ import type { RemindersOperations } from "./sub-definitions/reminders-operations";
6
+ export interface CapacitorCalendarPlugin extends CalendarAccess, RemindersAccess, EventOperations, CalendarOperations, RemindersOperations {
760
7
  }