@symbiote-native/calendar 0.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 (141) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +189 -0
  3. package/build/angular/index.d.ts +3 -0
  4. package/build/angular/index.js +3 -0
  5. package/build/angular/services/calendar-permissions.service/index.d.ts +5 -0
  6. package/build/angular/services/calendar-permissions.service/index.js +60 -0
  7. package/build/angular/services/reminders-permissions.service/index.d.ts +5 -0
  8. package/build/angular/services/reminders-permissions.service/index.js +60 -0
  9. package/build/core/attendee.d.ts +9 -0
  10. package/build/core/attendee.js +28 -0
  11. package/build/core/calendar-permission-api.d.ts +9 -0
  12. package/build/core/calendar-permission-api.js +9 -0
  13. package/build/core/calendar.d.ts +34 -0
  14. package/build/core/calendar.js +118 -0
  15. package/build/core/enums.d.ts +141 -0
  16. package/build/core/enums.js +157 -0
  17. package/build/core/event.d.ts +14 -0
  18. package/build/core/event.js +40 -0
  19. package/build/core/index.d.ts +6 -0
  20. package/build/core/index.js +6 -0
  21. package/build/core/native-module.d.ts +154 -0
  22. package/build/core/native-module.js +3 -0
  23. package/build/core/reminder.d.ts +10 -0
  24. package/build/core/reminder.js +34 -0
  25. package/build/core/types.d.ts +184 -0
  26. package/build/core/types.js +1 -0
  27. package/build/core/utils.d.ts +7 -0
  28. package/build/core/utils.js +29 -0
  29. package/build/legacy/calendar.d.ts +23 -0
  30. package/build/legacy/calendar.js +261 -0
  31. package/build/legacy/enums.d.ts +1 -0
  32. package/build/legacy/enums.js +2 -0
  33. package/build/legacy/index.d.ts +5 -0
  34. package/build/legacy/index.js +5 -0
  35. package/build/legacy/native-module.d.ts +39 -0
  36. package/build/legacy/native-module.js +3 -0
  37. package/build/legacy/permissions.d.ts +9 -0
  38. package/build/legacy/permissions.js +33 -0
  39. package/build/legacy/reminders.d.ts +6 -0
  40. package/build/legacy/reminders.js +56 -0
  41. package/build/legacy/types.d.ts +147 -0
  42. package/build/legacy/types.js +1 -0
  43. package/build/react/index.d.ts +3 -0
  44. package/build/react/index.js +3 -0
  45. package/build/react/use-calendar-permissions.d.ts +10 -0
  46. package/build/react/use-calendar-permissions.js +7 -0
  47. package/build/react/use-reminders-permissions.d.ts +8 -0
  48. package/build/react/use-reminders-permissions.js +10 -0
  49. package/build/solid/index.d.ts +3 -0
  50. package/build/solid/index.js +3 -0
  51. package/build/solid/use-calendar-permissions.d.ts +11 -0
  52. package/build/solid/use-calendar-permissions.js +7 -0
  53. package/build/solid/use-reminders-permissions.d.ts +9 -0
  54. package/build/solid/use-reminders-permissions.js +10 -0
  55. package/build/svelte/index.d.ts +3 -0
  56. package/build/svelte/index.js +3 -0
  57. package/build/svelte/use-calendar-permissions.svelte.d.ts +10 -0
  58. package/build/svelte/use-calendar-permissions.svelte.js +7 -0
  59. package/build/svelte/use-reminders-permissions.svelte.d.ts +8 -0
  60. package/build/svelte/use-reminders-permissions.svelte.js +10 -0
  61. package/build/vue/index.d.ts +3 -0
  62. package/build/vue/index.js +3 -0
  63. package/build/vue/use-calendar-permissions.d.ts +11 -0
  64. package/build/vue/use-calendar-permissions.js +7 -0
  65. package/build/vue/use-reminders-permissions.d.ts +9 -0
  66. package/build/vue/use-reminders-permissions.js +10 -0
  67. package/build-ngc/angular/index.d.ts +3 -0
  68. package/build-ngc/angular/index.js +4 -0
  69. package/build-ngc/angular/index.js.map +1 -0
  70. package/build-ngc/angular/services/calendar-permissions.service/index.d.ts +8 -0
  71. package/build-ngc/angular/services/calendar-permissions.service/index.js +17 -0
  72. package/build-ngc/angular/services/calendar-permissions.service/index.js.map +1 -0
  73. package/build-ngc/angular/services/reminders-permissions.service/index.d.ts +8 -0
  74. package/build-ngc/angular/services/reminders-permissions.service/index.js +17 -0
  75. package/build-ngc/angular/services/reminders-permissions.service/index.js.map +1 -0
  76. package/build-ngc/core/attendee.d.ts +9 -0
  77. package/build-ngc/core/attendee.js +29 -0
  78. package/build-ngc/core/attendee.js.map +1 -0
  79. package/build-ngc/core/calendar-permission-api.d.ts +9 -0
  80. package/build-ngc/core/calendar-permission-api.js +10 -0
  81. package/build-ngc/core/calendar-permission-api.js.map +1 -0
  82. package/build-ngc/core/calendar.d.ts +34 -0
  83. package/build-ngc/core/calendar.js +119 -0
  84. package/build-ngc/core/calendar.js.map +1 -0
  85. package/build-ngc/core/enums.d.ts +141 -0
  86. package/build-ngc/core/enums.js +158 -0
  87. package/build-ngc/core/enums.js.map +1 -0
  88. package/build-ngc/core/event.d.ts +14 -0
  89. package/build-ngc/core/event.js +41 -0
  90. package/build-ngc/core/event.js.map +1 -0
  91. package/build-ngc/core/index.d.ts +6 -0
  92. package/build-ngc/core/index.js +7 -0
  93. package/build-ngc/core/index.js.map +1 -0
  94. package/build-ngc/core/native-module.d.ts +154 -0
  95. package/build-ngc/core/native-module.js +4 -0
  96. package/build-ngc/core/native-module.js.map +1 -0
  97. package/build-ngc/core/reminder.d.ts +10 -0
  98. package/build-ngc/core/reminder.js +35 -0
  99. package/build-ngc/core/reminder.js.map +1 -0
  100. package/build-ngc/core/types.d.ts +184 -0
  101. package/build-ngc/core/types.js +2 -0
  102. package/build-ngc/core/types.js.map +1 -0
  103. package/build-ngc/core/utils.d.ts +7 -0
  104. package/build-ngc/core/utils.js +30 -0
  105. package/build-ngc/core/utils.js.map +1 -0
  106. package/native-link.json +29 -0
  107. package/package.json +155 -0
  108. package/src/angular/index.ts +3 -0
  109. package/src/angular/services/calendar-permissions.service/index.ts +19 -0
  110. package/src/angular/services/reminders-permissions.service/index.ts +16 -0
  111. package/src/core/attendee.ts +43 -0
  112. package/src/core/calendar-permission-api.ts +16 -0
  113. package/src/core/calendar.ts +197 -0
  114. package/src/core/enums.ts +156 -0
  115. package/src/core/event.ts +70 -0
  116. package/src/core/index.ts +18 -0
  117. package/src/core/native-module.ts +212 -0
  118. package/src/core/reminder.ts +52 -0
  119. package/src/core/types.ts +209 -0
  120. package/src/core/utils.ts +39 -0
  121. package/src/legacy/calendar.ts +401 -0
  122. package/src/legacy/enums.ts +2 -0
  123. package/src/legacy/index.ts +5 -0
  124. package/src/legacy/native-module.ts +77 -0
  125. package/src/legacy/permissions.ts +47 -0
  126. package/src/legacy/reminders.ts +98 -0
  127. package/src/legacy/types.ts +183 -0
  128. package/src/react/index.ts +3 -0
  129. package/src/react/use-calendar-permissions.ts +25 -0
  130. package/src/react/use-reminders-permissions.ts +25 -0
  131. package/src/solid/index.ts +3 -0
  132. package/src/solid/use-calendar-permissions.ts +26 -0
  133. package/src/solid/use-reminders-permissions.ts +26 -0
  134. package/src/svelte/index.ts +3 -0
  135. package/src/svelte/svelte-ambient.d.ts +3 -0
  136. package/src/svelte/svelte-compile.test-helper.ts +7 -0
  137. package/src/svelte/use-calendar-permissions.svelte.ts +25 -0
  138. package/src/svelte/use-reminders-permissions.svelte.ts +25 -0
  139. package/src/vue/index.ts +3 -0
  140. package/src/vue/use-calendar-permissions.ts +26 -0
  141. package/src/vue/use-reminders-permissions.ts +26 -0
@@ -0,0 +1,154 @@
1
+ import type { PermissionResponse } from 'expo-modules-core';
2
+ import type { IDialogEventResult, IOpenEventPresentationOptions, IPresentationOptions, IRecurringEventOptions, ISource } from './types';
3
+ export declare class NativeExpoCalendar {
4
+ readonly id: string;
5
+ readonly title: string;
6
+ /** @platform android */
7
+ readonly name?: string | null;
8
+ readonly source?: ISource;
9
+ /** @platform ios */
10
+ readonly sourceId?: string;
11
+ /** @platform ios */
12
+ readonly type?: string;
13
+ readonly color?: string;
14
+ /** @platform ios */
15
+ readonly entityType?: string;
16
+ readonly allowsModifications: boolean;
17
+ readonly allowedAvailabilities: string[];
18
+ /** @platform android */
19
+ readonly isVisible?: boolean;
20
+ /** @platform android */
21
+ readonly isSynced?: boolean;
22
+ /** @platform android */
23
+ readonly timeZone?: string;
24
+ /** @platform android */
25
+ readonly isPrimary?: boolean;
26
+ /** @platform android */
27
+ readonly allowedReminders?: string[];
28
+ /** @platform android */
29
+ readonly allowedAttendeeTypes?: string[];
30
+ /** @platform android */
31
+ readonly ownerAccount?: string;
32
+ /** @platform android */
33
+ readonly accessLevel?: string;
34
+ listEvents(startDate: string | Date, endDate: string | Date): Promise<NativeExpoCalendarEvent[]>;
35
+ /** @platform ios - typed as always-present, guarded at runtime. */
36
+ listReminders(startDate: string | Date | null, endDate: string | Date | null, status: string | null): Promise<NativeExpoCalendarReminder[]>;
37
+ createEvent(record: Record<string, unknown>): Promise<NativeExpoCalendarEvent>;
38
+ /** @platform ios - typed as always-present, guarded at runtime. */
39
+ createReminder(record: Record<string, unknown>): Promise<NativeExpoCalendarReminder>;
40
+ addEventWithForm(options?: Record<string, unknown>): Promise<IDialogEventResult>;
41
+ update(patch: Record<string, unknown>): Promise<void>;
42
+ delete(): Promise<void>;
43
+ }
44
+ export declare class NativeExpoCalendarEvent {
45
+ readonly id: string;
46
+ readonly calendarId?: string;
47
+ readonly title?: string;
48
+ readonly location?: string;
49
+ /** @platform ios */
50
+ readonly creationDate?: string;
51
+ /** @platform ios */
52
+ readonly lastModifiedDate?: string;
53
+ readonly timeZone?: string;
54
+ /** @platform android */
55
+ readonly endTimeZone?: string;
56
+ /** @platform ios */
57
+ readonly url?: string;
58
+ readonly notes?: string;
59
+ readonly alarms?: unknown[];
60
+ readonly recurrenceRule?: Record<string, unknown> | null;
61
+ readonly startDate?: string;
62
+ readonly endDate?: string;
63
+ /** @platform ios */
64
+ readonly originalStartDate?: string;
65
+ /** @platform ios */
66
+ readonly isDetached?: boolean;
67
+ readonly allDay: boolean;
68
+ readonly availability?: string;
69
+ readonly status?: string;
70
+ /** @platform ios */
71
+ readonly organizer?: Record<string, unknown>;
72
+ /** @platform android */
73
+ readonly organizerEmail?: string;
74
+ /** @platform android */
75
+ readonly accessLevel?: string;
76
+ /** @platform android */
77
+ readonly guestsCanModify?: boolean;
78
+ /** @platform android */
79
+ readonly guestsCanInviteOthers?: boolean;
80
+ /** @platform android */
81
+ readonly guestsCanSeeGuests?: boolean;
82
+ /** @platform android */
83
+ readonly originalId?: string;
84
+ /** @platform android */
85
+ readonly instanceId?: string;
86
+ /** @platform android - typed as always-present, guarded at runtime. */
87
+ createAttendee(record: Record<string, unknown>): Promise<NativeExpoCalendarAttendee>;
88
+ openInCalendar(options?: IOpenEventPresentationOptions | null): Promise<IDialogEventResult>;
89
+ editInCalendar(options?: IPresentationOptions | null): Promise<IDialogEventResult>;
90
+ getOccurrenceSync(options?: IRecurringEventOptions): NativeExpoCalendarEvent;
91
+ getAttendees(): Promise<NativeExpoCalendarAttendee[]>;
92
+ update(patch: Record<string, unknown>, nullableFields: string[]): Promise<void>;
93
+ delete(): Promise<void>;
94
+ }
95
+ /** @platform android - iOS registers this class with no properties or methods. */
96
+ export declare class NativeExpoCalendarAttendee {
97
+ constructor(record: Record<string, unknown>);
98
+ readonly id?: string;
99
+ readonly name?: string;
100
+ readonly role?: string;
101
+ readonly status?: string;
102
+ readonly type?: string;
103
+ readonly email?: string;
104
+ update(patch: Record<string, unknown>, nullableFields: string[]): Promise<void>;
105
+ delete(): Promise<void>;
106
+ }
107
+ /** @platform ios - Android registers this class with no properties or methods. */
108
+ export declare class NativeExpoCalendarReminder {
109
+ constructor(id: string);
110
+ readonly id?: string;
111
+ readonly calendarId?: string;
112
+ readonly title?: string;
113
+ readonly location?: string;
114
+ readonly creationDate?: string;
115
+ readonly lastModifiedDate?: string;
116
+ readonly timeZone?: string;
117
+ readonly url?: string;
118
+ readonly notes?: string;
119
+ readonly alarms?: unknown[];
120
+ readonly recurrenceRule?: Record<string, unknown> | null;
121
+ readonly allDay: boolean;
122
+ readonly startDate?: string;
123
+ readonly dueDate?: string;
124
+ readonly completed: boolean;
125
+ readonly completionDate?: string;
126
+ update(patch: Record<string, unknown>, nullableFields: string[]): Promise<void>;
127
+ delete(): Promise<void>;
128
+ }
129
+ export type INativeCalendarNextModule = {
130
+ ExpoCalendar: typeof NativeExpoCalendar;
131
+ ExpoCalendarEvent: typeof NativeExpoCalendarEvent;
132
+ ExpoCalendarAttendee: typeof NativeExpoCalendarAttendee;
133
+ ExpoCalendarReminder: typeof NativeExpoCalendarReminder;
134
+ getCalendars(type: string | null): Promise<NativeExpoCalendar[]>;
135
+ getCalendarById(id: string): Promise<NativeExpoCalendar>;
136
+ createCalendar(record: Record<string, unknown>): Promise<NativeExpoCalendar>;
137
+ listEvents(calendarIds: string[], startDate: string, endDate: string): Promise<NativeExpoCalendarEvent[]>;
138
+ getEventById(id: string): Promise<NativeExpoCalendarEvent>;
139
+ getCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;
140
+ requestCalendarPermissions(writeOnly?: boolean): Promise<PermissionResponse>;
141
+ /** @platform ios */
142
+ getDefaultCalendarSync?(): NativeExpoCalendar;
143
+ /** @platform ios */
144
+ presentPicker?(): Promise<NativeExpoCalendar | null>;
145
+ /** @platform ios */
146
+ getReminderById?(id: string): Promise<NativeExpoCalendarReminder>;
147
+ /** @platform ios */
148
+ getRemindersPermissions?(): Promise<PermissionResponse>;
149
+ /** @platform ios */
150
+ requestRemindersPermissions?(): Promise<PermissionResponse>;
151
+ /** @platform ios */
152
+ getSourcesSync?(): ISource[];
153
+ };
154
+ export declare const expoCalendarNext: INativeCalendarNextModule;
@@ -0,0 +1,4 @@
1
+ import { requireNativeModule } from 'expo-modules-core';
2
+ const EXPO_CALENDAR_NEXT_MODULE_NAME = 'CalendarNext';
3
+ export const expoCalendarNext = requireNativeModule(EXPO_CALENDAR_NEXT_MODULE_NAME);
4
+ //# sourceMappingURL=native-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAUxD,MAAM,8BAA8B,GAAG,cAAc,CAAC;AAuMtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CACjD,8BAA8B,CAC/B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { expoCalendarNext } from './native-module';
2
+ import type { NativeExpoCalendarReminder } from './native-module';
3
+ import type { IReminderPatch } from './types';
4
+ /** @platform ios - Android registers this class with no properties or methods. */
5
+ export declare class ExpoCalendarReminder extends expoCalendarNext.ExpoCalendarReminder {
6
+ update(details: IReminderPatch): Promise<void>;
7
+ delete(): Promise<void>;
8
+ static get(reminderId: string): Promise<ExpoCalendarReminder>;
9
+ }
10
+ export declare function upgradeToExpoCalendarReminder(native: NativeExpoCalendarReminder): ExpoCalendarReminder;
@@ -0,0 +1,35 @@
1
+ import { Platform, UnavailabilityError } from 'expo-modules-core';
2
+ import { expoCalendarNext } from './native-module';
3
+ import { getNullableDetailsFields, stringifyDateValues } from './utils';
4
+ /** @platform ios - Android registers this class with no properties or methods. */
5
+ export class ExpoCalendarReminder extends expoCalendarNext.ExpoCalendarReminder {
6
+ async update(details) {
7
+ if (Platform.OS !== 'ios') {
8
+ throw new UnavailabilityError('ExpoCalendarReminder', 'update');
9
+ }
10
+ return super.update(stringifyDateValues(details), getNullableDetailsFields(details));
11
+ }
12
+ async delete() {
13
+ if (Platform.OS !== 'ios') {
14
+ throw new UnavailabilityError('ExpoCalendarReminder', 'delete');
15
+ }
16
+ return super.delete();
17
+ }
18
+ static async get(reminderId) {
19
+ if (Platform.OS !== 'ios' || !expoCalendarNext.getReminderById) {
20
+ throw new UnavailabilityError('ExpoCalendarReminder', 'get');
21
+ }
22
+ return upgradeToExpoCalendarReminder(await expoCalendarNext.getReminderById(reminderId));
23
+ }
24
+ }
25
+ function isExpoCalendarReminder(value) {
26
+ return value instanceof ExpoCalendarReminder;
27
+ }
28
+ export function upgradeToExpoCalendarReminder(native) {
29
+ Object.setPrototypeOf(native, ExpoCalendarReminder.prototype);
30
+ if (!isExpoCalendarReminder(native)) {
31
+ throw new Error('unreachable - just reassigned the prototype to ExpoCalendarReminder');
32
+ }
33
+ return native;
34
+ }
35
+ //# sourceMappingURL=reminder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminder.js","sourceRoot":"","sources":["../../src/core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M,CAAC,cAAc,CAAC,MAAM,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC9D,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,184 @@
1
+ import type { AlarmMethod, AttendeeRole, AttendeeStatus, AttendeeType, CalendarAccessLevel, CalendarDialogResultActions, DayOfTheWeek, Frequency, MonthOfTheYear } from './enums';
2
+ export type ISource = {
3
+ id?: string;
4
+ type?: string;
5
+ name?: string;
6
+ isLocalAccount?: boolean;
7
+ };
8
+ export type IDaysOfTheWeek = {
9
+ dayOfTheWeek: DayOfTheWeek;
10
+ /** `-53` to `53`; `0` ignores this field. */
11
+ weekNumber?: number;
12
+ };
13
+ export type IRecurrenceRule = {
14
+ frequency: Frequency;
15
+ /** @default 1 */
16
+ interval?: number;
17
+ endDate?: string | Date | null;
18
+ occurrence?: number | null;
19
+ /** @platform ios */
20
+ daysOfTheWeek?: IDaysOfTheWeek[] | null;
21
+ /** @platform ios */
22
+ daysOfTheMonth?: number[] | null;
23
+ /** @platform ios */
24
+ monthsOfTheYear?: MonthOfTheYear[] | null;
25
+ /** @platform ios */
26
+ weeksOfTheYear?: number[] | null;
27
+ /** @platform ios */
28
+ daysOfTheYear?: number[] | null;
29
+ /** @platform ios */
30
+ setPositions?: number[] | null;
31
+ };
32
+ export type IAlarmLocation = {
33
+ title?: string;
34
+ proximity?: string;
35
+ radius?: number;
36
+ coords?: {
37
+ latitude?: number;
38
+ longitude?: number;
39
+ };
40
+ };
41
+ export type IAlarm = {
42
+ /** @platform ios */
43
+ absoluteDate?: string;
44
+ relativeOffset?: number;
45
+ structuredLocation?: IAlarmLocation;
46
+ /** @platform android */
47
+ method?: AlarmMethod;
48
+ };
49
+ /** Fields for `createCalendar()` - all optional, matches upstream's `Partial<Calendar>`. */
50
+ export type ICalendarInput = {
51
+ title?: string;
52
+ /** @platform android */
53
+ name?: string;
54
+ source?: ISource;
55
+ color?: string;
56
+ /** @platform android */
57
+ isVisible?: boolean;
58
+ /** @platform android */
59
+ isSynced?: boolean;
60
+ /** @platform android */
61
+ timeZone?: string;
62
+ /** @platform android */
63
+ isPrimary?: boolean;
64
+ allowedAvailabilities?: string[];
65
+ /** @platform android */
66
+ allowedReminders?: AlarmMethod[];
67
+ /** @platform android */
68
+ allowedAttendeeTypes?: AttendeeType[];
69
+ /** @platform android */
70
+ ownerAccount?: string;
71
+ /** @platform android */
72
+ accessLevel?: CalendarAccessLevel;
73
+ /** @platform ios */
74
+ sourceId?: string;
75
+ };
76
+ /** Fields for `calendar.update()`; a field set to `null` clears it natively. */
77
+ export type ICalendarPatch = {
78
+ title?: string | null;
79
+ /** @platform android */
80
+ name?: string | null;
81
+ color?: string | null;
82
+ /** @platform android */
83
+ isVisible?: boolean | null;
84
+ /** @platform android */
85
+ isSynced?: boolean | null;
86
+ /** @platform android */
87
+ timeZone?: string | null;
88
+ };
89
+ /** Fields for `calendar.createEvent()` - all optional, matches upstream's `Omit<Partial<...>>`. */
90
+ export type IEventInput = {
91
+ startDate?: string | Date;
92
+ endDate?: string | Date;
93
+ title?: string;
94
+ location?: string;
95
+ timeZone?: string;
96
+ /** @platform android */
97
+ endTimeZone?: string;
98
+ notes?: string;
99
+ alarms?: IAlarm[];
100
+ recurrenceRule?: IRecurrenceRule;
101
+ allDay?: boolean;
102
+ availability?: string;
103
+ /** @platform android */
104
+ status?: string;
105
+ /** @platform android */
106
+ organizerEmail?: string;
107
+ /** @platform android */
108
+ accessLevel?: string;
109
+ /** @platform android */
110
+ guestsCanModify?: boolean;
111
+ /** @platform android */
112
+ guestsCanInviteOthers?: boolean;
113
+ /** @platform android */
114
+ guestsCanSeeGuests?: boolean;
115
+ };
116
+ /** Fields for `event.update()`; a field set to `null` clears it natively. */
117
+ export type IEventPatch = Partial<{
118
+ [K in keyof IEventInput]: IEventInput[K] | null;
119
+ }>;
120
+ /** Fields for `event.createAttendee()`. @platform android */
121
+ export type IAttendeeInput = {
122
+ name: string;
123
+ role: AttendeeRole;
124
+ status: AttendeeStatus;
125
+ type: AttendeeType;
126
+ email: string;
127
+ };
128
+ /** Fields for `attendee.update()`. @platform android */
129
+ export type IAttendeePatch = Partial<{
130
+ [K in keyof IAttendeeInput]: IAttendeeInput[K] | null;
131
+ }>;
132
+ /** Fields for `calendar.createReminder()`. @platform ios */
133
+ export type IReminderInput = {
134
+ title?: string;
135
+ location?: string;
136
+ notes?: string;
137
+ startDate?: string | Date;
138
+ dueDate?: string | Date;
139
+ completionDate?: string | Date;
140
+ timeZone?: string;
141
+ alarms?: IAlarm[];
142
+ recurrenceRule?: IRecurrenceRule;
143
+ url?: string;
144
+ allDay?: boolean;
145
+ completed?: boolean;
146
+ };
147
+ /** Fields for `reminder.update()`; a field set to `null` clears it natively. @platform ios */
148
+ export type IReminderPatch = Partial<{
149
+ [K in keyof IReminderInput]: IReminderInput[K] | null;
150
+ }>;
151
+ export type IRecurringEventOptions = {
152
+ /** Applies to `instanceStartDate` and every future occurrence when `true`. */
153
+ futureEvents?: boolean;
154
+ instanceStartDate?: string | Date;
155
+ };
156
+ export type IPresentationOptions = {
157
+ /** `true` resolves `'done'` right after opening. @default true @platform android */
158
+ startNewActivityTask?: boolean;
159
+ };
160
+ export type IOpenEventPresentationOptions = IPresentationOptions & {
161
+ /** @default false @platform ios */
162
+ allowsEditing?: boolean;
163
+ /** @default false @platform ios */
164
+ allowsCalendarPreview?: boolean;
165
+ };
166
+ /** Fields for `calendar.addEventWithForm()`. */
167
+ export type IAddEventWithFormOptions = {
168
+ title?: string;
169
+ location?: string;
170
+ notes?: string;
171
+ url?: string;
172
+ /** @platform android */
173
+ timeZone?: string;
174
+ availability?: string;
175
+ allDay?: boolean;
176
+ startDate?: string | Date;
177
+ endDate?: string | Date;
178
+ recurrenceRule?: IRecurrenceRule;
179
+ alarms?: IAlarm[];
180
+ } & IPresentationOptions;
181
+ export type IDialogEventResult = {
182
+ action: CalendarDialogResultActions;
183
+ id?: string | null;
184
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export declare function stringifyIfDate(value: Date): string;
2
+ export declare function stringifyIfDate(value: unknown): unknown;
3
+ /** Recursively converts every `Date` field of `obj` to an ISO string for the native bridge. */
4
+ export declare function stringifyDateValues(obj: Record<string, unknown>): Record<string, unknown>;
5
+ /** `null` in a patch means "clear natively" - the native `update()` needs the field named
6
+ * separately, in addition to staying in the stringified record with its `null` value. */
7
+ export declare function getNullableDetailsFields(details: Record<string, unknown>): string[];
@@ -0,0 +1,30 @@
1
+ export function stringifyIfDate(value) {
2
+ return value instanceof Date ? value.toISOString() : value;
3
+ }
4
+ function isPlainObject(value) {
5
+ return (typeof value === 'object' &&
6
+ value !== null &&
7
+ !Array.isArray(value) &&
8
+ !(value instanceof Date));
9
+ }
10
+ function stringifyValue(value) {
11
+ if (Array.isArray(value))
12
+ return value.map(stringifyValue);
13
+ if (isPlainObject(value))
14
+ return stringifyDateValues(value);
15
+ return stringifyIfDate(value);
16
+ }
17
+ /** Recursively converts every `Date` field of `obj` to an ISO string for the native bridge. */
18
+ export function stringifyDateValues(obj) {
19
+ const result = {};
20
+ for (const [key, value] of Object.entries(obj)) {
21
+ result[key] = stringifyValue(value);
22
+ }
23
+ return result;
24
+ }
25
+ /** `null` in a patch means "clear natively" - the native `update()` needs the field named
26
+ * separately, in addition to staying in the stringified record with its `null` value. */
27
+ export function getNullableDetailsFields(details) {
28
+ return Object.keys(details).filter(key => details[key] === null);
29
+ }
30
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":"AAEA,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": "expo.modules.calendar.CalendarModule",
7
+ "className": "CalendarModule",
8
+ "nativeName": "ExpoCalendar"
9
+ },
10
+ {
11
+ "importPath": "expo.modules.calendar.next.CalendarNextModule",
12
+ "className": "CalendarNextModule",
13
+ "nativeName": "CalendarNext"
14
+ }
15
+ ],
16
+ "manifestPermissions": [
17
+ "android.permission.READ_CALENDAR",
18
+ "android.permission.WRITE_CALENDAR"
19
+ ]
20
+ },
21
+ "ios": {
22
+ "infoPlistKeys": {
23
+ "NSCalendarsUsageDescription": "This app uses your calendars to read and manage events.",
24
+ "NSRemindersUsageDescription": "This app uses your reminders to read and manage tasks.",
25
+ "NSRemindersFullAccessUsageDescription": "This app uses your reminders to read and manage tasks.",
26
+ "NSCalendarsFullAccessUsageDescription": "This app uses your calendars to read and manage events."
27
+ }
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,155 @@
1
+ {
2
+ "name": "@symbiote-native/calendar",
3
+ "version": "0.1.0",
4
+ "description": "expo-calendar wrapped for SymbioteNative — one framework-agnostic core, built once and reachable from the React, Vue, Svelte, Solid, and Angular adapters. Both surfaces: the modern ExpoCalendar/ExpoCalendarEvent/ExpoCalendarReminder/ExpoCalendarAttendee API (default entry) and the legacy function-based API (/legacy subpath).",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "react-native",
8
+ "symbiote-native",
9
+ "expo-calendar",
10
+ "react",
11
+ "vue",
12
+ "svelte",
13
+ "solid",
14
+ "angular",
15
+ "calendar",
16
+ "events",
17
+ "reminders"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/OneEyed1366/symbiote-native.git",
22
+ "directory": "packages/calendar"
23
+ },
24
+ "homepage": "https://github.com/OneEyed1366/symbiote-native/tree/master/packages/calendar#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/OneEyed1366/symbiote-native/issues"
27
+ },
28
+ "author": "Andrey Prokopenko <psevdoproger@gmail.com>",
29
+ "type": "module",
30
+ "main": "./build/core/index.js",
31
+ "module": "./build/core/index.js",
32
+ "types": "./build/core/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./build/core/index.d.ts",
36
+ "default": "./build/core/index.js"
37
+ },
38
+ "./vue": {
39
+ "types": "./build/vue/index.d.ts",
40
+ "default": "./build/vue/index.js"
41
+ },
42
+ "./react": {
43
+ "types": "./build/react/index.d.ts",
44
+ "default": "./build/react/index.js"
45
+ },
46
+ "./svelte": {
47
+ "types": "./build/svelte/index.d.ts",
48
+ "default": "./build/svelte/index.js"
49
+ },
50
+ "./solid": {
51
+ "types": "./build/solid/index.d.ts",
52
+ "default": "./build/solid/index.js"
53
+ },
54
+ "./angular": {
55
+ "types": "./build-ngc/angular/index.d.ts",
56
+ "react-native": "./build-ngc/angular/index.js",
57
+ "default": "./src/angular/index.ts"
58
+ },
59
+ "./legacy": {
60
+ "types": "./build/legacy/index.d.ts",
61
+ "default": "./build/legacy/index.js"
62
+ }
63
+ },
64
+ "files": [
65
+ "src",
66
+ "build",
67
+ "build-ngc",
68
+ "native-link.json",
69
+ "!src/**/*.test.*",
70
+ "!src/**/*.spec.*",
71
+ "!src/**/*.detox.*"
72
+ ],
73
+ "publishConfig": {
74
+ "access": "public"
75
+ },
76
+ "dependencies": {
77
+ "expo-calendar": "57.0.5",
78
+ "expo-modules-core": "57.0.20"
79
+ },
80
+ "peerDependencies": {
81
+ "@angular/core": ">=20",
82
+ "@vue/runtime-core": "^3.5.13",
83
+ "react": ">=19.0.0",
84
+ "react-native": ">=0.86",
85
+ "solid-js": ">=1.9.0",
86
+ "svelte": ">=5.56.0",
87
+ "vue": ">=3.5.0",
88
+ "@symbiote-native/angular": "^3.1.3",
89
+ "@symbiote-native/svelte": "^3.0.5",
90
+ "@symbiote-native/engine": "^1.4.0",
91
+ "@symbiote-native/react": "^3.1.0",
92
+ "@symbiote-native/solid": "^3.0.5",
93
+ "@symbiote-native/vue": "^3.1.0"
94
+ },
95
+ "peerDependenciesMeta": {
96
+ "@symbiote-native/angular": {
97
+ "optional": true
98
+ },
99
+ "@symbiote-native/react": {
100
+ "optional": true
101
+ },
102
+ "@symbiote-native/solid": {
103
+ "optional": true
104
+ },
105
+ "@symbiote-native/svelte": {
106
+ "optional": true
107
+ },
108
+ "@symbiote-native/vue": {
109
+ "optional": true
110
+ },
111
+ "@angular/core": {
112
+ "optional": true
113
+ },
114
+ "@vue/runtime-core": {
115
+ "optional": true
116
+ },
117
+ "react": {
118
+ "optional": true
119
+ },
120
+ "solid-js": {
121
+ "optional": true
122
+ },
123
+ "svelte": {
124
+ "optional": true
125
+ },
126
+ "vue": {
127
+ "optional": true
128
+ }
129
+ },
130
+ "devDependencies": {
131
+ "@angular/compiler": "~22.0.8",
132
+ "@angular/compiler-cli": "~22.0.8",
133
+ "@angular/core": "~22.0.8",
134
+ "@types/node": "^26.0.0",
135
+ "@types/react": "^19.2.0",
136
+ "@vue/runtime-core": "^3.5.13",
137
+ "react": "19.2.3",
138
+ "solid-js": "^1.9.14",
139
+ "typescript": "~6.0.0",
140
+ "svelte": "^5.56.0",
141
+ "@symbiote-native/engine": "1.4.0",
142
+ "@symbiote-native/solid": "3.0.5",
143
+ "@symbiote-native/angular": "3.1.3",
144
+ "@symbiote-native/react": "3.1.0",
145
+ "@symbiote-native/test-utils": "0.4.5",
146
+ "@symbiote-native/svelte": "3.0.5",
147
+ "@symbiote-native/vue": "3.1.0"
148
+ },
149
+ "scripts": {
150
+ "typecheck": "tsc --build",
151
+ "clean": "rm -rf build-ngc",
152
+ "ng:build": "pnpm run clean && ngc -p tsconfig.angular.json",
153
+ "format": "prettier --write \"src/**/*.{ts,tsx}\""
154
+ }
155
+ }
@@ -0,0 +1,3 @@
1
+ export * from '../core';
2
+ export { CalendarPermissionsService } from './services/calendar-permissions.service';
3
+ export { RemindersPermissionsService } from './services/reminders-permissions.service';
@@ -0,0 +1,19 @@
1
+ // Angular twin of `../../react`'s `useCalendarPermissions`, `get`/`request` take `writeOnly`
2
+
3
+ import { Injectable } from '@angular/core';
4
+ import { PermissionsServiceBase } from '@symbiote-native/angular';
5
+ import {
6
+ getCalendarPermissions,
7
+ requestCalendarPermissions,
8
+ } from '../../../core/calendar';
9
+ import type { PermissionResponse } from 'expo-modules-core';
10
+
11
+ @Injectable({ providedIn: 'root' })
12
+ export class CalendarPermissionsService extends PermissionsServiceBase<
13
+ PermissionResponse,
14
+ boolean
15
+ > {
16
+ constructor() {
17
+ super(getCalendarPermissions, requestCalendarPermissions);
18
+ }
19
+ }