expo-calendar 56.0.3 → 56.0.4

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 (73) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/calendar/next/CalendarNextModule.kt +10 -1
  4. package/build/next/Calendar.d.ts +15 -7
  5. package/build/next/Calendar.d.ts.map +1 -1
  6. package/build/next/Calendar.js +8 -2
  7. package/build/next/Calendar.js.map +1 -1
  8. package/build/next/ExpoCalendar.d.ts +2 -2
  9. package/build/next/ExpoCalendar.d.ts.map +1 -1
  10. package/build/next/ExpoCalendar.js.map +1 -1
  11. package/build/next/ExpoGoCalendarNextStub.d.ts +2 -2
  12. package/build/next/ExpoGoCalendarNextStub.d.ts.map +1 -1
  13. package/build/next/ExpoGoCalendarNextStub.js +2 -2
  14. package/build/next/ExpoGoCalendarNextStub.js.map +1 -1
  15. package/expo-module.config.json +1 -1
  16. package/ios/Next/{ExpoCalendarPermissions.swift → CalendarAccessGuard.swift} +28 -18
  17. package/ios/Next/CalendarNextModule.swift +41 -42
  18. package/ios/Next/CalendarPermissionRequester.swift +47 -0
  19. package/ios/Next/CalendarPlistKeys.swift +21 -0
  20. package/ios/Next/Requesters/CalendarNextPermissionsRequester.swift +72 -0
  21. package/ios/Next/Requesters/CalendarWriteOnlyNextPermissionsRequester.swift +69 -0
  22. package/ios/Next/Requesters/RemindersNextPermissionsRequester.swift +58 -0
  23. package/ios/Requesters/CalendarPermissionsRequester.swift +0 -1
  24. package/ios/Requesters/RemindersPermissionsRequester.swift +0 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/{56.0.3/expo.modules.calendar-56.0.3-sources.jar → 56.0.4/expo.modules.calendar-56.0.4-sources.jar} +0 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4-sources.jar.md5 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4-sources.jar.sha1 +1 -0
  28. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4-sources.jar.sha256 +1 -0
  29. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4-sources.jar.sha512 +1 -0
  30. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.aar +0 -0
  31. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.aar.md5 +1 -0
  32. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.aar.sha1 +1 -0
  33. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.aar.sha256 +1 -0
  34. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.aar.sha512 +1 -0
  35. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/{56.0.3/expo.modules.calendar-56.0.3.module → 56.0.4/expo.modules.calendar-56.0.4.module} +22 -22
  36. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.module.md5 +1 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.module.sha1 +1 -0
  38. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.module.sha256 +1 -0
  39. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.module.sha512 +1 -0
  40. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/{56.0.3/expo.modules.calendar-56.0.3.pom → 56.0.4/expo.modules.calendar-56.0.4.pom} +1 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.pom.md5 +1 -0
  42. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.pom.sha1 +1 -0
  43. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.pom.sha256 +1 -0
  44. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.4/expo.modules.calendar-56.0.4.pom.sha512 +1 -0
  45. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml +4 -4
  46. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.md5 +1 -1
  47. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.sha1 +1 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.sha256 +1 -1
  49. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/maven-metadata.xml.sha512 +1 -1
  50. package/package.json +3 -3
  51. package/plugin/build/withCalendar.d.ts +15 -0
  52. package/plugin/build/withCalendar.js +17 -6
  53. package/plugin/src/withCalendar.ts +33 -6
  54. package/src/next/Calendar.ts +14 -3
  55. package/src/next/ExpoCalendar.ts +2 -2
  56. package/src/next/ExpoGoCalendarNextStub.ts +2 -2
  57. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3-sources.jar.md5 +0 -1
  58. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3-sources.jar.sha1 +0 -1
  59. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3-sources.jar.sha256 +0 -1
  60. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3-sources.jar.sha512 +0 -1
  61. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.aar +0 -0
  62. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.aar.md5 +0 -1
  63. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.aar.sha1 +0 -1
  64. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.aar.sha256 +0 -1
  65. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.aar.sha512 +0 -1
  66. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.module.md5 +0 -1
  67. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.module.sha1 +0 -1
  68. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.module.sha256 +0 -1
  69. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.module.sha512 +0 -1
  70. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.pom.md5 +0 -1
  71. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.pom.sha1 +0 -1
  72. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.pom.sha256 +0 -1
  73. package/local-maven-repo/host/exp/exponent/expo.modules.calendar/56.0.3/expo.modules.calendar-56.0.3.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 56.0.4 — 2026-05-07
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
13
17
  ## 56.0.3 — 2026-05-06
14
18
 
15
19
  _This version does not introduce any user-facing changes._
@@ -30,6 +34,7 @@ _This version does not introduce any user-facing changes._
30
34
 
31
35
  ### 🎉 New features
32
36
 
37
+ - [iOS][next] Add support for writeOnly permissions ([#44967](https://github.com/expo/expo/pull/44967) by [@Wenszel](https://github.com/Wenszel))
33
38
  - [iOS][next] Add `calendar.addEventWithForm()` ([#44966](https://github.com/expo/expo/pull/44966) by [@Wenszel](https://github.com/Wenszel))
34
39
  - [iOS][next] Add `presentPicker()` ([#44965](https://github.com/expo/expo/pull/44965) by [@Wenszel](https://github.com/Wenszel))
35
40
  - Expose a typed config plugin function ([#44098](https://github.com/expo/expo/pull/44098) by [@zoontek](https://github.com/zoontek))
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '56.0.3'
7
+ version = '56.0.4'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.calendar"
11
11
  defaultConfig {
12
12
  versionCode 17
13
- versionName '56.0.3'
13
+ versionName '56.0.4'
14
14
  }
15
15
  }
16
16
 
@@ -115,7 +115,16 @@ class CalendarNextModule : Module() {
115
115
  ExpoCalendar.getById(calendarId, calendarRepository, expoCalendarFactory)
116
116
  }
117
117
 
118
- AsyncFunction("requestCalendarPermissions") { promise: Promise ->
118
+ AsyncFunction("getCalendarPermissions") { _: Boolean?, promise: Promise ->
119
+ Permissions.getPermissionsWithPermissionsManager(
120
+ appContext.permissions,
121
+ promise,
122
+ Manifest.permission.READ_CALENDAR,
123
+ Manifest.permission.WRITE_CALENDAR
124
+ )
125
+ }
126
+
127
+ AsyncFunction("requestCalendarPermissions") { _: Boolean?, promise: Promise ->
119
128
  Permissions.askForPermissionsWithPermissionsManager(
120
129
  appContext.permissions,
121
130
  promise,
@@ -1,4 +1,4 @@
1
- import type { Calendar, Attendee, DialogEventResult, EntityTypes, Event, RecurringEventOptions, Reminder, ReminderStatus } from '../Calendar';
1
+ import type { Calendar, Attendee, DialogEventResult, EntityTypes, Event, RecurringEventOptions, Reminder, ReminderStatus, PermissionResponse } from '../Calendar';
2
2
  import InternalExpoCalendar from './ExpoCalendar';
3
3
  import type { ModifiableEventProperties, ModifiableReminderProperties, ModifiableCalendarProperties, ModifiableAttendeeProperties, AddEventWithFormOptions } from './ExpoCalendar.types';
4
4
  /**
@@ -78,24 +78,28 @@ export declare function presentPicker(): Promise<ExpoCalendar | null>;
78
78
  export declare function listEvents(calendars: (string | ExpoCalendar)[], startDate: Date, endDate: Date): Promise<ExpoCalendarEvent[]>;
79
79
  /**
80
80
  * Asks the user to grant permissions for accessing user's calendars.
81
+ * @param writeOnly - On iOS, whether to request write-only access, which allows creating calendar events
82
+ * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.
81
83
  * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).
82
84
  */
83
- export declare const requestCalendarPermissions: () => Promise<import("expo-modules-core").PermissionResponse>;
85
+ export declare const requestCalendarPermissions: (writeOnly?: boolean) => Promise<PermissionResponse>;
84
86
  /**
85
87
  * Checks user's permissions for accessing user's calendars.
88
+ * @param writeOnly - On iOS, whether to check write-only access, which allows creating calendar events
89
+ * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.
86
90
  * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).
87
91
  */
88
- export declare const getCalendarPermissions: () => Promise<import("expo-modules-core").PermissionResponse>;
92
+ export declare const getCalendarPermissions: (writeOnly?: boolean) => Promise<PermissionResponse>;
89
93
  /**
90
94
  * Asks the user to grant permissions for accessing user's reminders.
91
95
  * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).
92
96
  */
93
- export declare const requestRemindersPermissions: () => Promise<import("expo-modules-core").PermissionResponse>;
97
+ export declare const requestRemindersPermissions: () => Promise<PermissionResponse>;
94
98
  /**
95
99
  * Checks user's permissions for accessing user's reminders.
96
100
  * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).
97
101
  */
98
- export declare const getRemindersPermissions: () => Promise<import("expo-modules-core").PermissionResponse>;
102
+ export declare const getRemindersPermissions: () => Promise<PermissionResponse>;
99
103
  /**
100
104
  * Gets an array of Source objects with details about the different sources stored on the device.
101
105
  * @returns An array of Source objects representing the sources found.
@@ -108,13 +112,17 @@ export { AlarmMethod, AttendeeRole, AttendeeStatus, AttendeeType, Availability,
108
112
  * Check or request permissions to access the user's calendars.
109
113
  * This uses both `getCalendarPermissions` and `requestCalendarPermissions` to interact
110
114
  * with the permissions.
115
+ * On iOS, `writeOnly` requests permission to create calendar events without reading
116
+ * existing calendars or events. It does not grant permission to create, update, or delete calendars.
111
117
  *
112
118
  * @example
113
119
  * ```ts
114
120
  * const [status, requestPermission] = Calendar.useCalendarPermissions();
115
121
  * ```
116
122
  */
117
- export declare const useCalendarPermissions: (options?: import("expo-modules-core").PermissionHookOptions<object> | undefined) => [import("expo-modules-core").PermissionResponse | null, () => Promise<import("expo-modules-core").PermissionResponse>, () => Promise<import("expo-modules-core").PermissionResponse>];
123
+ export declare const useCalendarPermissions: (options?: import("expo-modules-core").PermissionHookOptions<{
124
+ writeOnly?: boolean;
125
+ }> | undefined) => [PermissionResponse | null, () => Promise<PermissionResponse>, () => Promise<PermissionResponse>];
118
126
  /**
119
127
  * Check or request permissions to access the user's reminders.
120
128
  * This uses both `getRemindersPermissions` and `requestRemindersPermissions` to interact
@@ -125,5 +133,5 @@ export declare const useCalendarPermissions: (options?: import("expo-modules-cor
125
133
  * const [status, requestPermission] = Calendar.useRemindersPermissions();
126
134
  * ```
127
135
  */
128
- export declare const useRemindersPermissions: (options?: import("expo-modules-core").PermissionHookOptions<object> | undefined) => [import("expo-modules-core").PermissionResponse | null, () => Promise<import("expo-modules-core").PermissionResponse>, () => Promise<import("expo-modules-core").PermissionResponse>];
136
+ export declare const useRemindersPermissions: (options?: import("expo-modules-core").PermissionHookOptions<object> | undefined) => [PermissionResponse | null, () => Promise<PermissionResponse>, () => Promise<PermissionResponse>];
129
137
  //# sourceMappingURL=Calendar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/next/Calendar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,qBAA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B;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+DAAkD,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,+DAA8C,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,+DAAmD,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,uBAAuB,+DAA+C,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,cAAc,qCAAsC,CAAC;AAElE,YAAY,EACV,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,kBAAkB,EAClB,KAAK,EACL,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC3B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,4QAGjC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,4QAGlC,CAAC"}
1
+ {"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/next/Calendar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,KAAK,EACL,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,kBAAkB,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,oBAAoB,MAAM,gBAAg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AO,MAAM,sBAAsB,sDAA8C,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,mCAAmD,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,uBAAuB,mCAA+C,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,cAAc,qCAAsC,CAAC;AAElE,YAAY,EACV,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,kBAAkB,EAClB,KAAK,EACL,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,MAAM,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC3B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB;gBAEnB,OAAO;oHAIrB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,wLAGlC,CAAC"}
@@ -201,11 +201,15 @@ export async function listEvents(calendars, startDate, endDate) {
201
201
  }
202
202
  /**
203
203
  * Asks the user to grant permissions for accessing user's calendars.
204
+ * @param writeOnly - On iOS, whether to request write-only access, which allows creating calendar events
205
+ * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.
204
206
  * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).
205
207
  */
206
208
  export const requestCalendarPermissions = InternalExpoCalendar.requestCalendarPermissions;
207
209
  /**
208
210
  * Checks user's permissions for accessing user's calendars.
211
+ * @param writeOnly - On iOS, whether to check write-only access, which allows creating calendar events
212
+ * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.
209
213
  * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).
210
214
  */
211
215
  export const getCalendarPermissions = InternalExpoCalendar.getCalendarPermissions;
@@ -229,6 +233,8 @@ export { AlarmMethod, AttendeeRole, AttendeeStatus, AttendeeType, Availability,
229
233
  * Check or request permissions to access the user's calendars.
230
234
  * This uses both `getCalendarPermissions` and `requestCalendarPermissions` to interact
231
235
  * with the permissions.
236
+ * On iOS, `writeOnly` requests permission to create calendar events without reading
237
+ * existing calendars or events. It does not grant permission to create, update, or delete calendars.
232
238
  *
233
239
  * @example
234
240
  * ```ts
@@ -236,8 +242,8 @@ export { AlarmMethod, AttendeeRole, AttendeeStatus, AttendeeType, Availability,
236
242
  * ```
237
243
  */
238
244
  export const useCalendarPermissions = createPermissionHook({
239
- getMethod: getCalendarPermissions,
240
- requestMethod: requestCalendarPermissions,
245
+ getMethod: (options) => getCalendarPermissions(options?.writeOnly),
246
+ requestMethod: (options) => requestCalendarPermissions(options?.writeOnly),
241
247
  });
242
248
  /**
243
249
  * Check or request permissions to access the user's reminders.
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/next/Calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAYtD,OAAO,oBAAoB,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAS1F;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,oBAAoB,CAAC,oBAAoB;IACxE,KAAK,CAAC,MAAM,CAAC,OAA8C;QAClE,IAAI,CAAC,KAAK,CAAC,MA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B,CAAC;AAElF;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,oBAAoB,CAAC,2BAA2B,CAAC;AAE5F;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,uBAAuB,CAAC;AAEpF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC,cAAc,CAAC;AAyBlE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC3B,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;IACzD,SAAS,EAAE,sBAAsB;IACjC,aAAa,EAAE,0BAA0B;CAC1C,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;IAC1D,SAAS,EAAE,uBAAuB;IAClC,aAAa,EAAE,2BAA2B;CAC3C,CAAC,CAAC","sourcesContent":["import { createPermissionHook, UnavailabilityError } from 'expo-modules-core';\nimport { Platform, processColor } from 'react-native';\n\nimport type {\n Calendar,\n Attendee,\n DialogEventResult,\n EntityTypes,\n Event,\n RecurringEventOptions,\n Reminder,\n ReminderStatus,\n} from '../Calendar';\nimport InternalExpoCalendar from './ExpoCalendar';\nimport { stringifyDateValues, stringifyIfDate, getNullableDetailsFields } from '../utils';\nimport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n ModifiableAttendeeProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\n\n/**\n * Represents a calendar attendee object.\n */\nexport class ExpoCalendarAttendee extends InternalExpoCalendar.ExpoCalendarAttendee {\n override async update(details: Partial<ModifiableAttendeeProperties>): Promise<void> {\n if (!super.update) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'update');\n }\n const nullableDetailsFields = getNullableDetailsFields(details);\n return super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n if (!super.delete) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'delete');\n }\n await super.delete();\n }\n}\n\n/**\n * Represents a calendar event object that can be accessed and modified using the Expo Calendar Next API.\n */\nexport class ExpoCalendarEvent extends InternalExpoCalendar.ExpoCalendarEvent {\n override getOccurrenceSync(recurringEventOptions: RecurringEventOptions = {}): ExpoCalendarEvent {\n const result = super.getOccurrenceSync(stringifyDateValues(recurringEventOptions));\n Object.setPrototypeOf(result, ExpoCalendarEvent.prototype);\n return result;\n }\n\n override async getAttendees(): Promise<ExpoCalendarAttendee[]> {\n const attendees = await super.getAttendees();\n return attendees.map((attendee) => {\n Object.setPrototypeOf(attendee, ExpoCalendarAttendee.prototype);\n return attendee;\n });\n }\n\n override async createAttendee(attendee: Attendee): Promise<ExpoCalendarAttendee> {\n if (!super.createAttendee) {\n throw new UnavailabilityError('ExpoCalendarEvent', 'createAttendee');\n }\n const newAttendee = await super.createAttendee(attendee);\n Object.setPrototypeOf(newAttendee, ExpoCalendarAttendee.prototype);\n return newAttendee;\n }\n\n override async update(details: Partial<ModifiableEventProperties>): Promise<void> {\n const nullableDetailsFields = getNullableDetailsFields(details);\n return await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n await super.delete();\n }\n\n static override async get(eventId: string): Promise<ExpoCalendarEvent> {\n const event = await InternalExpoCalendar.getEventById(eventId);\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n }\n}\n\n/**\n * Represents a calendar reminder object that can be accessed and modified using the Expo Calendar Next API.\n */\nexport class ExpoCalendarReminder extends InternalExpoCalendar.ExpoCalendarReminder {\n override async update(details: Partial<ModifiableReminderProperties>): Promise<void> {\n const nullableDetailsFields = getNullableDetailsFields(details);\n await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n static override async get(reminderId: string): Promise<ExpoCalendarReminder> {\n const reminder = await InternalExpoCalendar.getReminderById(reminderId);\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n }\n}\n\n/**\n * Represents a calendar object that can be accessed and modified using the Expo Calendar Next API.\n *\n * This class provides properties and methods for interacting with a specific calendar on the device,\n * such as retrieving its events, updating its details, and accessing its metadata.\n */\nexport class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {\n override async createEvent(\n details: Partial<\n Omit<\n Event,\n | 'creationDate'\n | 'lastModifiedDate'\n | 'originalStartDate'\n | 'isDetached'\n | 'status'\n | 'organizer'\n >\n >\n ): Promise<ExpoCalendarEvent> {\n const newEvent = await super.createEvent(stringifyDateValues(details));\n Object.setPrototypeOf(newEvent, ExpoCalendarEvent.prototype);\n return newEvent;\n }\n\n override async createReminder(details: Partial<Reminder>): Promise<ExpoCalendarReminder> {\n const newReminder = await super.createReminder(stringifyDateValues(details));\n Object.setPrototypeOf(newReminder, ExpoCalendarReminder.prototype);\n return newReminder;\n }\n\n override async listEvents(startDate: Date, endDate: Date): Promise<ExpoCalendarEvent[]> {\n if (!startDate) {\n throw new Error('listEvents must be called with a startDate (date) to search for events');\n }\n if (!endDate) {\n throw new Error('listEvents must be called with an endDate (date) to search for events');\n }\n const events = await super.listEvents(stringifyIfDate(startDate), stringifyIfDate(endDate));\n return events.map((event) => {\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n });\n }\n\n override async listReminders(\n startDate: Date | null = null,\n endDate: Date | null = null,\n status: ReminderStatus | null = null\n ): Promise<ExpoCalendarReminder[]> {\n const reminders = await super.listReminders(\n startDate ? stringifyIfDate(startDate) : null,\n endDate ? stringifyIfDate(endDate) : null,\n status\n );\n return reminders.map((reminder) => {\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n });\n }\n\n override async update(details: Partial<ModifiableCalendarProperties>): Promise<void> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, color: color || undefined };\n return await super.update(newDetails as Partial<ModifiableCalendarProperties>);\n }\n\n override async addEventWithForm(options?: AddEventWithFormOptions): Promise<DialogEventResult> {\n if (!super.addEventWithForm) {\n throw new UnavailabilityError('ExpoCalendar', 'addEventWithForm');\n }\n return super.addEventWithForm(options && stringifyDateValues(options));\n }\n\n static override async get(calendarId: string): Promise<ExpoCalendar> {\n const calendar = await InternalExpoCalendar.getCalendarById(calendarId);\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n }\n}\n\n/**\n * Gets an instance of the default calendar object.\n * @return An [`ExpoCalendar`](#expocalendar) object that is the user's default calendar.\n */\nexport function getDefaultCalendarSync(): ExpoCalendar {\n if (Platform.OS === 'android' || !InternalExpoCalendar.getDefaultCalendarSync) {\n throw new UnavailabilityError('Calendar', 'getDefaultCalendar');\n }\n const defaultCalendar = InternalExpoCalendar.getDefaultCalendarSync();\n Object.setPrototypeOf(defaultCalendar, ExpoCalendar.prototype);\n return defaultCalendar as ExpoCalendar;\n}\n\n/**\n * Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the different calendars stored on the device.\n * @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to\n * a specific [entity type](#entitytypes). Possible values are `Calendar.EntityTypes.EVENT` (for calendars shown in\n * the Calendar app) and `Calendar.EntityTypes.REMINDER` (for the Reminders app).\n * > **Note:** If not defined, you will need both permissions: **CALENDAR** and **REMINDERS**.\n * @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type (if provided).\n */\nexport async function getCalendars(type?: EntityTypes): Promise<ExpoCalendar[]> {\n if (!InternalExpoCalendar.getCalendars) {\n throw new UnavailabilityError('Calendar', 'getCalendars');\n }\n const calendars = await InternalExpoCalendar.getCalendars(type);\n return calendars.map((calendar) => {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n });\n}\n\n/**\n * Creates a new calendar on the device, allowing events to be added later and displayed in the OS Calendar app.\n * @param details A map of details for the calendar to be created.\n * @returns An [`ExpoCalendar`](#expocalendar) object representing the newly created calendar.\n */\nexport async function createCalendar(details: Partial<Calendar> = {}): Promise<ExpoCalendar> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, id: undefined, color: color || undefined };\n const createdCalendar = await InternalExpoCalendar.createCalendar(newDetails);\n Object.setPrototypeOf(createdCalendar, ExpoCalendar.prototype);\n return createdCalendar;\n}\n\n/**\n * Presents the OS calendar picker and returns the selected calendar.\n * @return An [`ExpoCalendar`](#expocalendar) object or `null` when the picker is cancelled.\n * @platform ios\n */\nexport async function presentPicker(): Promise<ExpoCalendar | null> {\n if (!InternalExpoCalendar.presentPicker) {\n throw new UnavailabilityError('Calendar', 'presentPicker');\n }\n const calendar = await InternalExpoCalendar.presentPicker();\n if (calendar) {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n }\n return calendar;\n}\n\n/**\n * Lists events from the device's calendar. It can be used to search events in multiple calendars.\n * > **Note:** If you want to search events in a single calendar, you can use [`ExpoCalendar.listEvents`](#listeventsstartdate-enddate) instead.\n * @param calendars An array of calendar IDs (`string[]`) or [`ExpoCalendar`](#expocalendar) objects to search for events.\n * @param startDate The start date of the time range to search for events.\n * @param endDate The end date of the time range to search for events.\n * @returns An array of [`ExpoCalendarEvent`](#expocalendarevent) objects representing the events found.\n */\nexport async function listEvents(\n calendars: (string | ExpoCalendar)[],\n startDate: Date,\n endDate: Date\n): Promise<ExpoCalendarEvent[]> {\n if (!InternalExpoCalendar.listEvents) {\n throw new UnavailabilityError('Calendar', 'listEvents');\n }\n const calendarIds = Array.isArray(calendars)\n ? calendars.map((c) => (typeof c === 'string' ? c : c.id))\n : [];\n return InternalExpoCalendar.listEvents(\n calendarIds,\n stringifyIfDate(startDate),\n stringifyIfDate(endDate)\n );\n}\n\n/**\n * Asks the user to grant permissions for accessing user's calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const requestCalendarPermissions = InternalExpoCalendar.requestCalendarPermissions;\n\n/**\n * Checks user's permissions for accessing user's calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const getCalendarPermissions = InternalExpoCalendar.getCalendarPermissions;\n\n/**\n * Asks the user to grant permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const requestRemindersPermissions = InternalExpoCalendar.requestRemindersPermissions;\n\n/**\n * Checks user's permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const getRemindersPermissions = InternalExpoCalendar.getRemindersPermissions;\n\n/**\n * Gets an array of Source objects with details about the different sources stored on the device.\n * @returns An array of Source objects representing the sources found.\n */\nexport const getSourcesSync = InternalExpoCalendar.getSourcesSync;\n\nexport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\n\nexport type {\n PermissionResponse,\n Alarm,\n AlarmLocation,\n CalendarDialogParams,\n DaysOfTheWeek,\n DialogEventResult,\n OpenEventDialogResult,\n OpenEventPresentationOptions,\n PermissionExpiration,\n PermissionHookOptions,\n PresentationOptions,\n RecurrenceRule,\n RecurringEventOptions,\n Source,\n} from '../Calendar';\nexport {\n AlarmMethod,\n AttendeeRole,\n AttendeeStatus,\n AttendeeType,\n Availability,\n CalendarAccessLevel,\n CalendarDialogResultActions,\n CalendarType,\n DayOfTheWeek,\n EntityTypes,\n EventAccessLevel,\n EventStatus,\n Frequency,\n MonthOfTheYear,\n ReminderStatus,\n SourceType,\n createEventInCalendarAsync,\n openEventInCalendarAsync,\n} from '../Calendar';\n/**\n * Check or request permissions to access the user's calendars.\n * This uses both `getCalendarPermissions` and `requestCalendarPermissions` to interact\n * with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useCalendarPermissions();\n * ```\n */\nexport const useCalendarPermissions = createPermissionHook({\n getMethod: getCalendarPermissions,\n requestMethod: requestCalendarPermissions,\n});\n\n/**\n * Check or request permissions to access the user's reminders.\n * This uses both `getRemindersPermissions` and `requestRemindersPermissions` to interact\n * with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useRemindersPermissions();\n * ```\n */\nexport const useRemindersPermissions = createPermissionHook({\n getMethod: getRemindersPermissions,\n requestMethod: requestRemindersPermissions,\n});\n"]}
1
+ {"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/next/Calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAatD,OAAO,oBAAoB,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAS1F;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,oBAAoB,CAAC,oBAAoB;IACxE,KAAK,CAAC,MAAM,CAAC,OAA8C;QAClE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAChE,OAAO,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC;IAC3E,CAAC;IAEQ,KAAK,CAAC,MAAM;QACnB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,mBAAmB,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,KAAK,CAAC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ACT,cAAc,EACd,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAGxD;IACA,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC;IAClE,aAAa,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,0BAA0B,CAAC,OAAO,EAAE,SAAS,CAAC;CAC3E,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;IAC1D,SAAS,EAAE,uBAAuB;IAClC,aAAa,EAAE,2BAA2B;CAC3C,CAAC,CAAC","sourcesContent":["import { createPermissionHook, UnavailabilityError } from 'expo-modules-core';\nimport { Platform, processColor } from 'react-native';\n\nimport type {\n Calendar,\n Attendee,\n DialogEventResult,\n EntityTypes,\n Event,\n RecurringEventOptions,\n Reminder,\n ReminderStatus,\n PermissionResponse,\n} from '../Calendar';\nimport InternalExpoCalendar from './ExpoCalendar';\nimport { stringifyDateValues, stringifyIfDate, getNullableDetailsFields } from '../utils';\nimport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n ModifiableAttendeeProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\n\n/**\n * Represents a calendar attendee object.\n */\nexport class ExpoCalendarAttendee extends InternalExpoCalendar.ExpoCalendarAttendee {\n override async update(details: Partial<ModifiableAttendeeProperties>): Promise<void> {\n if (!super.update) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'update');\n }\n const nullableDetailsFields = getNullableDetailsFields(details);\n return super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n if (!super.delete) {\n throw new UnavailabilityError('ExpoCalendarAttendee', 'delete');\n }\n await super.delete();\n }\n}\n\n/**\n * Represents a calendar event object that can be accessed and modified using the Expo Calendar Next API.\n */\nexport class ExpoCalendarEvent extends InternalExpoCalendar.ExpoCalendarEvent {\n override getOccurrenceSync(recurringEventOptions: RecurringEventOptions = {}): ExpoCalendarEvent {\n const result = super.getOccurrenceSync(stringifyDateValues(recurringEventOptions));\n Object.setPrototypeOf(result, ExpoCalendarEvent.prototype);\n return result;\n }\n\n override async getAttendees(): Promise<ExpoCalendarAttendee[]> {\n const attendees = await super.getAttendees();\n return attendees.map((attendee) => {\n Object.setPrototypeOf(attendee, ExpoCalendarAttendee.prototype);\n return attendee;\n });\n }\n\n override async createAttendee(attendee: Attendee): Promise<ExpoCalendarAttendee> {\n if (!super.createAttendee) {\n throw new UnavailabilityError('ExpoCalendarEvent', 'createAttendee');\n }\n const newAttendee = await super.createAttendee(attendee);\n Object.setPrototypeOf(newAttendee, ExpoCalendarAttendee.prototype);\n return newAttendee;\n }\n\n override async update(details: Partial<ModifiableEventProperties>): Promise<void> {\n const nullableDetailsFields = getNullableDetailsFields(details);\n return await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n override async delete(): Promise<void> {\n await super.delete();\n }\n\n static override async get(eventId: string): Promise<ExpoCalendarEvent> {\n const event = await InternalExpoCalendar.getEventById(eventId);\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n }\n}\n\n/**\n * Represents a calendar reminder object that can be accessed and modified using the Expo Calendar Next API.\n */\nexport class ExpoCalendarReminder extends InternalExpoCalendar.ExpoCalendarReminder {\n override async update(details: Partial<ModifiableReminderProperties>): Promise<void> {\n const nullableDetailsFields = getNullableDetailsFields(details);\n await super.update(stringifyDateValues(details), nullableDetailsFields);\n }\n\n static override async get(reminderId: string): Promise<ExpoCalendarReminder> {\n const reminder = await InternalExpoCalendar.getReminderById(reminderId);\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n }\n}\n\n/**\n * Represents a calendar object that can be accessed and modified using the Expo Calendar Next API.\n *\n * This class provides properties and methods for interacting with a specific calendar on the device,\n * such as retrieving its events, updating its details, and accessing its metadata.\n */\nexport class ExpoCalendar extends InternalExpoCalendar.ExpoCalendar {\n override async createEvent(\n details: Partial<\n Omit<\n Event,\n | 'creationDate'\n | 'lastModifiedDate'\n | 'originalStartDate'\n | 'isDetached'\n | 'status'\n | 'organizer'\n >\n >\n ): Promise<ExpoCalendarEvent> {\n const newEvent = await super.createEvent(stringifyDateValues(details));\n Object.setPrototypeOf(newEvent, ExpoCalendarEvent.prototype);\n return newEvent;\n }\n\n override async createReminder(details: Partial<Reminder>): Promise<ExpoCalendarReminder> {\n const newReminder = await super.createReminder(stringifyDateValues(details));\n Object.setPrototypeOf(newReminder, ExpoCalendarReminder.prototype);\n return newReminder;\n }\n\n override async listEvents(startDate: Date, endDate: Date): Promise<ExpoCalendarEvent[]> {\n if (!startDate) {\n throw new Error('listEvents must be called with a startDate (date) to search for events');\n }\n if (!endDate) {\n throw new Error('listEvents must be called with an endDate (date) to search for events');\n }\n const events = await super.listEvents(stringifyIfDate(startDate), stringifyIfDate(endDate));\n return events.map((event) => {\n Object.setPrototypeOf(event, ExpoCalendarEvent.prototype);\n return event;\n });\n }\n\n override async listReminders(\n startDate: Date | null = null,\n endDate: Date | null = null,\n status: ReminderStatus | null = null\n ): Promise<ExpoCalendarReminder[]> {\n const reminders = await super.listReminders(\n startDate ? stringifyIfDate(startDate) : null,\n endDate ? stringifyIfDate(endDate) : null,\n status\n );\n return reminders.map((reminder) => {\n Object.setPrototypeOf(reminder, ExpoCalendarReminder.prototype);\n return reminder;\n });\n }\n\n override async update(details: Partial<ModifiableCalendarProperties>): Promise<void> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, color: color || undefined };\n return await super.update(newDetails as Partial<ModifiableCalendarProperties>);\n }\n\n override async addEventWithForm(options?: AddEventWithFormOptions): Promise<DialogEventResult> {\n if (!super.addEventWithForm) {\n throw new UnavailabilityError('ExpoCalendar', 'addEventWithForm');\n }\n return super.addEventWithForm(options && stringifyDateValues(options));\n }\n\n static override async get(calendarId: string): Promise<ExpoCalendar> {\n const calendar = await InternalExpoCalendar.getCalendarById(calendarId);\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n }\n}\n\n/**\n * Gets an instance of the default calendar object.\n * @return An [`ExpoCalendar`](#expocalendar) object that is the user's default calendar.\n */\nexport function getDefaultCalendarSync(): ExpoCalendar {\n if (Platform.OS === 'android' || !InternalExpoCalendar.getDefaultCalendarSync) {\n throw new UnavailabilityError('Calendar', 'getDefaultCalendar');\n }\n const defaultCalendar = InternalExpoCalendar.getDefaultCalendarSync();\n Object.setPrototypeOf(defaultCalendar, ExpoCalendar.prototype);\n return defaultCalendar as ExpoCalendar;\n}\n\n/**\n * Gets an array of [`ExpoCalendar`](#expocalendar) shared objects with details about the different calendars stored on the device.\n * @param entityType __iOS Only.__ Not required, but if defined, filters the returned calendars to\n * a specific [entity type](#entitytypes). Possible values are `Calendar.EntityTypes.EVENT` (for calendars shown in\n * the Calendar app) and `Calendar.EntityTypes.REMINDER` (for the Reminders app).\n * > **Note:** If not defined, you will need both permissions: **CALENDAR** and **REMINDERS**.\n * @return An array of [`ExpoCalendar`](#expocalendar) shared objects matching the provided entity type (if provided).\n */\nexport async function getCalendars(type?: EntityTypes): Promise<ExpoCalendar[]> {\n if (!InternalExpoCalendar.getCalendars) {\n throw new UnavailabilityError('Calendar', 'getCalendars');\n }\n const calendars = await InternalExpoCalendar.getCalendars(type);\n return calendars.map((calendar) => {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n return calendar;\n });\n}\n\n/**\n * Creates a new calendar on the device, allowing events to be added later and displayed in the OS Calendar app.\n * @param details A map of details for the calendar to be created.\n * @returns An [`ExpoCalendar`](#expocalendar) object representing the newly created calendar.\n */\nexport async function createCalendar(details: Partial<Calendar> = {}): Promise<ExpoCalendar> {\n const color = details.color ? processColor(details.color) : undefined;\n const newDetails = { ...details, id: undefined, color: color || undefined };\n const createdCalendar = await InternalExpoCalendar.createCalendar(newDetails);\n Object.setPrototypeOf(createdCalendar, ExpoCalendar.prototype);\n return createdCalendar;\n}\n\n/**\n * Presents the OS calendar picker and returns the selected calendar.\n * @return An [`ExpoCalendar`](#expocalendar) object or `null` when the picker is cancelled.\n * @platform ios\n */\nexport async function presentPicker(): Promise<ExpoCalendar | null> {\n if (!InternalExpoCalendar.presentPicker) {\n throw new UnavailabilityError('Calendar', 'presentPicker');\n }\n const calendar = await InternalExpoCalendar.presentPicker();\n if (calendar) {\n Object.setPrototypeOf(calendar, ExpoCalendar.prototype);\n }\n return calendar;\n}\n\n/**\n * Lists events from the device's calendar. It can be used to search events in multiple calendars.\n * > **Note:** If you want to search events in a single calendar, you can use [`ExpoCalendar.listEvents`](#listeventsstartdate-enddate) instead.\n * @param calendars An array of calendar IDs (`string[]`) or [`ExpoCalendar`](#expocalendar) objects to search for events.\n * @param startDate The start date of the time range to search for events.\n * @param endDate The end date of the time range to search for events.\n * @returns An array of [`ExpoCalendarEvent`](#expocalendarevent) objects representing the events found.\n */\nexport async function listEvents(\n calendars: (string | ExpoCalendar)[],\n startDate: Date,\n endDate: Date\n): Promise<ExpoCalendarEvent[]> {\n if (!InternalExpoCalendar.listEvents) {\n throw new UnavailabilityError('Calendar', 'listEvents');\n }\n const calendarIds = Array.isArray(calendars)\n ? calendars.map((c) => (typeof c === 'string' ? c : c.id))\n : [];\n return InternalExpoCalendar.listEvents(\n calendarIds,\n stringifyIfDate(startDate),\n stringifyIfDate(endDate)\n );\n}\n\n/**\n * Asks the user to grant permissions for accessing user's calendars.\n * @param writeOnly - On iOS, whether to request write-only access, which allows creating calendar events\n * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const requestCalendarPermissions = InternalExpoCalendar.requestCalendarPermissions;\n\n/**\n * Checks user's permissions for accessing user's calendars.\n * @param writeOnly - On iOS, whether to check write-only access, which allows creating calendar events\n * without reading existing calendars or events. This does not grant permission to create, update, or delete calendars.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const getCalendarPermissions = InternalExpoCalendar.getCalendarPermissions;\n\n/**\n * Asks the user to grant permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const requestRemindersPermissions = InternalExpoCalendar.requestRemindersPermissions;\n\n/**\n * Checks user's permissions for accessing user's reminders.\n * @return A promise that resolves to an object of type [`PermissionResponse`](#permissionresponse).\n */\nexport const getRemindersPermissions = InternalExpoCalendar.getRemindersPermissions;\n\n/**\n * Gets an array of Source objects with details about the different sources stored on the device.\n * @returns An array of Source objects representing the sources found.\n */\nexport const getSourcesSync = InternalExpoCalendar.getSourcesSync;\n\nexport type {\n ModifiableEventProperties,\n ModifiableReminderProperties,\n ModifiableCalendarProperties,\n AddEventWithFormOptions,\n} from './ExpoCalendar.types';\n\nexport type {\n PermissionResponse,\n Alarm,\n AlarmLocation,\n CalendarDialogParams,\n DaysOfTheWeek,\n DialogEventResult,\n OpenEventDialogResult,\n OpenEventPresentationOptions,\n PermissionExpiration,\n PermissionHookOptions,\n PresentationOptions,\n RecurrenceRule,\n RecurringEventOptions,\n Source,\n} from '../Calendar';\nexport {\n AlarmMethod,\n AttendeeRole,\n AttendeeStatus,\n AttendeeType,\n Availability,\n CalendarAccessLevel,\n CalendarDialogResultActions,\n CalendarType,\n DayOfTheWeek,\n EntityTypes,\n EventAccessLevel,\n EventStatus,\n Frequency,\n MonthOfTheYear,\n ReminderStatus,\n SourceType,\n createEventInCalendarAsync,\n openEventInCalendarAsync,\n} from '../Calendar';\n\n/**\n * Check or request permissions to access the user's calendars.\n * This uses both `getCalendarPermissions` and `requestCalendarPermissions` to interact\n * with the permissions.\n * On iOS, `writeOnly` requests permission to create calendar events without reading\n * existing calendars or events. It does not grant permission to create, update, or delete calendars.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useCalendarPermissions();\n * ```\n */\nexport const useCalendarPermissions = createPermissionHook<\n PermissionResponse,\n { writeOnly?: boolean }\n>({\n getMethod: (options) => getCalendarPermissions(options?.writeOnly),\n requestMethod: (options) => requestCalendarPermissions(options?.writeOnly),\n});\n\n/**\n * Check or request permissions to access the user's reminders.\n * This uses both `getRemindersPermissions` and `requestRemindersPermissions` to interact\n * with the permissions.\n *\n * @example\n * ```ts\n * const [status, requestPermission] = Calendar.useRemindersPermissions();\n * ```\n */\nexport const useRemindersPermissions = createPermissionHook({\n getMethod: getRemindersPermissions,\n requestMethod: requestRemindersPermissions,\n});\n"]}
@@ -19,8 +19,8 @@ declare class ExpoCalendarNextModule extends NativeModule {
19
19
  presentPicker(): Promise<ExpoCalendar | null>;
20
20
  getEventById(eventId: string): Promise<ExpoCalendarEvent>;
21
21
  getReminderById(reminderId: string): Promise<ExpoCalendarReminder>;
22
- requestCalendarPermissions(): Promise<PermissionResponse>;
23
- getCalendarPermissions(): Promise<PermissionResponse>;
22
+ requestCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;
23
+ getCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;
24
24
  requestRemindersPermissions(): Promise<PermissionResponse>;
25
25
  getRemindersPermissions(): Promise<PermissionResponse>;
26
26
  getSourcesSync(): Source[];
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoCalendar.d.ts","sourceRoot":"","sources":["../../src/next/ExpoCalendar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA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,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAElE,0BAA0B,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAC5E,sBAAsB,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IACxE,2BAA2B,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAC1D,uBAAuB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAEtD,cAAc,IAAI,MAAM,EAAE;CAC3B;;AAED,wBAEgE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoCalendar.js","sourceRoot":"","sources":["../../src/next/ExpoCalendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAUtE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAmC9D,eAAe,iBAAiB,EAAE;IAChC,CAAC,CAAE,sBAAwD;IAC3D,CAAC,CAAC,mBAAmB,CAAyB,cAAc,CAAC,CAAC","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport type { PermissionResponse } from 'expo-modules-core';\nimport { NativeModule, requireNativeModule } from 'expo-modules-core';\nimport type { ProcessedColorValue } from 'react-native';\n\nimport type {\n ExpoCalendar,\n ExpoCalendarAttendee,\n ExpoCalendarEvent,\n ExpoCalendarReminder,\n} from './ExpoCalendar.types';\nimport type { Calendar, EntityTypes, Source } from '../Calendar';\nimport ExpoGoCalendarNextStub from './ExpoGoCalendarNextStub';\n\ndeclare class ExpoCalendarNextModule extends NativeModule {\n ExpoCalendar: typeof ExpoCalendar;\n ExpoCalendarEvent: typeof ExpoCalendarEvent;\n ExpoCalendarAttendee: typeof ExpoCalendarAttendee;\n ExpoCalendarReminder: typeof ExpoCalendarReminder;\n\n createCalendar(\n details: Omit<Partial<Calendar>, 'color'> & { color: ProcessedColorValue | undefined }\n ): Promise<ExpoCalendar>;\n\n getDefaultCalendar(): ExpoCalendar;\n getDefaultCalendarSync(): unknown;\n getCalendars(type?: EntityTypes): Promise<ExpoCalendar[]>;\n\n listEvents(\n calendars: string[],\n startDate: string | Date,\n endDate: string | Date\n ): Promise<ExpoCalendarEvent[]>;\n\n getCalendarById(calendarId: string): Promise<ExpoCalendar>;\n presentPicker(): Promise<ExpoCalendar | null>;\n getEventById(eventId: string): Promise<ExpoCalendarEvent>;\n getReminderById(reminderId: string): Promise<ExpoCalendarReminder>;\n\n requestCalendarPermissions(): Promise<PermissionResponse>;\n getCalendarPermissions(): Promise<PermissionResponse>;\n requestRemindersPermissions(): Promise<PermissionResponse>;\n getRemindersPermissions(): Promise<PermissionResponse>;\n\n getSourcesSync(): Source[];\n}\n\nexport default isRunningInExpoGo()\n ? (ExpoGoCalendarNextStub as any as ExpoCalendarNextModule)\n : requireNativeModule<ExpoCalendarNextModule>('CalendarNext');\n"]}
1
+ {"version":3,"file":"ExpoCalendar.js","sourceRoot":"","sources":["../../src/next/ExpoCalendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAUtE,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAmC9D,eAAe,iBAAiB,EAAE;IAChC,CAAC,CAAE,sBAAwD;IAC3D,CAAC,CAAC,mBAAmB,CAAyB,cAAc,CAAC,CAAC","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport type { PermissionResponse } from 'expo-modules-core';\nimport { NativeModule, requireNativeModule } from 'expo-modules-core';\nimport type { ProcessedColorValue } from 'react-native';\n\nimport type {\n ExpoCalendar,\n ExpoCalendarAttendee,\n ExpoCalendarEvent,\n ExpoCalendarReminder,\n} from './ExpoCalendar.types';\nimport type { Calendar, EntityTypes, Source } from '../Calendar';\nimport ExpoGoCalendarNextStub from './ExpoGoCalendarNextStub';\n\ndeclare class ExpoCalendarNextModule extends NativeModule {\n ExpoCalendar: typeof ExpoCalendar;\n ExpoCalendarEvent: typeof ExpoCalendarEvent;\n ExpoCalendarAttendee: typeof ExpoCalendarAttendee;\n ExpoCalendarReminder: typeof ExpoCalendarReminder;\n\n createCalendar(\n details: Omit<Partial<Calendar>, 'color'> & { color: ProcessedColorValue | undefined }\n ): Promise<ExpoCalendar>;\n\n getDefaultCalendar(): ExpoCalendar;\n getDefaultCalendarSync(): unknown;\n getCalendars(type?: EntityTypes): Promise<ExpoCalendar[]>;\n\n listEvents(\n calendars: string[],\n startDate: string | Date,\n endDate: string | Date\n ): Promise<ExpoCalendarEvent[]>;\n\n getCalendarById(calendarId: string): Promise<ExpoCalendar>;\n presentPicker(): Promise<ExpoCalendar | null>;\n getEventById(eventId: string): Promise<ExpoCalendarEvent>;\n getReminderById(reminderId: string): Promise<ExpoCalendarReminder>;\n\n requestCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;\n getCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;\n requestRemindersPermissions(): Promise<PermissionResponse>;\n getRemindersPermissions(): Promise<PermissionResponse>;\n\n getSourcesSync(): Source[];\n}\n\nexport default isRunningInExpoGo()\n ? (ExpoGoCalendarNextStub as any as ExpoCalendarNextModule)\n : requireNativeModule<ExpoCalendarNextModule>('CalendarNext');\n"]}
@@ -19,8 +19,8 @@ declare class ExpoGoCalendarNextStub {
19
19
  getCalendars(): Promise<void>;
20
20
  listEvents(): Promise<void>;
21
21
  presentPicker(): Promise<void>;
22
- requestCalendarPermissions(): Promise<PermissionResponse>;
23
- getCalendarPermissions(): Promise<PermissionResponse>;
22
+ requestCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;
23
+ getCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;
24
24
  requestRemindersPermissions(): Promise<PermissionResponse>;
25
25
  getRemindersPermissions(): Promise<PermissionResponse>;
26
26
  getSourcesSync(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGoCalendarNextStub.d.ts","sourceRoot":"","sources":["../../src/next/ExpoGoCalendarNextStub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,cAAM,sBAAsB;IAC1B,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;MAQ1B;IACF,MAAM,CAAC,QAAQ,CAAC,iBAAiB;;MAI/B;IAEF,MAAM,CAAC,QAAQ,CAAC,oBAAoB;;MAMlC;IAEF,MAAM,CAAC,QAAQ,CAAC,oBAAoB;;MAMlC;IAEF,sBAAsB,IAAI,IAAI;IAI9B,cAAc,IAAI,IAAI;IAIhB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIzD,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIrD,2BAA2B,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAI1D,uBAAuB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAI5D,cAAc,IAAI,IAAI;CAGvB;AAED,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"ExpoGoCalendarNextStub.d.ts","sourceRoot":"","sources":["../../src/next/ExpoGoCalendarNextStub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,cAAM,sBAAsB;IAC1B,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;MAQ1B;IACF,MAAM,CAAC,QAAQ,CAAC,iBAAiB;;MAI/B;IAEF,MAAM,CAAC,QAAQ,CAAC,oBAAoB;;MAMlC;IAEF,MAAM,CAAC,QAAQ,CAAC,oBAAoB;;MAMlC;IAEF,sBAAsB,IAAI,IAAI;IAI9B,cAAc,IAAI,IAAI;IAIhB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,0BAA0B,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI5E,sBAAsB,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIxE,2BAA2B,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAI1D,uBAAuB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAI5D,cAAc,IAAI,IAAI;CAGvB;AAED,eAAe,sBAAsB,CAAC"}
@@ -37,10 +37,10 @@ class ExpoGoCalendarNextStub {
37
37
  async presentPicker() {
38
38
  throw new Error('Calendar@next functionality is not available in Expo Go');
39
39
  }
40
- async requestCalendarPermissions() {
40
+ async requestCalendarPermissions(writeOnly) {
41
41
  throw new Error('Calendar@next functionality is not available in Expo Go');
42
42
  }
43
- async getCalendarPermissions() {
43
+ async getCalendarPermissions(writeOnly) {
44
44
  throw new Error('Calendar@next functionality is not available in Expo Go');
45
45
  }
46
46
  async requestRemindersPermissions() {
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoGoCalendarNextStub.js","sourceRoot":"","sources":["../../src/next/ExpoGoCalendarNextStub.ts"],"names":[],"mappings":"AAEA,MAAM,sBAAsB;IAC1B,MAAM,CAAU,YAAY,GAAG,MAAM,YAAY;QAC/C;YACE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;QAC1F,CAAC;QAED,gBAAgB;YACd,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;IACF,MAAM,CAAU,iBAAiB,GAAG,MAAM,iBAAiB;QACzD;YACE,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QAC/F,CAAC;KACF,CAAC;IAEF,MAAM,CAAU,oBAAoB,GAAG,MAAM,oBAAoB;QAC/D;YACE,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,MAAM,CAAU,oBAAoB,GAAG,MAAM,oBAAoB;QAC/D;YACE,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,sBAAsB;QACpB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,cAAc;QACZ,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,0BAA0B;QAC9B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,2BAA2B;QAC/B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,cAAc;QACZ,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;;AAGH,eAAe,sBAAsB,CAAC","sourcesContent":["import type { PermissionResponse } from 'expo-modules-core';\n\nclass ExpoGoCalendarNextStub {\n static readonly ExpoCalendar = class ExpoCalendar {\n constructor() {\n throw new Error('`ExpoCalendar` is not yet available in the Expo Go managed workflow.');\n }\n\n addEventWithForm() {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n };\n static readonly ExpoCalendarEvent = class ExpoCalendarEvent {\n constructor() {\n throw new Error('`ExpoCalendarEvent` is not yet available in the Expo Go managed workflow.');\n }\n };\n\n static readonly ExpoCalendarReminder = class ExpoCalendarReminder {\n constructor() {\n throw new Error(\n '`ExpoCalendarReminder` is not yet available in the Expo Go managed workflow.'\n );\n }\n };\n\n static readonly ExpoCalendarAttendee = class ExpoCalendarAttendee {\n constructor() {\n throw new Error(\n '`ExpoCalendarAttendee` is not yet available in the Expo Go managed workflow.'\n );\n }\n };\n\n getDefaultCalendarSync(): void {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n createCalendar(): void {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async getCalendars(): Promise<void> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async listEvents(): Promise<void> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async presentPicker(): Promise<void> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async requestCalendarPermissions(): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async getCalendarPermissions(): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async requestRemindersPermissions(): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async getRemindersPermissions(): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n getSourcesSync(): void {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n}\n\nexport default ExpoGoCalendarNextStub;\n"]}
1
+ {"version":3,"file":"ExpoGoCalendarNextStub.js","sourceRoot":"","sources":["../../src/next/ExpoGoCalendarNextStub.ts"],"names":[],"mappings":"AAEA,MAAM,sBAAsB;IAC1B,MAAM,CAAU,YAAY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yD,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,cAAc;QACZ,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;;AAGH,eAAe,sBAAsB,CAAC","sourcesContent":["import type { PermissionResponse } from 'expo-modules-core';\n\nclass ExpoGoCalendarNextStub {\n static readonly ExpoCalendar = class ExpoCalendar {\n constructor() {\n throw new Error('`ExpoCalendar` is not yet available in the Expo Go managed workflow.');\n }\n\n addEventWithForm() {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n };\n static readonly ExpoCalendarEvent = class ExpoCalendarEvent {\n constructor() {\n throw new Error('`ExpoCalendarEvent` is not yet available in the Expo Go managed workflow.');\n }\n };\n\n static readonly ExpoCalendarReminder = class ExpoCalendarReminder {\n constructor() {\n throw new Error(\n '`ExpoCalendarReminder` is not yet available in the Expo Go managed workflow.'\n );\n }\n };\n\n static readonly ExpoCalendarAttendee = class ExpoCalendarAttendee {\n constructor() {\n throw new Error(\n '`ExpoCalendarAttendee` is not yet available in the Expo Go managed workflow.'\n );\n }\n };\n\n getDefaultCalendarSync(): void {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n createCalendar(): void {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async getCalendars(): Promise<void> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async listEvents(): Promise<void> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async presentPicker(): Promise<void> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async requestCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async getCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async requestRemindersPermissions(): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n async getRemindersPermissions(): Promise<PermissionResponse> {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n\n getSourcesSync(): void {\n throw new Error('Calendar@next functionality is not available in Expo Go');\n }\n}\n\nexport default ExpoGoCalendarNextStub;\n"]}
@@ -11,7 +11,7 @@
11
11
  "publication": {
12
12
  "groupId": "host.exp.exponent",
13
13
  "artifactId": "expo.modules.calendar",
14
- "version": "56.0.3",
14
+ "version": "56.0.4",
15
15
  "repository": "local-maven-repo"
16
16
  }
17
17
  }
@@ -2,7 +2,7 @@ import EventKit
2
2
  import ExpoModulesCore
3
3
  import Foundation
4
4
 
5
- public class ExpoCalendarPermissions {
5
+ public class CalendarAccessGuard {
6
6
  private var permittedEntities: EKEntityMask = .event
7
7
  private let eventStore: EKEventStore
8
8
  private weak var appContext: AppContext?
@@ -18,12 +18,12 @@ public class ExpoCalendarPermissions {
18
18
  }
19
19
  var permittedEntities: EKEntityMask = []
20
20
  if permissionsManager.hasGrantedPermission(
21
- usingRequesterClass: CalendarPermissionsRequester.self) {
21
+ usingRequesterClass: CalendarNextPermissionsRequester.self) {
22
22
  permittedEntities.insert(.event)
23
23
  }
24
24
 
25
25
  if permissionsManager.hasGrantedPermission(
26
- usingRequesterClass: RemindersPermissionRequester.self) {
26
+ usingRequesterClass: RemindersNextPermissionRequester.self) {
27
27
  permittedEntities.insert(.reminder)
28
28
  }
29
29
 
@@ -31,30 +31,40 @@ public class ExpoCalendarPermissions {
31
31
  }
32
32
 
33
33
  public func checkCalendarPermissions() throws {
34
- try self.checkPermissions(entity: .event)
34
+ try self.checkPermissions(
35
+ entity: .event,
36
+ requester: CalendarNextPermissionsRequester.self,
37
+ permissionName: "CALENDAR"
38
+ )
39
+ }
40
+
41
+ public func checkCalendarWritePermissions() throws {
42
+ try self.checkPermissions(
43
+ entity: .event,
44
+ requester: CalendarWriteOnlyNextPermissionsRequester.self,
45
+ permissionName: "CALENDARWRITEONLY"
46
+ )
35
47
  }
36
48
 
37
49
  public func checkRemindersPermissions() throws {
38
- try self.checkPermissions(entity: .reminder)
50
+ try self.checkPermissions(
51
+ entity: .reminder,
52
+ requester: RemindersNextPermissionRequester.self,
53
+ permissionName: "REMINDERS"
54
+ )
39
55
  }
40
56
 
41
- private func checkPermissions(entity: EKEntityType) throws {
57
+ private func checkPermissions(
58
+ entity: EKEntityType,
59
+ requester: EXPermissionsRequester.Type,
60
+ permissionName: String
61
+ ) throws {
42
62
  guard let permissionsManager = appContext?.permissions else {
43
63
  throw PermissionsManagerNotFoundException()
44
64
  }
45
65
 
46
- var requester: EXPermissionsRequester.Type?
47
- switch entity {
48
- case .event:
49
- requester = CalendarPermissionsRequester.self
50
- case .reminder:
51
- requester = RemindersPermissionRequester.self
52
- @unknown default:
53
- requester = nil
54
- }
55
- if let requester, !permissionsManager.hasGrantedPermission(usingRequesterClass: requester) {
56
- let message = requester.permissionType().uppercased()
57
- throw MissionPermissionsException(message)
66
+ if !permissionsManager.hasGrantedPermission(usingRequesterClass: requester) {
67
+ throw MissionPermissionsException(permissionName)
58
68
  }
59
69
 
60
70
  resetEventStoreIfPermissionWasChanged(entity: entity)