@ebarooni/capacitor-calendar 0.4.0 → 0.5.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 (45) hide show
  1. package/README.md +95 -24
  2. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +18 -0
  3. package/dist/docs.json +290 -42
  4. package/dist/esm/definitions.d.ts +108 -55
  5. package/dist/esm/definitions.js +1 -31
  6. package/dist/esm/definitions.js.map +1 -1
  7. package/dist/esm/index.d.ts +10 -1
  8. package/dist/esm/index.js +5 -1
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/esm/schemas/enums/calendar-chooser-display-style.d.ts +15 -0
  11. package/dist/esm/schemas/enums/calendar-chooser-display-style.js +17 -0
  12. package/dist/esm/schemas/enums/calendar-chooser-display-style.js.map +1 -0
  13. package/dist/esm/schemas/enums/calendar-chooser-selection-style.d.ts +15 -0
  14. package/dist/esm/schemas/enums/calendar-chooser-selection-style.js +17 -0
  15. package/dist/esm/schemas/enums/calendar-chooser-selection-style.js.map +1 -0
  16. package/dist/esm/schemas/enums/plugin-permission.d.ts +22 -0
  17. package/dist/esm/schemas/enums/plugin-permission.js +24 -0
  18. package/dist/esm/schemas/enums/plugin-permission.js.map +1 -0
  19. package/dist/esm/schemas/enums/reminder-recurrence-frequency.d.ts +6 -0
  20. package/dist/esm/schemas/enums/reminder-recurrence-frequency.js +8 -0
  21. package/dist/esm/schemas/enums/reminder-recurrence-frequency.js.map +1 -0
  22. package/dist/esm/schemas/interfaces/calendar.d.ts +12 -0
  23. package/dist/esm/schemas/interfaces/calendar.js +2 -0
  24. package/dist/esm/schemas/interfaces/calendar.js.map +1 -0
  25. package/dist/esm/schemas/interfaces/plugin-permissions-map.d.ts +4 -0
  26. package/dist/esm/schemas/interfaces/plugin-permissions-map.js +2 -0
  27. package/dist/esm/schemas/interfaces/plugin-permissions-map.js.map +1 -0
  28. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.d.ts +36 -0
  29. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js +2 -0
  30. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js.map +1 -0
  31. package/dist/esm/schemas/interfaces/reminders-list.d.ts +3 -0
  32. package/dist/esm/schemas/interfaces/reminders-list.js +2 -0
  33. package/dist/esm/schemas/interfaces/reminders-list.js.map +1 -0
  34. package/dist/esm/web.d.ts +31 -5
  35. package/dist/esm/web.js +9 -0
  36. package/dist/esm/web.js.map +1 -1
  37. package/dist/plugin.cjs.js +55 -14
  38. package/dist/plugin.cjs.js.map +1 -1
  39. package/dist/plugin.js +55 -14
  40. package/dist/plugin.js.map +1 -1
  41. package/ios/Plugin/CapacitorCalendarPlugin.m +3 -0
  42. package/ios/Plugin/CapacitorCalendarPlugin.swift +104 -23
  43. package/ios/Plugin/CapacitorReminders.swift +177 -0
  44. package/package.json +4 -4
  45. package/ios/Plugin/Calendar.swift +0 -14
@@ -1,65 +1,24 @@
1
+ import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style";
2
+ import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style";
3
+ import { PluginPermission } from "./schemas/enums/plugin-permission";
1
4
  import type { PermissionState } from '@capacitor/core';
2
- /**
3
- * Enum representing the selection style for the calendar chooser.
4
- * @readonly
5
- * @enum
6
- */
7
- export declare enum CalendarChooserSelectionStyle {
8
- /**
9
- * Allows only a single selection in the calendar chooser.
10
- */
11
- SINGLE = 0,
12
- /**
13
- * Allows multiple selections in the calendar chooser.
14
- */
15
- MULTIPLE = 1
16
- }
17
- /**
18
- * Enum representing the display styles for the calendar chooser.
19
- * @enum
20
- */
21
- export declare enum CalendarChooserDisplayStyle {
22
- /**
23
- * Display all calendars available for selection.
24
- */
25
- ALL_CALENDARS = 0,
26
- /**
27
- * Display only writable calendars available for selection.
28
- */
29
- WRITABLE_CALENDARS_ONLY = 1
30
- }
31
- /**
32
- * Represents a calendar object with an ID and title.
33
- *
34
- * @interface Calendar
35
- * @property {string} id - The unique identifier of the calendar.
36
- * @property {string} title - The title or name of the calendar.
37
- */
38
- export interface Calendar {
39
- id: string;
40
- title: string;
41
- }
42
- /**
43
- * Describes the permission status for reading from the calendar.
44
- *
45
- * @interface
46
- */
47
- export interface CalendarPermissionStatus {
48
- readCalendar: PermissionState;
49
- writeCalendar: PermissionState;
50
- }
5
+ import type { Calendar } from "./schemas/interfaces/calendar";
6
+ import type { RemindersList } from "./schemas/interfaces/reminders-list";
7
+ import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
8
+ import type { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule";
51
9
  export interface CapacitorCalendarPlugin {
52
10
  /**
53
11
  * Checks the current authorization status of a specific permission.
54
12
  *
55
13
  * @method
14
+ * @platform iOS, Android
56
15
  * @param options An object with the name of the permission
57
16
  * @returns {Promise<{ result: PermissionState }>} – A promise that resolves with the current status of the requested permission.
58
17
  * @example
59
18
  * const status = await this.checkPermission({ alias: 'readCalendar' });
60
19
  */
61
20
  checkPermission(options: {
62
- alias: keyof CalendarPermissionStatus;
21
+ alias: PluginPermission;
63
22
  }): Promise<{
64
23
  result: PermissionState;
65
24
  }>;
@@ -67,23 +26,25 @@ export interface CapacitorCalendarPlugin {
67
26
  * Checks the current authorization status of all the required permissions for the plugin.
68
27
  *
69
28
  * @method
70
- * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with an object containing all the permissions and their status.
29
+ * @platform iOS, Android
30
+ * @returns {Promise&lt;PluginPermissionsMap&gt;} – A promise that resolves with an object containing all the permissions and their status.
71
31
  * @example
72
32
  * const permissionsStatus = await this.checkAllPermissions();
73
33
  */
74
- checkAllPermissions(): Promise<CalendarPermissionStatus>;
34
+ checkAllPermissions(): Promise<PluginPermissionsMap>;
75
35
  /**
76
36
  * Requests authorization to a specific permission, if not already granted.
77
37
  * If the permission is already granted, it will directly return the status.
78
38
  *
79
39
  * @method
40
+ * @platform iOS, Android
80
41
  * @param options An object with the name of the permission
81
42
  * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the new permission status after the request is made.
82
43
  * @example
83
44
  * const result = await this.requestPermission({ alias: 'readCalendar' });
84
45
  */
85
46
  requestPermission(options: {
86
- alias: keyof CalendarPermissionStatus;
47
+ alias: PluginPermission;
87
48
  }): Promise<{
88
49
  result: PermissionState;
89
50
  }>;
@@ -91,11 +52,12 @@ export interface CapacitorCalendarPlugin {
91
52
  * Requests authorization to all the required permissions for the plugin, if they have not already been granted.
92
53
  *
93
54
  * @method
94
- * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with the new permission statuses after the request is made.
55
+ * @platform iOS, Android
56
+ * @returns {Promise&lt;PluginPermissionsMap&gt;} – A promise that resolves with the new permission statuses after the request is made.
95
57
  * @example
96
58
  * const permissionResults = await this.requestAllPermissions();
97
59
  */
98
- requestAllPermissions(): Promise<CalendarPermissionStatus>;
60
+ requestAllPermissions(): Promise<PluginPermissionsMap>;
99
61
  /**
100
62
  * Creates an event in the calendar by using the native calendar.
101
63
  * On iOS opens a native sheet and on Android opens an intent.
@@ -103,6 +65,7 @@ export interface CapacitorCalendarPlugin {
103
65
  * On Android, the user has to authorize for read access.
104
66
  *
105
67
  * @method
68
+ * @platform iOS, Android
106
69
  * @returns {Promise&lt;{ eventCreated: boolean }&gt;} – A promise that resolves with the result of the action.
107
70
  * @example
108
71
  * let result: CalendarEventActionResult;
@@ -124,6 +87,7 @@ export interface CapacitorCalendarPlugin {
124
87
  * Presents a prompt to the user to select calendars. This method is available only on iOS.
125
88
  *
126
89
  * @method selectCalendarsWithPrompt
90
+ * @platform iOS
127
91
  * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.
128
92
  * @async
129
93
  * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,
@@ -145,6 +109,7 @@ export interface CapacitorCalendarPlugin {
145
109
  *
146
110
  * @async
147
111
  * @method listCalendars
112
+ * @platform iOS, Android
148
113
  * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.
149
114
  * Each calendar object in the array contains an ID and a title.
150
115
  * @example
@@ -158,6 +123,7 @@ export interface CapacitorCalendarPlugin {
158
123
  * Retrieves the default calendar set on the device.
159
124
  *
160
125
  * @method getDefaultCalendar
126
+ * @platform iOS, Android
161
127
  * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.
162
128
  * The returned calendar object contains an ID and a title.
163
129
  * @example
@@ -171,6 +137,7 @@ export interface CapacitorCalendarPlugin {
171
137
  * Creates an event with the provided options.
172
138
  *
173
139
  * @method createEvent
140
+ * @platform iOS, Android
174
141
  * @param {object} options - Options for creating the event.
175
142
  * @param {string} options.title - The title of the event.
176
143
  * @param {string} options.calendarId - The id of the destination calendar. (Optional)
@@ -202,4 +169,90 @@ export interface CapacitorCalendarPlugin {
202
169
  }): Promise<{
203
170
  eventCreated: boolean;
204
171
  }>;
172
+ /**
173
+ * Retrieves the default reminders list set on the device.
174
+ *
175
+ * @method getDefaultRemindersList
176
+ * @platform iOS
177
+ * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.
178
+ * The returned reminders list object contains an ID and a title.
179
+ * @example
180
+ * const { result } = await getDefaultRemindersList();
181
+ * console.log(result); // { id: '1', title: 'Default Reminders List' }
182
+ */
183
+ getDefaultRemindersList(): Promise<{
184
+ result: RemindersList;
185
+ }>;
186
+ /**
187
+ * Retrieves all available reminders lists on the device.
188
+ *
189
+ * @async
190
+ * @method getRemindersLists
191
+ * @platform iOS
192
+ * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.
193
+ * Each reminders list object in the array contains an ID and a title.
194
+ * @example
195
+ * const { result } = await getRemindersLists();
196
+ * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]
197
+ */
198
+ getRemindersLists(): Promise<{
199
+ result: RemindersList[];
200
+ }>;
201
+ /**
202
+ * Creates a reminder with the provided options.
203
+ *
204
+ * @method createReminder
205
+ * @platform iOS
206
+ * @param {object} options - Options for creating the reminder.
207
+ * @param {string} options.title - The title of the reminder.
208
+ * @param {string} options.listId - The id of the destination reminders list. (Optional)
209
+ * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine
210
+ * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the
211
+ * nearest border. (Optional)
212
+ * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)
213
+ * @param {number} [options.startDate] - The start date of the reminder. (Optional)
214
+ * @param {number} [options.dueDate] - The due date of the reminder. (Optional)
215
+ * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)
216
+ * @param {string} [options.notes] - Additional notes about the reminder. (Optional)
217
+ * @param {string} [options.url] - A URL to save under the reminder. (Optional)
218
+ * @param {string} [options.location] - A location to save under the reminder. (Optional)
219
+ * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)
220
+ * @returns {Promise<{ reminderCreated: boolean }>} A Promise that resolves with an object indicating whether the reminder was created successfully.
221
+ * The resolved object has a property 'reminderCreated' which is a boolean value representing whether the reminder was created.
222
+ * @example
223
+ * const now = Date.now();
224
+ * const rules: ReminderRecurrenceRule = {
225
+ * frequency: ReminderRecurrenceFrequency.MONTHLY,
226
+ * interval: 10,
227
+ * end: Date.now()
228
+ * }
229
+ * const reminderOptions = {
230
+ * title: 'Buy cucumber',
231
+ * listId: 'ABC12',
232
+ * priority: 5,
233
+ * isCompleted: false,
234
+ * startDateComponents: now,
235
+ * notes: 'Also buy tomatoes',
236
+ * url: 'https://capacitor-calendar.pages.dev/',
237
+ * location: 'My Local Supermarket',
238
+ * recurrence: rules
239
+ * };
240
+ * const { reminderCreated } = await createReminder(reminderOptions);
241
+ * console.log(reminderCreated); // true
242
+ */
243
+ createReminder(options: {
244
+ title: string;
245
+ listId?: string;
246
+ priority?: number;
247
+ isCompleted?: boolean;
248
+ startDate?: number;
249
+ dueDate?: number;
250
+ completionDate?: number;
251
+ notes?: string;
252
+ url?: string;
253
+ location?: string;
254
+ recurrence?: ReminderRecurrenceRule;
255
+ }): Promise<{
256
+ reminderCreated: boolean;
257
+ }>;
205
258
  }
@@ -1,32 +1,2 @@
1
- /**
2
- * Enum representing the selection style for the calendar chooser.
3
- * @readonly
4
- * @enum
5
- */
6
- export var CalendarChooserSelectionStyle;
7
- (function (CalendarChooserSelectionStyle) {
8
- /**
9
- * Allows only a single selection in the calendar chooser.
10
- */
11
- CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["SINGLE"] = 0] = "SINGLE";
12
- /**
13
- * Allows multiple selections in the calendar chooser.
14
- */
15
- CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
16
- })(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));
17
- /**
18
- * Enum representing the display styles for the calendar chooser.
19
- * @enum
20
- */
21
- export var CalendarChooserDisplayStyle;
22
- (function (CalendarChooserDisplayStyle) {
23
- /**
24
- * Display all calendars available for selection.
25
- */
26
- CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
27
- /**
28
- * Display only writable calendars available for selection.
29
- */
30
- CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
31
- })(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));
1
+ export {};
32
2
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAN,IAAY,6BAUX;AAVD,WAAY,6BAA6B;IACvC;;OAEG;IACH,qFAAM,CAAA;IAEN;;OAEG;IACH,yFAAQ,CAAA;AACV,CAAC,EAVW,6BAA6B,KAA7B,6BAA6B,QAUxC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAUX;AAVD,WAAY,2BAA2B;IACrC;;OAEG;IACH,+FAAa,CAAA;IAEb;;OAEG;IACH,mHAAuB,CAAA;AACzB,CAAC,EAVW,2BAA2B,KAA3B,2BAA2B,QAUtC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport enum CalendarChooserSelectionStyle {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n SINGLE,\n\n /**\n * Allows multiple selections in the calendar chooser.\n */\n MULTIPLE\n}\n\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport enum CalendarChooserDisplayStyle {\n /**\n * Display all calendars available for selection.\n */\n ALL_CALENDARS,\n\n /**\n * Display only writable calendars available for selection.\n */\n WRITABLE_CALENDARS_ONLY\n}\n\n/**\n * Represents a calendar object with an ID and title.\n *\n * @interface Calendar\n * @property {string} id - The unique identifier of the calendar.\n * @property {string} title - The title or name of the calendar.\n */\nexport interface Calendar {\n id: string;\n title: string;\n}\n\n/**\n * Describes the permission status for reading from the calendar.\n *\n * @interface\n */\nexport interface CalendarPermissionStatus {\n readCalendar: PermissionState;\n writeCalendar: PermissionState;\n}\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the current status of the requested permission.\n * @example\n * const status = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Requests authorization to a specific permission, if not already granted.\n * If the permission is already granted, it will directly return the status.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the new permission status after the request is made.\n * @example\n * const result = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Requests authorization to all the required permissions for the plugin, if they have not already been granted.\n *\n * @method\n * @returns {Promise&lt;CalendarPermissionStatus&gt;} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @returns {Promise&lt;{ eventCreated: boolean }&gt;} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle,\n selectionStyle: CalendarChooserSelectionStyle\n }): Promise<{ result: Calendar[] }>\n\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.\n * Each calendar object in the array contains an ID and a title.\n * @example\n * const { result } = await listCalendars();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]\n */\n listCalendars(): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves the default calendar set on the device.\n *\n * @method getDefaultCalendar\n * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {Date} [options.startDate] - The start date and time of the event. (Optional)\n * @param {Date} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @returns {Promise<{ eventCreated: boolean }>} A Promise that resolves with an object indicating whether the event was created successfully.\n * The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: new Date(now),\n * endDate: new Date(now + 2 * 60 * 60 * 1000),\n * isAllDay: false\n * };\n * const { eventCreated } = await createEvent(eventOptions);\n * console.log(eventCreated); // true\n */\n createEvent(options: { title: string, calendarId?: string, location?: string, startDate?: Date, endDate?: Date, isAllDay?: boolean }): Promise<{ eventCreated: boolean }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import {CalendarChooserDisplayStyle} from \"./schemas/enums/calendar-chooser-display-style\";\nimport {CalendarChooserSelectionStyle} from \"./schemas/enums/calendar-chooser-selection-style\";\nimport {PluginPermission} from \"./schemas/enums/plugin-permission\";\nimport type { PermissionState } from '@capacitor/core';\nimport type {Calendar} from \"./schemas/interfaces/calendar\";\nimport type {RemindersList} from \"./schemas/interfaces/reminders-list\";\nimport type {PluginPermissionsMap} from './schemas/interfaces/plugin-permissions-map';\nimport type {ReminderRecurrenceRule} from \"./schemas/interfaces/reminder-recurrence-rule\";\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the current status of the requested permission.\n * @example\n * const status = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: { alias: PluginPermission }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise&lt;PluginPermissionsMap&gt;} – A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<PluginPermissionsMap>;\n\n /**\n * Requests authorization to a specific permission, if not already granted.\n * If the permission is already granted, it will directly return the status.\n *\n * @method\n * @platform iOS, Android\n * @param options An object with the name of the permission\n * @returns {Promise&lt;{ result: PermissionState }&gt;} – A promise that resolves with the new permission status after the request is made.\n * @example\n * const result = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: PluginPermission }): Promise<{ result: PermissionState }>;\n\n /**\n * Requests authorization to all the required permissions for the plugin, if they have not already been granted.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise&lt;PluginPermissionsMap&gt;} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<PluginPermissionsMap>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise&lt;{ eventCreated: boolean }&gt;} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @platform iOS\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle,\n selectionStyle: CalendarChooserSelectionStyle\n }): Promise<{ result: Calendar[] }>\n\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @platform iOS, Android\n * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.\n * Each calendar object in the array contains an ID and a title.\n * @example\n * const { result } = await listCalendars();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]\n */\n listCalendars(): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves the default calendar set on the device.\n *\n * @method getDefaultCalendar\n * @platform iOS, Android\n * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @platform iOS, Android\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {Date} [options.startDate] - The start date and time of the event. (Optional)\n * @param {Date} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @returns {Promise<{ eventCreated: boolean }>} A Promise that resolves with an object indicating whether the event was created successfully.\n * The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: new Date(now),\n * endDate: new Date(now + 2 * 60 * 60 * 1000),\n * isAllDay: false\n * };\n * const { eventCreated } = await createEvent(eventOptions);\n * console.log(eventCreated); // true\n */\n createEvent(options: { title: string, calendarId?: string, location?: string, startDate?: Date, endDate?: Date, isAllDay?: boolean }): Promise<{ eventCreated: boolean }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @method getDefaultRemindersList\n * @platform iOS\n * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.\n * The returned reminders list object contains an ID and a title.\n * @example\n * const { result } = await getDefaultRemindersList();\n * console.log(result); // { id: '1', title: 'Default Reminders List' }\n */\n getDefaultRemindersList(): Promise<{ result: RemindersList }>;\n\n /**\n * Retrieves all available reminders lists on the device.\n *\n * @async\n * @method getRemindersLists\n * @platform iOS\n * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.\n * Each reminders list object in the array contains an ID and a title.\n * @example\n * const { result } = await getRemindersLists();\n * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]\n */\n getRemindersLists(): Promise<{ result: RemindersList[] }>;\n\n /**\n * Creates a reminder with the provided options.\n *\n * @method createReminder\n * @platform iOS\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ reminderCreated: boolean }>} A Promise that resolves with an object indicating whether the reminder was created successfully.\n * The resolved object has a property 'reminderCreated' which is a boolean value representing whether the reminder was created.\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { reminderCreated } = await createReminder(reminderOptions);\n * console.log(reminderCreated); // true\n */\n createReminder(options: {\n title: string,\n listId?: string,\n priority?: number,\n isCompleted?: boolean,\n startDate?: number,\n dueDate?: number,\n completionDate?: number,\n notes?: string,\n url?: string,\n location?: string,\n recurrence?: ReminderRecurrenceRule,\n }): Promise<{ reminderCreated: boolean }>;\n}\n"]}
@@ -1,4 +1,13 @@
1
+ import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';
2
+ import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';
3
+ import { PluginPermission } from './schemas/enums/plugin-permission';
4
+ import { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';
1
5
  import type { CapacitorCalendarPlugin } from './definitions';
6
+ import type { Calendar } from './schemas/interfaces/calendar';
7
+ import type { RemindersList } from './schemas/interfaces/reminders-list';
8
+ import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
9
+ import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';
2
10
  declare const CapacitorCalendar: CapacitorCalendarPlugin;
3
11
  export * from './definitions';
4
- export { CapacitorCalendar };
12
+ export type { Calendar, RemindersList, ReminderRecurrenceRule };
13
+ export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CapacitorCalendar, };
package/dist/esm/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
+ import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';
3
+ import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';
4
+ import { PluginPermission } from './schemas/enums/plugin-permission';
5
+ import { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';
2
6
  const CapacitorCalendar = registerPlugin('CapacitorCalendar', {
3
7
  web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),
4
8
  });
5
9
  export * from './definitions';
6
- export { CapacitorCalendar };
10
+ export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };
7
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,iBAAiB,GAAG,cAAc,CACtC,mBAAmB,EACjB;IACI,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CACJ,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapacitorCalendarPlugin } from './definitions';\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>(\n 'CapacitorCalendar',\n {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n },\n);\n\nexport * from './definitions';\nexport { CapacitorCalendar };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAO5F,MAAM,iBAAiB,GAAG,cAAc,CACtC,mBAAmB,EACjB;IACI,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CACJ,CAAC;AAEF,cAAc,eAAe,CAAC;AAM9B,OAAO,EACH,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAEhB,2BAA2B,EAC3B,iBAAiB,GACpB,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nimport type { CapacitorCalendarPlugin } from './definitions';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\nimport type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';\nimport type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>(\n 'CapacitorCalendar',\n {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n },\n);\n\nexport * from './definitions';\nexport type {\n Calendar,\n RemindersList,\n ReminderRecurrenceRule\n}\nexport {\n CalendarChooserSelectionStyle,\n CalendarChooserDisplayStyle,\n PluginPermission,\n PluginPermissionsMap,\n ReminderRecurrenceFrequency,\n CapacitorCalendar,\n};\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Enum representing the display styles for the calendar chooser.
3
+ * @enum
4
+ * @platform iOS
5
+ */
6
+ export declare enum CalendarChooserDisplayStyle {
7
+ /**
8
+ * Display all calendars available for selection.
9
+ */
10
+ ALL_CALENDARS = 0,
11
+ /**
12
+ * Display only writable calendars available for selection.
13
+ */
14
+ WRITABLE_CALENDARS_ONLY = 1
15
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Enum representing the display styles for the calendar chooser.
3
+ * @enum
4
+ * @platform iOS
5
+ */
6
+ export var CalendarChooserDisplayStyle;
7
+ (function (CalendarChooserDisplayStyle) {
8
+ /**
9
+ * Display all calendars available for selection.
10
+ */
11
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
12
+ /**
13
+ * Display only writable calendars available for selection.
14
+ */
15
+ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
16
+ })(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));
17
+ //# sourceMappingURL=calendar-chooser-display-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-chooser-display-style.js","sourceRoot":"","sources":["../../../../src/schemas/enums/calendar-chooser-display-style.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,2BAUX;AAVD,WAAY,2BAA2B;IACnC;;OAEG;IACH,+FAAa,CAAA;IAEb;;OAEG;IACH,mHAAuB,CAAA;AAC3B,CAAC,EAVW,2BAA2B,KAA3B,2BAA2B,QAUtC","sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport enum CalendarChooserDisplayStyle {\n /**\n * Display all calendars available for selection.\n */\n ALL_CALENDARS,\n\n /**\n * Display only writable calendars available for selection.\n */\n WRITABLE_CALENDARS_ONLY\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Enum representing the selection style for the calendar chooser.
3
+ * @enum
4
+ * @platform iOS
5
+ */
6
+ export declare enum CalendarChooserSelectionStyle {
7
+ /**
8
+ * Allows only a single selection in the calendar chooser.
9
+ */
10
+ SINGLE = 0,
11
+ /**
12
+ * Allows multiple selections in the calendar chooser.
13
+ */
14
+ MULTIPLE = 1
15
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Enum representing the selection style for the calendar chooser.
3
+ * @enum
4
+ * @platform iOS
5
+ */
6
+ export var CalendarChooserSelectionStyle;
7
+ (function (CalendarChooserSelectionStyle) {
8
+ /**
9
+ * Allows only a single selection in the calendar chooser.
10
+ */
11
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["SINGLE"] = 0] = "SINGLE";
12
+ /**
13
+ * Allows multiple selections in the calendar chooser.
14
+ */
15
+ CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
16
+ })(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));
17
+ //# sourceMappingURL=calendar-chooser-selection-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar-chooser-selection-style.js","sourceRoot":"","sources":["../../../../src/schemas/enums/calendar-chooser-selection-style.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,6BAUX;AAVD,WAAY,6BAA6B;IACrC;;OAEG;IACH,qFAAM,CAAA;IAEN;;OAEG;IACH,yFAAQ,CAAA;AACZ,CAAC,EAVW,6BAA6B,KAA7B,6BAA6B,QAUxC","sourcesContent":["/**\n * Enum representing the selection style for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport enum CalendarChooserSelectionStyle {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n SINGLE,\n\n /**\n * Allows multiple selections in the calendar chooser.\n */\n MULTIPLE\n}\n"]}
@@ -0,0 +1,22 @@
1
+ export declare enum PluginPermission {
2
+ /**
3
+ * Represents the permission state for reading calendar.
4
+ * @platform iOS, Android
5
+ */
6
+ READ_CALENDAR = "readCalendar",
7
+ /**
8
+ * Represents the permission state for writing calendar.
9
+ * @platform iOS, Android
10
+ */
11
+ WRITE_CALENDAR = "writeCalendar",
12
+ /**
13
+ * Represents the permission state for reading reminders.
14
+ * @platform iOS
15
+ */
16
+ READ_REMINDERS = "readReminders",
17
+ /**
18
+ * Represents the permission state for writing reminders.
19
+ * @platform iOS
20
+ */
21
+ WRITE_REMINDERS = "writeReminders"
22
+ }
@@ -0,0 +1,24 @@
1
+ export var PluginPermission;
2
+ (function (PluginPermission) {
3
+ /**
4
+ * Represents the permission state for reading calendar.
5
+ * @platform iOS, Android
6
+ */
7
+ PluginPermission["READ_CALENDAR"] = "readCalendar";
8
+ /**
9
+ * Represents the permission state for writing calendar.
10
+ * @platform iOS, Android
11
+ */
12
+ PluginPermission["WRITE_CALENDAR"] = "writeCalendar";
13
+ /**
14
+ * Represents the permission state for reading reminders.
15
+ * @platform iOS
16
+ */
17
+ PluginPermission["READ_REMINDERS"] = "readReminders";
18
+ /**
19
+ * Represents the permission state for writing reminders.
20
+ * @platform iOS
21
+ */
22
+ PluginPermission["WRITE_REMINDERS"] = "writeReminders";
23
+ })(PluginPermission || (PluginPermission = {}));
24
+ //# sourceMappingURL=plugin-permission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-permission.js","sourceRoot":"","sources":["../../../../src/schemas/enums/plugin-permission.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAwBX;AAxBD,WAAY,gBAAgB;IACxB;;;OAGG;IACH,kDAA8B,CAAA;IAE9B;;;OAGG;IACH,oDAAgC,CAAA;IAEhC;;;OAGG;IACH,oDAAgC,CAAA;IAEhC;;;OAGG;IACH,sDAAkC,CAAA;AACtC,CAAC,EAxBW,gBAAgB,KAAhB,gBAAgB,QAwB3B","sourcesContent":["export enum PluginPermission {\n /**\n * Represents the permission state for reading calendar.\n * @platform iOS, Android\n */\n READ_CALENDAR = 'readCalendar',\n\n /**\n * Represents the permission state for writing calendar.\n * @platform iOS, Android\n */\n WRITE_CALENDAR = 'writeCalendar',\n\n /**\n * Represents the permission state for reading reminders.\n * @platform iOS\n */\n READ_REMINDERS = 'readReminders',\n\n /**\n * Represents the permission state for writing reminders.\n * @platform iOS\n */\n WRITE_REMINDERS = 'writeReminders',\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export declare enum ReminderRecurrenceFrequency {
2
+ DAILY = 0,
3
+ WEEKLY = 1,
4
+ MONTHLY = 2,
5
+ YEARLY = 3
6
+ }
@@ -0,0 +1,8 @@
1
+ export var ReminderRecurrenceFrequency;
2
+ (function (ReminderRecurrenceFrequency) {
3
+ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY";
4
+ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
5
+ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
6
+ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
7
+ })(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));
8
+ //# sourceMappingURL=reminder-recurrence-frequency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminder-recurrence-frequency.js","sourceRoot":"","sources":["../../../../src/schemas/enums/reminder-recurrence-frequency.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,2BAKX;AALD,WAAY,2BAA2B;IACnC,+EAAK,CAAA;IACL,iFAAM,CAAA;IACN,mFAAO,CAAA;IACP,iFAAM,CAAA;AACV,CAAC,EALW,2BAA2B,KAA3B,2BAA2B,QAKtC","sourcesContent":["export enum ReminderRecurrenceFrequency {\n DAILY,\n WEEKLY,\n MONTHLY,\n YEARLY,\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Represents a calendar object with an ID and title.
3
+ *
4
+ * @interface Calendar
5
+ * @platform iOS, Android
6
+ * @property {string} id - The unique identifier of the calendar.
7
+ * @property {string} title - The title or name of the calendar.
8
+ */
9
+ export interface Calendar {
10
+ id: string;
11
+ title: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/calendar.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a calendar object with an ID and title.\n *\n * @interface Calendar\n * @platform iOS, Android\n * @property {string} id - The unique identifier of the calendar.\n * @property {string} title - The title or name of the calendar.\n */\nexport interface Calendar {\n id: string;\n title: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { PermissionState } from '@capacitor/core';
2
+ export interface PluginPermissionsMap {
3
+ [permission: string]: PermissionState;
4
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=plugin-permissions-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-permissions-map.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/plugin-permissions-map.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\nexport interface PluginPermissionsMap {\n [permission: string]: PermissionState;\n}\n"]}
@@ -0,0 +1,36 @@
1
+ import { ReminderRecurrenceFrequency } from "../enums/reminder-recurrence-frequency";
2
+ export interface ReminderRecurrenceRule {
3
+ /**
4
+ * How frequent should the reminder repeat.
5
+ *
6
+ * @example
7
+ * // if frequency is set to weekly, the reminder will repeat on a weekly basis.
8
+ * const rules: ReminderRecurrenceRule = {
9
+ * frequency: ReminderRecurrenceFrequency.WEEKLY,
10
+ * interval: 1,
11
+ * }
12
+ */
13
+ frequency: ReminderRecurrenceFrequency;
14
+ /**
15
+ * The interval should be a number greater than 0. For values lower than 1 the method will throw an error.
16
+ *
17
+ * @example
18
+ * // if interval is set to 2 and frequency is set to daily, the reminder will repeat every 2 days.
19
+ * const rules: ReminderRecurrenceRule = {
20
+ * frequency: ReminderRecurrenceFrequency.DAILY,
21
+ * interval: 2,
22
+ * }
23
+ */
24
+ interval: number;
25
+ /**
26
+ * When provided, the reminder will stop repeating at the given time.
27
+ *
28
+ * @example
29
+ * const rules: ReminderRecurrenceRule = {
30
+ * frequency: ReminderRecurrenceFrequency.MONTHLY,
31
+ * interval: 10,
32
+ * end: Date.now()
33
+ * }
34
+ */
35
+ end?: number;
36
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reminder-recurrence-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminder-recurrence-rule.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/reminder-recurrence-rule.ts"],"names":[],"mappings":"","sourcesContent":["import {ReminderRecurrenceFrequency} from \"../enums/reminder-recurrence-frequency\";\n\nexport interface ReminderRecurrenceRule {\n /**\n * How frequent should the reminder repeat.\n *\n * @example\n * // if frequency is set to weekly, the reminder will repeat on a weekly basis.\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.WEEKLY,\n * interval: 1,\n * }\n */\n frequency: ReminderRecurrenceFrequency;\n\n /**\n * The interval should be a number greater than 0. For values lower than 1 the method will throw an error.\n *\n * @example\n * // if interval is set to 2 and frequency is set to daily, the reminder will repeat every 2 days.\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.DAILY,\n * interval: 2,\n * }\n */\n interval: number;\n\n /**\n * When provided, the reminder will stop repeating at the given time.\n *\n * @example\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n */\n end?: number;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { Calendar } from './calendar';
2
+ export interface RemindersList extends Calendar {
3
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reminders-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reminders-list.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/reminders-list.ts"],"names":[],"mappings":"","sourcesContent":["import {Calendar} from './calendar';\n\nexport interface RemindersList extends Calendar { }\n"]}