@ebarooni/capacitor-calendar 5.2.0 → 5.3.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.
- package/README.md +2 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +1 -1
- package/dist/docs.json +296 -0
- package/dist/esm/definitions.d.ts +58 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schemas/interfaces/reminder.d.ts +67 -0
- package/dist/esm/schemas/interfaces/reminder.js +2 -0
- package/dist/esm/schemas/interfaces/reminder.js.map +1 -0
- package/dist/esm/web.d.ts +14 -0
- package/dist/esm/web.js +6 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +6 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +6 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendarPlugin.m +2 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +35 -0
- package/ios/Plugin/CapacitorReminders.swift +122 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,6 +91,8 @@ permissions can be found below:
|
|
|
91
91
|
* [`deleteEventsById(...)`](#deleteeventsbyid)
|
|
92
92
|
* [`createCalendar(...)`](#createcalendar)
|
|
93
93
|
* [`deleteCalendar(...)`](#deletecalendar)
|
|
94
|
+
* [`getRemindersFromLists(...)`](#getremindersfromlists)
|
|
95
|
+
* [`deleteRemindersById(...)`](#deleteremindersbyid)
|
|
94
96
|
* [Interfaces](#interfaces)
|
|
95
97
|
* [Type Aliases](#type-aliases)
|
|
96
98
|
* [Enums](#enums)
|
|
@@ -53,7 +53,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
53
53
|
location?.let { intent.putExtra(CalendarContract.Events.EVENT_LOCATION, it) }
|
|
54
54
|
startDate?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, it) }
|
|
55
55
|
endDate?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, it) }
|
|
56
|
-
isAllDay?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY,
|
|
56
|
+
isAllDay?.let { intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, it) }
|
|
57
57
|
|
|
58
58
|
return startActivityForResult(
|
|
59
59
|
call,
|
package/dist/docs.json
CHANGED
|
@@ -682,6 +682,98 @@
|
|
|
682
682
|
"docs": "Deletes a calendar by id",
|
|
683
683
|
"complexTypes": [],
|
|
684
684
|
"slug": "deletecalendar"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"name": "getRemindersFromLists",
|
|
688
|
+
"signature": "(options?: { listIds: string[]; } | undefined) => Promise<{ result: Reminder[]; }>",
|
|
689
|
+
"parameters": [
|
|
690
|
+
{
|
|
691
|
+
"name": "options",
|
|
692
|
+
"docs": "Options for defining the date range.\nIt Will fetch all reminders from all available lists if not provided. (Optional)",
|
|
693
|
+
"type": "{ listIds: string[]; } | undefined"
|
|
694
|
+
}
|
|
695
|
+
],
|
|
696
|
+
"returns": "Promise<{ result: Reminder[]; }>",
|
|
697
|
+
"tags": [
|
|
698
|
+
{
|
|
699
|
+
"name": "method",
|
|
700
|
+
"text": "getRemindersFromLists"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"name": "since",
|
|
704
|
+
"text": "5.3.0"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"name": "platform",
|
|
708
|
+
"text": "iOS"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"name": "permissions",
|
|
712
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> readReminders</li>\n</ul>"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"name": "param",
|
|
716
|
+
"text": "options Options for defining the date range.\nIt Will fetch all reminders from all available lists if not provided. (Optional)"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"name": "returns",
|
|
720
|
+
"text": "A Promise that resolves with the list of reminders."
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
"name": "example",
|
|
724
|
+
"text": "const now = Date.now();\nconst { result } = await CapacitorCalendar.getRemindersFromLists({\n listIds: ['LIST_ID_1', 'LIST_ID_2'],\n});"
|
|
725
|
+
}
|
|
726
|
+
],
|
|
727
|
+
"docs": "Retrieves the list of reminders present in the given date range.",
|
|
728
|
+
"complexTypes": [
|
|
729
|
+
"Reminder"
|
|
730
|
+
],
|
|
731
|
+
"slug": "getremindersfromlists"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"name": "deleteRemindersById",
|
|
735
|
+
"signature": "(options: { ids: string[]; }) => Promise<{ result: { deleted: string[]; failed: string[]; }; }>",
|
|
736
|
+
"parameters": [
|
|
737
|
+
{
|
|
738
|
+
"name": "options",
|
|
739
|
+
"docs": "Options for defining reminder IDs.",
|
|
740
|
+
"type": "{ ids: string[]; }"
|
|
741
|
+
}
|
|
742
|
+
],
|
|
743
|
+
"returns": "Promise<{ result: { deleted: string[]; failed: string[]; }; }>",
|
|
744
|
+
"tags": [
|
|
745
|
+
{
|
|
746
|
+
"name": "method",
|
|
747
|
+
"text": "deleteRemindersById"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "since",
|
|
751
|
+
"text": "5.3.0"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "platform",
|
|
755
|
+
"text": "iOS"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "permissions",
|
|
759
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> writeReminders</li>\n</ul>"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "param",
|
|
763
|
+
"text": "options Options for defining reminder IDs."
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "returns",
|
|
767
|
+
"text": "A promise that resolves to an object with two properties:\n - deleted: string[] - An array of IDs that were successfully deleted.\n - failed: string[] - An array of IDs that could not be deleted."
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "example",
|
|
771
|
+
"text": "const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\nconst { result } = await CapacitorCalendar.deleteRemindersById(idsToDelete)\nconsole.log(result.deleted) // ['ID_1', 'ID_2']\nconsole.log(result.failed) // ['ID_DOES_NOT_EXIST']"
|
|
772
|
+
}
|
|
773
|
+
],
|
|
774
|
+
"docs": "Deletes reminders given their IDs.",
|
|
775
|
+
"complexTypes": [],
|
|
776
|
+
"slug": "deleteremindersbyid"
|
|
685
777
|
}
|
|
686
778
|
],
|
|
687
779
|
"properties": []
|
|
@@ -1011,6 +1103,210 @@
|
|
|
1011
1103
|
"type": "string"
|
|
1012
1104
|
}
|
|
1013
1105
|
]
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"name": "Reminder",
|
|
1109
|
+
"slug": "reminder",
|
|
1110
|
+
"docs": "Represents a reminder in a reminders list.",
|
|
1111
|
+
"tags": [
|
|
1112
|
+
{
|
|
1113
|
+
"text": "Reminder",
|
|
1114
|
+
"name": "interface"
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
"text": "{string} id The unique identifier of the reminder.",
|
|
1118
|
+
"name": "property"
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
"text": "{string} title The title or name of the reminder. (Optional)",
|
|
1122
|
+
"name": "property"
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
"text": "{string} listId The list that the reminder belongs to. (Optional)",
|
|
1126
|
+
"name": "property"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
"text": "{boolean} isCompleted Whether the reminder is completed already or not.",
|
|
1130
|
+
"name": "property"
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
"text": "{number} priority The priority of the reminder. (Optional)",
|
|
1134
|
+
"name": "property"
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
"text": "{string} notes The notes of the reminder. (Optional)",
|
|
1138
|
+
"name": "property"
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
"text": "{string} url The url of the reminder. (Optional)",
|
|
1142
|
+
"name": "property"
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
"text": "{number} startDate The start date of the reminder. (Optional)",
|
|
1146
|
+
"name": "property"
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
"text": "{number} dueDate The due date of the reminder. (Optional)",
|
|
1150
|
+
"name": "property"
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"text": "{number} completionDate The completion date of the reminder. (Optional)",
|
|
1154
|
+
"name": "property"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"text": "{ReminderRecurrenceRule[]} recurrence The recurrence rules of the reminder. (Optional)",
|
|
1158
|
+
"name": "property"
|
|
1159
|
+
}
|
|
1160
|
+
],
|
|
1161
|
+
"methods": [],
|
|
1162
|
+
"properties": [
|
|
1163
|
+
{
|
|
1164
|
+
"name": "id",
|
|
1165
|
+
"tags": [
|
|
1166
|
+
{
|
|
1167
|
+
"text": "iOS",
|
|
1168
|
+
"name": "platform"
|
|
1169
|
+
}
|
|
1170
|
+
],
|
|
1171
|
+
"docs": "",
|
|
1172
|
+
"complexTypes": [],
|
|
1173
|
+
"type": "string"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"name": "title",
|
|
1177
|
+
"tags": [
|
|
1178
|
+
{
|
|
1179
|
+
"text": "iOS",
|
|
1180
|
+
"name": "platform"
|
|
1181
|
+
}
|
|
1182
|
+
],
|
|
1183
|
+
"docs": "",
|
|
1184
|
+
"complexTypes": [],
|
|
1185
|
+
"type": "string | undefined"
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
"name": "listId",
|
|
1189
|
+
"tags": [
|
|
1190
|
+
{
|
|
1191
|
+
"text": "iOS",
|
|
1192
|
+
"name": "platform"
|
|
1193
|
+
}
|
|
1194
|
+
],
|
|
1195
|
+
"docs": "",
|
|
1196
|
+
"complexTypes": [],
|
|
1197
|
+
"type": "string | undefined"
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"name": "isCompleted",
|
|
1201
|
+
"tags": [
|
|
1202
|
+
{
|
|
1203
|
+
"text": "iOS",
|
|
1204
|
+
"name": "platform"
|
|
1205
|
+
}
|
|
1206
|
+
],
|
|
1207
|
+
"docs": "",
|
|
1208
|
+
"complexTypes": [],
|
|
1209
|
+
"type": "boolean | undefined"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
"name": "priority",
|
|
1213
|
+
"tags": [
|
|
1214
|
+
{
|
|
1215
|
+
"text": "iOS",
|
|
1216
|
+
"name": "platform"
|
|
1217
|
+
}
|
|
1218
|
+
],
|
|
1219
|
+
"docs": "",
|
|
1220
|
+
"complexTypes": [],
|
|
1221
|
+
"type": "number | undefined"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
"name": "notes",
|
|
1225
|
+
"tags": [
|
|
1226
|
+
{
|
|
1227
|
+
"text": "iOS",
|
|
1228
|
+
"name": "platform"
|
|
1229
|
+
}
|
|
1230
|
+
],
|
|
1231
|
+
"docs": "",
|
|
1232
|
+
"complexTypes": [],
|
|
1233
|
+
"type": "string | undefined"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"name": "location",
|
|
1237
|
+
"tags": [
|
|
1238
|
+
{
|
|
1239
|
+
"text": "iOS",
|
|
1240
|
+
"name": "platform"
|
|
1241
|
+
}
|
|
1242
|
+
],
|
|
1243
|
+
"docs": "",
|
|
1244
|
+
"complexTypes": [],
|
|
1245
|
+
"type": "string | undefined"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"name": "url",
|
|
1249
|
+
"tags": [
|
|
1250
|
+
{
|
|
1251
|
+
"text": "iOS",
|
|
1252
|
+
"name": "platform"
|
|
1253
|
+
}
|
|
1254
|
+
],
|
|
1255
|
+
"docs": "",
|
|
1256
|
+
"complexTypes": [],
|
|
1257
|
+
"type": "string | undefined"
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
"name": "startDate",
|
|
1261
|
+
"tags": [
|
|
1262
|
+
{
|
|
1263
|
+
"text": "iOS",
|
|
1264
|
+
"name": "platform"
|
|
1265
|
+
}
|
|
1266
|
+
],
|
|
1267
|
+
"docs": "",
|
|
1268
|
+
"complexTypes": [],
|
|
1269
|
+
"type": "number | undefined"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
"name": "dueDate",
|
|
1273
|
+
"tags": [
|
|
1274
|
+
{
|
|
1275
|
+
"text": "iOS",
|
|
1276
|
+
"name": "platform"
|
|
1277
|
+
}
|
|
1278
|
+
],
|
|
1279
|
+
"docs": "",
|
|
1280
|
+
"complexTypes": [],
|
|
1281
|
+
"type": "number | undefined"
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"name": "completionDate",
|
|
1285
|
+
"tags": [
|
|
1286
|
+
{
|
|
1287
|
+
"text": "iOS",
|
|
1288
|
+
"name": "platform"
|
|
1289
|
+
}
|
|
1290
|
+
],
|
|
1291
|
+
"docs": "",
|
|
1292
|
+
"complexTypes": [],
|
|
1293
|
+
"type": "number | undefined"
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
"name": "recurrence",
|
|
1297
|
+
"tags": [
|
|
1298
|
+
{
|
|
1299
|
+
"text": "iOS",
|
|
1300
|
+
"name": "platform"
|
|
1301
|
+
}
|
|
1302
|
+
],
|
|
1303
|
+
"docs": "",
|
|
1304
|
+
"complexTypes": [
|
|
1305
|
+
"ReminderRecurrenceRule"
|
|
1306
|
+
],
|
|
1307
|
+
"type": "ReminderRecurrenceRule[] | undefined"
|
|
1308
|
+
}
|
|
1309
|
+
]
|
|
1014
1310
|
}
|
|
1015
1311
|
],
|
|
1016
1312
|
"enums": [
|
|
@@ -7,6 +7,7 @@ import type { RemindersList } from './schemas/interfaces/reminders-list';
|
|
|
7
7
|
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
|
|
8
8
|
import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';
|
|
9
9
|
import type { CalendarEvent } from './schemas/interfaces/calendar-event';
|
|
10
|
+
import type { Reminder } from './schemas/interfaces/reminder';
|
|
10
11
|
export interface CapacitorCalendarPlugin {
|
|
11
12
|
/**
|
|
12
13
|
* Checks the current authorization status of a specific permission.
|
|
@@ -432,4 +433,61 @@ export interface CapacitorCalendarPlugin {
|
|
|
432
433
|
deleteCalendar(options: {
|
|
433
434
|
id: string;
|
|
434
435
|
}): Promise<void>;
|
|
436
|
+
/**
|
|
437
|
+
* Retrieves the list of reminders present in the given date range.
|
|
438
|
+
*
|
|
439
|
+
* @method getRemindersFromLists
|
|
440
|
+
* @since 5.3.0
|
|
441
|
+
* @platform iOS
|
|
442
|
+
* @permissions
|
|
443
|
+
* <h3>Runtime Permissions:</h3>
|
|
444
|
+
* <ul>
|
|
445
|
+
* <li><strong>iOS:</strong> readReminders</li>
|
|
446
|
+
* </ul>
|
|
447
|
+
* @param {object} options Options for defining the date range.
|
|
448
|
+
* It Will fetch all reminders from all available lists if not provided. (Optional)
|
|
449
|
+
* @param {string[]} options.listIds An array of reminder list ids.
|
|
450
|
+
* @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.
|
|
451
|
+
* @example
|
|
452
|
+
* const now = Date.now();
|
|
453
|
+
* const { result } = await CapacitorCalendar.getRemindersFromLists({
|
|
454
|
+
* listIds: ['LIST_ID_1', 'LIST_ID_2'],
|
|
455
|
+
* });
|
|
456
|
+
*/
|
|
457
|
+
getRemindersFromLists(options?: {
|
|
458
|
+
listIds: string[];
|
|
459
|
+
}): Promise<{
|
|
460
|
+
result: Reminder[];
|
|
461
|
+
}>;
|
|
462
|
+
/**
|
|
463
|
+
* Deletes reminders given their IDs.
|
|
464
|
+
*
|
|
465
|
+
* @method deleteRemindersById
|
|
466
|
+
* @since 5.3.0
|
|
467
|
+
* @platform iOS
|
|
468
|
+
* @permissions
|
|
469
|
+
* <h3>Runtime Permissions:</h3>
|
|
470
|
+
* <ul>
|
|
471
|
+
* <li><strong>iOS:</strong> writeReminders</li>
|
|
472
|
+
* </ul>
|
|
473
|
+
* @param {object} options Options for defining reminder IDs.
|
|
474
|
+
* @param {number} options.ids An array of reminder IDs to be deleted.
|
|
475
|
+
* @returns {Promise<{ deleted: string[], failed: string[] }>}
|
|
476
|
+
* A promise that resolves to an object with two properties:
|
|
477
|
+
* - deleted: string[] - An array of IDs that were successfully deleted.
|
|
478
|
+
* - failed: string[] - An array of IDs that could not be deleted.
|
|
479
|
+
* @example
|
|
480
|
+
* const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];
|
|
481
|
+
* const { result } = await CapacitorCalendar.deleteRemindersById(idsToDelete)
|
|
482
|
+
* console.log(result.deleted) // ['ID_1', 'ID_2']
|
|
483
|
+
* console.log(result.failed) // ['ID_DOES_NOT_EXIST']
|
|
484
|
+
*/
|
|
485
|
+
deleteRemindersById(options: {
|
|
486
|
+
ids: string[];
|
|
487
|
+
}): Promise<{
|
|
488
|
+
result: {
|
|
489
|
+
deleted: string[];
|
|
490
|
+
failed: string[];
|
|
491
|
+
};
|
|
492
|
+
}>;
|
|
435
493
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport type { PermissionState } from '@capacitor/core';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\nimport type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';\nimport type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\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<{ result: PermissionState }>} – 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<PluginPermissionsMap>} – 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<{ result: PermissionState }>} – 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<PluginPermissionsMap>} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<PluginPermissionsMap>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n *\n * @method createEventWithPrompt\n * @since 0.1.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - Ignored on Android. If a number >= 0 is provided,\n * an alert will be set for the event this many minutes *before* the event.\n * Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * }\n */\n createEventWithPrompt(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @since 0.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.\n * @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @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 * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false,\n * alertOffsetInMinutes: 5,\n * };\n * const { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string }>;\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 * @since 0.5.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { result } = await createReminder(reminderOptions);\n * console.log(result); // 'ID_1'\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }>;\n\n /**\n * Opens the calendar app. Since the user leaves your app, use this method with caution.\n * It will open the calendar on today's date if no date is provided.\n *\n * @method openCalendar\n * @platform iOS, Android\n * @param {object} options - Options for opening the calendar.\n * @param {number} options.date - The date at which the calendar should be opened. (Optional)\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openCalendar({ date: Date.now() });\n */\n openCalendar(options: { date?: number }): Promise<void>;\n\n /**\n * Opens the reminders app. Since the user leaves your app, use this method with caution.\n *\n * @method openReminders\n * @platform iOS\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openReminders();\n */\n openReminders(): Promise<void>;\n\n /**\n * Retrieves the list of calendar events present in the given date range.\n *\n * @method listEventsInRange\n * @since 0.10.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * @param {number} options.startDate The start of the date range.\n * @param {number} options.endDate The end of the date range.\n * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.\n * @example\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * startDate: Date.now(),\n * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n * })\n */\n listEventsInRange(options: { startDate: number; endDate: number }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @method deleteEventsById\n * @since 0.11.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options Options for defining event IDs.\n * @param {number} options.ids An array of event IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteEventsById(options: { ids: string[] }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Creates a calendar\n *\n * @method createCalendar\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating a calendar.\n * @param {string} options.title The title of the calendar to create.\n * @param {string} options.color The color of the calendar to create.\n * The color should be a HEX string. (Optional)\n * @returns {Promise<{ result: string }>} The id of the created calendar.\n * @example\n * { result } = await CapacitorCalendar.createCalendar({\n * title: 'New Calendar',\n * color: '#1d00fc',\n * });\n * console.log(result); // 'CALENDAR_ID'\n */\n createCalendar(options: { title: string; color?: string }): Promise<{ result: string }>;\n\n /**\n * Deletes a calendar by id\n *\n * @method deleteCalendar\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for deleting a calendar.\n * @param {string} options.id The id of the calendar to delete.\n * @example\n * await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });\n */\n deleteCalendar(options: { id: string }): Promise<void>;\n}\n"]}
|
|
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';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\nimport type { Reminder } from './schemas/interfaces/reminder';\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<{ result: PermissionState }>} – 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<PluginPermissionsMap>} – 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<{ result: PermissionState }>} – 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<PluginPermissionsMap>} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<PluginPermissionsMap>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n *\n * @method createEventWithPrompt\n * @since 0.1.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - Ignored on Android. If a number >= 0 is provided,\n * an alert will be set for the event this many minutes *before* the event.\n * Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: 5,\n * });\n * }\n */\n createEventWithPrompt(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @since 0.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.\n * @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @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 * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] - If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. Negative values are ignored. (Optional)\n * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false,\n * alertOffsetInMinutes: 5,\n * };\n * const { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string }>;\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 * @since 0.5.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { result } = await createReminder(reminderOptions);\n * console.log(result); // 'ID_1'\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }>;\n\n /**\n * Opens the calendar app. Since the user leaves your app, use this method with caution.\n * It will open the calendar on today's date if no date is provided.\n *\n * @method openCalendar\n * @platform iOS, Android\n * @param {object} options - Options for opening the calendar.\n * @param {number} options.date - The date at which the calendar should be opened. (Optional)\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openCalendar({ date: Date.now() });\n */\n openCalendar(options: { date?: number }): Promise<void>;\n\n /**\n * Opens the reminders app. Since the user leaves your app, use this method with caution.\n *\n * @method openReminders\n * @platform iOS\n * @returns {Promise<void>}\n * @example\n * void CapacitorCalendar.openReminders();\n */\n openReminders(): Promise<void>;\n\n /**\n * Retrieves the list of calendar events present in the given date range.\n *\n * @method listEventsInRange\n * @since 0.10.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * @param {number} options.startDate The start of the date range.\n * @param {number} options.endDate The end of the date range.\n * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.\n * @example\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * startDate: Date.now(),\n * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n * })\n */\n listEventsInRange(options: { startDate: number; endDate: number }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @method deleteEventsById\n * @since 0.11.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options Options for defining event IDs.\n * @param {number} options.ids An array of event IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteEventsById(options: { ids: string[] }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Creates a calendar\n *\n * @method createCalendar\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating a calendar.\n * @param {string} options.title The title of the calendar to create.\n * @param {string} options.color The color of the calendar to create.\n * The color should be a HEX string. (Optional)\n * @returns {Promise<{ result: string }>} The id of the created calendar.\n * @example\n * { result } = await CapacitorCalendar.createCalendar({\n * title: 'New Calendar',\n * color: '#1d00fc',\n * });\n * console.log(result); // 'CALENDAR_ID'\n */\n createCalendar(options: { title: string; color?: string }): Promise<{ result: string }>;\n\n /**\n * Deletes a calendar by id\n *\n * @method deleteCalendar\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for deleting a calendar.\n * @param {string} options.id The id of the calendar to delete.\n * @example\n * await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });\n */\n deleteCalendar(options: { id: string }): Promise<void>;\n\n /**\n * Retrieves the list of reminders present in the given date range.\n *\n * @method getRemindersFromLists\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readReminders</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * It Will fetch all reminders from all available lists if not provided. (Optional)\n * @param {string[]} options.listIds An array of reminder list ids.\n * @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.\n * @example\n * const now = Date.now();\n * const { result } = await CapacitorCalendar.getRemindersFromLists({\n * listIds: ['LIST_ID_1', 'LIST_ID_2'],\n * });\n */\n getRemindersFromLists(options?: { listIds: string[] }): Promise<{ result: Reminder[] }>;\n\n /**\n * Deletes reminders given their IDs.\n *\n * @method deleteRemindersById\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options Options for defining reminder IDs.\n * @param {number} options.ids An array of reminder IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteRemindersById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteRemindersById(options: { ids: string[] }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import type { RemindersList } from './schemas/interfaces/reminders-list';
|
|
|
8
8
|
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
|
|
9
9
|
import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';
|
|
10
10
|
import type { CalendarEvent } from './schemas/interfaces/calendar-event';
|
|
11
|
+
import type { Reminder } from './schemas/interfaces/reminder';
|
|
11
12
|
declare const CapacitorCalendar: CapacitorCalendarPlugin;
|
|
12
13
|
export * from './definitions';
|
|
13
14
|
export type { Calendar, RemindersList, ReminderRecurrenceRule };
|
|
14
|
-
export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CalendarEvent, CapacitorCalendar, };
|
|
15
|
+
export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CalendarEvent, Reminder, CapacitorCalendar, };
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAS5F,MAAM,iBAAiB,GAAG,cAAc,CAA0B,mBAAmB,EAAE;IACrF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAEhB,2BAA2B,EAG3B,iBAAiB,GAClB,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';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\nimport type { Reminder } from './schemas/interfaces/reminder';\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\n\nexport * from './definitions';\nexport type { Calendar, RemindersList, ReminderRecurrenceRule };\nexport {\n CalendarChooserSelectionStyle,\n CalendarChooserDisplayStyle,\n PluginPermission,\n PluginPermissionsMap,\n ReminderRecurrenceFrequency,\n CalendarEvent,\n Reminder,\n CapacitorCalendar,\n};\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ReminderRecurrenceRule } from './reminder-recurrence-rule';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a reminder in a reminders list.
|
|
4
|
+
*
|
|
5
|
+
* @interface Reminder
|
|
6
|
+
* @property {string} id The unique identifier of the reminder.
|
|
7
|
+
* @property {string} title The title or name of the reminder. (Optional)
|
|
8
|
+
* @property {string} listId The list that the reminder belongs to. (Optional)
|
|
9
|
+
* @property {boolean} isCompleted Whether the reminder is completed already or not.
|
|
10
|
+
* @property {number} priority The priority of the reminder. (Optional)
|
|
11
|
+
* @property {string} notes The notes of the reminder. (Optional)
|
|
12
|
+
* @property {string} url The url of the reminder. (Optional)
|
|
13
|
+
* @property {number} startDate The start date of the reminder. (Optional)
|
|
14
|
+
* @property {number} dueDate The due date of the reminder. (Optional)
|
|
15
|
+
* @property {number} completionDate The completion date of the reminder. (Optional)
|
|
16
|
+
* @property {ReminderRecurrenceRule[]} recurrence The recurrence rules of the reminder. (Optional)
|
|
17
|
+
*/
|
|
18
|
+
export interface Reminder {
|
|
19
|
+
/**
|
|
20
|
+
* @platform iOS
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
/**
|
|
24
|
+
* @platform iOS
|
|
25
|
+
*/
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @platform iOS
|
|
29
|
+
*/
|
|
30
|
+
listId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @platform iOS
|
|
33
|
+
*/
|
|
34
|
+
isCompleted?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @platform iOS
|
|
37
|
+
*/
|
|
38
|
+
priority?: number;
|
|
39
|
+
/**
|
|
40
|
+
* @platform iOS
|
|
41
|
+
*/
|
|
42
|
+
notes?: string;
|
|
43
|
+
/**
|
|
44
|
+
* @platform iOS
|
|
45
|
+
*/
|
|
46
|
+
location?: string;
|
|
47
|
+
/**
|
|
48
|
+
* @platform iOS
|
|
49
|
+
*/
|
|
50
|
+
url?: string;
|
|
51
|
+
/**
|
|
52
|
+
* @platform iOS
|
|
53
|
+
*/
|
|
54
|
+
startDate?: number;
|
|
55
|
+
/**
|
|
56
|
+
* @platform iOS
|
|
57
|
+
*/
|
|
58
|
+
dueDate?: number;
|
|
59
|
+
/**
|
|
60
|
+
* @platform iOS
|
|
61
|
+
*/
|
|
62
|
+
completionDate?: number;
|
|
63
|
+
/**
|
|
64
|
+
* @platform iOS
|
|
65
|
+
*/
|
|
66
|
+
recurrence?: ReminderRecurrenceRule[];
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminder.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/reminder.ts"],"names":[],"mappings":"","sourcesContent":["import { ReminderRecurrenceRule } from './reminder-recurrence-rule';\n\n/**\n * Represents a reminder in a reminders list.\n *\n * @interface Reminder\n * @property {string} id The unique identifier of the reminder.\n * @property {string} title The title or name of the reminder. (Optional)\n * @property {string} listId The list that the reminder belongs to. (Optional)\n * @property {boolean} isCompleted Whether the reminder is completed already or not.\n * @property {number} priority The priority of the reminder. (Optional)\n * @property {string} notes The notes of the reminder. (Optional)\n * @property {string} url The url of the reminder. (Optional)\n * @property {number} startDate The start date of the reminder. (Optional)\n * @property {number} dueDate The due date of the reminder. (Optional)\n * @property {number} completionDate The completion date of the reminder. (Optional)\n * @property {ReminderRecurrenceRule[]} recurrence The recurrence rules of the reminder. (Optional)\n */\nexport interface Reminder {\n /**\n * @platform iOS\n */\n id: string;\n\n /**\n * @platform iOS\n */\n title?: string;\n\n /**\n * @platform iOS\n */\n listId?: string;\n\n /**\n * @platform iOS\n */\n isCompleted?: boolean;\n\n /**\n * @platform iOS\n */\n priority?: number;\n\n /**\n * @platform iOS\n */\n notes?: string;\n\n /**\n * @platform iOS\n */\n location?: string;\n\n /**\n * @platform iOS\n */\n url?: string;\n\n /**\n * @platform iOS\n */\n startDate?: number;\n\n /**\n * @platform iOS\n */\n dueDate?: number;\n\n /**\n * @platform iOS\n */\n completionDate?: number;\n\n /**\n * @platform iOS\n */\n recurrence?: ReminderRecurrenceRule[];\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Calendar } from './schemas/interfaces/calendar';
|
|
|
6
6
|
import type { RemindersList } from './schemas/interfaces/reminders-list';
|
|
7
7
|
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
|
|
8
8
|
import type { CalendarEvent } from './schemas/interfaces/calendar-event';
|
|
9
|
+
import type { Reminder } from './schemas/interfaces/reminder';
|
|
9
10
|
export declare class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {
|
|
10
11
|
checkPermission(_options: {
|
|
11
12
|
alias: PluginPermission;
|
|
@@ -98,4 +99,17 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
98
99
|
deleteCalendar(_options: {
|
|
99
100
|
id: string;
|
|
100
101
|
}): Promise<void>;
|
|
102
|
+
getRemindersFromLists(_options?: {
|
|
103
|
+
listIds: string[];
|
|
104
|
+
}): Promise<{
|
|
105
|
+
result: Reminder[];
|
|
106
|
+
}>;
|
|
107
|
+
deleteRemindersById(_options: {
|
|
108
|
+
ids: string[];
|
|
109
|
+
}): Promise<{
|
|
110
|
+
result: {
|
|
111
|
+
deleted: string[];
|
|
112
|
+
failed: string[];
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
101
115
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -55,5 +55,11 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
55
55
|
deleteCalendar(_options) {
|
|
56
56
|
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);
|
|
57
57
|
}
|
|
58
|
+
getRemindersFromLists(_options) {
|
|
59
|
+
throw this.unimplemented(`${this.getRemindersFromLists.name} is not implemented on the web`);
|
|
60
|
+
}
|
|
61
|
+
deleteRemindersById(_options) {
|
|
62
|
+
throw this.unimplemented(`${this.deleteRemindersById.name} is not implemented on the web`);
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU7D,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,eAAe,CAAC,QAAqC;QAC1D,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CA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cesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { PermissionState, WebPlugin } from '@capacitor/core';\nimport { CapacitorCalendarPlugin } from './definitions';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\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 { CalendarEvent } from './schemas/interfaces/calendar-event';\nimport type { Reminder } from './schemas/interfaces/reminder';\n\nexport class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {\n public checkPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n\n public checkAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{ result: string[] }> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar }> {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n\n public createEvent(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number;\n }): Promise<{\n result: string;\n }> {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n\n public createReminder(_options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public getDefaultRemindersList(): Promise<{ result: RemindersList }> {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n\n public openCalendar(_options: { date?: number }): Promise<void> {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n\n public openReminders(): Promise<void> {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n\n public listEventsInRange(_options: { startDate: number; endDate: number }): Promise<{ result: CalendarEvent[] }> {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n\n public deleteEventsById(_options: { ids: string[] }): Promise<{\n result: { deleted: string[]; failed: string[] };\n }> {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n\n public createCalendar(_options: { title: string; color?: string }): Promise<{ result: string }> {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n\n public deleteCalendar(_options: { id: string }): Promise<void> {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n\n public getRemindersFromLists(_options?: { listIds: string[] }): Promise<{ result: Reminder[] }> {\n throw this.unimplemented(`${this.getRemindersFromLists.name} is not implemented on the web`);\n }\n\n public deleteRemindersById(_options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }> {\n throw this.unimplemented(`${this.deleteRemindersById.name} is not implemented on the web`);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -184,6 +184,12 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
184
184
|
deleteCalendar(_options) {
|
|
185
185
|
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);
|
|
186
186
|
}
|
|
187
|
+
getRemindersFromLists(_options) {
|
|
188
|
+
throw this.unimplemented(`${this.getRemindersFromLists.name} is not implemented on the web`);
|
|
189
|
+
}
|
|
190
|
+
deleteRemindersById(_options) {
|
|
191
|
+
throw this.unimplemented(`${this.deleteRemindersById.name} is not implemented on the web`);
|
|
192
|
+
}
|
|
187
193
|
}
|
|
188
194
|
|
|
189
195
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","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';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt(_options) {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n createCalendar(_options) {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n deleteCalendar(_options) {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACWA,6CAA4B;AACvC,CAAC,UAAU,2BAA2B,EAAE;AACxC;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;AACpG;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;AACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;AChBrE;AACA;AACA;AACA;AACA;AACA;AACWC,+CAA8B;AACzC,CAAC,UAAU,6BAA6B,EAAE;AAC1C;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1F;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC;;AChBzE;AACA;AACA;AACA;AACA;AACA;AACWC,kCAAiB;AAC5B,CAAC,UAAU,gBAAgB,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,cAAc,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA;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AAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","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';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt(_options) {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n createCalendar(_options) {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n deleteCalendar(_options) {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n getRemindersFromLists(_options) {\n throw this.unimplemented(`${this.getRemindersFromLists.name} is not implemented on the web`);\n }\n deleteRemindersById(_options) {\n throw this.unimplemented(`${this.deleteRemindersById.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACWA,6CAA4B;AACvC,CAAC,UAAU,2BAA2B,EAAE;AACxC;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;AACpG;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;AACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;AChBrE;AACA;AACA;AACA;AACA;AACA;AACWC,+CAA8B;AACzC,CAAC,UAAU,6BAA6B,EAAE;AAC1C;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1F;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC;;AChBzE;AACA;AACA;AACA;AACA;AACA;AACWC,kCAAiB;AAC5B,CAAC,UAAU,gBAAgB,EAAE;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,cAAc,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,eAAe,CAAC;AACzD;AACA;A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AAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,qBAAqB,CAAC,QAAQ,EAAE;AACpC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL,IAAI,mBAAmB,CAAC,QAAQ,EAAE;AAClC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACnG,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -183,6 +183,12 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
183
183
|
deleteCalendar(_options) {
|
|
184
184
|
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);
|
|
185
185
|
}
|
|
186
|
+
getRemindersFromLists(_options) {
|
|
187
|
+
throw this.unimplemented(`${this.getRemindersFromLists.name} is not implemented on the web`);
|
|
188
|
+
}
|
|
189
|
+
deleteRemindersById(_options) {
|
|
190
|
+
throw this.unimplemented(`${this.deleteRemindersById.name} is not implemented on the web`);
|
|
191
|
+
}
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","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';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt(_options) {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n createCalendar(_options) {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n deleteCalendar(_options) {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;IChBrE;IACA;IACA;IACA;IACA;IACA;AACWC,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,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G;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC7F,KAAK;IACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACjG,KAAK;IACL,IAAI,gBAAgB,CAAC,QAAQ,EAAE;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAChG,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n *\n * @enum CalendarChooserDisplayStyle\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n *\n * @enum CalendarChooserSelectionStyle\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","/**\n * Enum representing the available runtime permissions for the plugin.\n *\n * @enum PluginPermission\n * @platform iOS, Android\n */\nexport var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.READ_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n *\n * @platform iOS, Android\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSCalendarsWriteOnlyAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSCalendarsUsageDescription</li>\n * <li><strong>Android:</strong> android.permission.WRITE_CALENDAR</li>\n * </ul>\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>10 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n *\n * @platform iOS\n * @permissions\n * <h3>Manifest Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> NSRemindersFullAccessUsageDescription</li>\n * <li><strong>13 ≤ iOS ≤ 16:</strong> NSRemindersUsageDescription</li>\n * </ul>\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","/**\n * Enum representing the repeating frequency of the reminder.\n *\n * @enum ReminderRecurrenceFrequency\n * @platform iOS\n */\nexport var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n /**\n * The reminder repeats on a daily basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n /**\n * The reminder repeats on a weekly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n /**\n * The reminder repeats on a monthly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n /**\n * The reminder repeats on a yearly basis\n */\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","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';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt(_options) {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`);\n }\n deleteEventsById(_options) {\n throw this.unimplemented(`${this.deleteEventsById.name} is not implemented on the web`);\n }\n createCalendar(_options) {\n throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`);\n }\n deleteCalendar(_options) {\n throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`);\n }\n getRemindersFromLists(_options) {\n throw this.unimplemented(`${this.getRemindersFromLists.name} is not implemented on the web`);\n }\n deleteRemindersById(_options) {\n throw this.unimplemented(`${this.deleteRemindersById.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;IChBrE;IACA;IACA;IACA;IACA;IACA;AACWC,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC9F,CA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_PLUGIN_METHOD(createCalendar, CAPPluginReturnPromise);
|
|
24
24
|
CAP_PLUGIN_METHOD(deleteCalendar, CAPPluginReturnNone);
|
|
25
|
+
CAP_PLUGIN_METHOD(getRemindersFromLists, CAPPluginReturnPromise);
|
|
26
|
+
CAP_PLUGIN_METHOD(deleteRemindersById, CAPPluginReturnPromise);
|
|
25
27
|
)
|
|
@@ -385,4 +385,39 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
385
385
|
return
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
+
|
|
389
|
+
@objc public func getRemindersFromLists(_ call: CAPPluginCall) {
|
|
390
|
+
let ids = call.getArray("listIds")
|
|
391
|
+
|
|
392
|
+
Task {
|
|
393
|
+
do {
|
|
394
|
+
try call.resolve(["result": await reminders.getRemindersFromLists(listIds: ids)])
|
|
395
|
+
} catch {
|
|
396
|
+
call.reject("[CapacitorCalendar.\(#function)] Could not get the reminders from lists")
|
|
397
|
+
return
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
@objc public func deleteRemindersById(_ call: CAPPluginCall) {
|
|
403
|
+
guard let ids = call.getArray("ids") else {
|
|
404
|
+
call.reject("[CapacitorCalendar.\(#function)] Reminder ids were not provided")
|
|
405
|
+
return
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
Task {
|
|
409
|
+
do {
|
|
410
|
+
let deleteResult = try await reminders.deleteRemindersById(ids: ids)
|
|
411
|
+
call.resolve([
|
|
412
|
+
"result": [
|
|
413
|
+
"deleted": deleteResult.deleted,
|
|
414
|
+
"failed": deleteResult.failed
|
|
415
|
+
]
|
|
416
|
+
])
|
|
417
|
+
} catch {
|
|
418
|
+
call.reject("[CapacitorCalendar.\(#function)] Could not delete the reminders")
|
|
419
|
+
return
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
388
423
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import Foundation
|
|
10
10
|
import EventKit
|
|
11
11
|
import UIKit
|
|
12
|
+
import Capacitor
|
|
12
13
|
|
|
13
14
|
public class CapacitorReminders: NSObject {
|
|
14
15
|
private let eventStore: EKEventStore
|
|
@@ -172,6 +173,62 @@ public class CapacitorReminders: NSObject {
|
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
|
|
176
|
+
public func getRemindersFromLists(listIds: JSArray?) async throws -> [[String: Any]] {
|
|
177
|
+
return try await withCheckedThrowingContinuation { continuation in
|
|
178
|
+
var lists: [EKCalendar]?
|
|
179
|
+
if let ids = listIds {
|
|
180
|
+
lists = []
|
|
181
|
+
for id in ids {
|
|
182
|
+
if let list = eventStore.calendar(withIdentifier: "\(id)") {
|
|
183
|
+
lists?.append(list)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let predicate = eventStore.predicateForReminders(in: lists)
|
|
189
|
+
|
|
190
|
+
self.eventStore.fetchReminders(matching: predicate) {reminders in
|
|
191
|
+
if let result = reminders {
|
|
192
|
+
continuation.resume(returning: self.dictionaryRepresentationOfReminder(events: result))
|
|
193
|
+
} else {
|
|
194
|
+
continuation.resume(returning: [])
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
public func deleteRemindersById(ids: JSArray) async throws -> EventDeleteResults {
|
|
202
|
+
await withCheckedContinuation { continuation in
|
|
203
|
+
|
|
204
|
+
var deletedEvents: [String] = []
|
|
205
|
+
var failedToDeleteEvents: [String] = []
|
|
206
|
+
|
|
207
|
+
for id in ids {
|
|
208
|
+
guard let reminder = eventStore.calendarItem(withIdentifier: "\(id)") else {
|
|
209
|
+
failedToDeleteEvents.append("\(id)")
|
|
210
|
+
continue
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
do {
|
|
214
|
+
try eventStore.remove(reminder as! EKReminder, commit: false)
|
|
215
|
+
deletedEvents.append("\(id)")
|
|
216
|
+
} catch {
|
|
217
|
+
failedToDeleteEvents.append("\(id)")
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
do {
|
|
222
|
+
try eventStore.commit()
|
|
223
|
+
} catch {
|
|
224
|
+
failedToDeleteEvents.append(contentsOf: deletedEvents)
|
|
225
|
+
deletedEvents.removeAll()
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
continuation.resume(returning: EventDeleteResults(deleted: deletedEvents, failed: failedToDeleteEvents))
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
175
232
|
private func convertEKCalendarsToDictionaries(calendars: Set<EKCalendar>) -> [[String: String]] {
|
|
176
233
|
var result: [[String: String]] = []
|
|
177
234
|
|
|
@@ -233,4 +290,69 @@ public class CapacitorReminders: NSObject {
|
|
|
233
290
|
setDueDate()
|
|
234
291
|
setCompletionDate()
|
|
235
292
|
}
|
|
293
|
+
|
|
294
|
+
private func dictionaryRepresentationOfReminder(events: [EKReminder]) -> [[String: Any]] {
|
|
295
|
+
return events.map { event in
|
|
296
|
+
var dict = [String: Any]()
|
|
297
|
+
dict["id"] = event.calendarItemIdentifier
|
|
298
|
+
dict["listId"] = event.calendar.calendarIdentifier
|
|
299
|
+
dict["isCompleted"] = event.isCompleted
|
|
300
|
+
dict["priority"] = event.priority
|
|
301
|
+
|
|
302
|
+
if let title = event.title, !title.isEmpty {
|
|
303
|
+
dict["title"] = title
|
|
304
|
+
}
|
|
305
|
+
if let url = event.url {
|
|
306
|
+
dict["url"] = url
|
|
307
|
+
}
|
|
308
|
+
if let notes = event.notes {
|
|
309
|
+
dict["notes"] = notes
|
|
310
|
+
}
|
|
311
|
+
if let location = event.location {
|
|
312
|
+
dict["location"] = location
|
|
313
|
+
}
|
|
314
|
+
if let startDate = event.startDateComponents, let startMillis = convertDateComponentToMillis(dateComponent: startDate) {
|
|
315
|
+
dict["startDate"] = startMillis
|
|
316
|
+
}
|
|
317
|
+
if let dueDate = event.dueDateComponents, let dueMillis = convertDateComponentToMillis(dateComponent: dueDate) {
|
|
318
|
+
dict["dueDate"] = dueMillis
|
|
319
|
+
}
|
|
320
|
+
if let completionDate = event.completionDate {
|
|
321
|
+
dict["completionDate"] = completionDate.timeIntervalSince1970 * 1000
|
|
322
|
+
}
|
|
323
|
+
if let recurrenceRules = event.recurrenceRules {
|
|
324
|
+
let recurrence = extractReminderRecurrenceRules(rules: recurrenceRules)
|
|
325
|
+
|
|
326
|
+
if !recurrence.isEmpty {
|
|
327
|
+
dict["recurrence"] = recurrence
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return dict
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
private func convertDateComponentToMillis(dateComponent: DateComponents) -> Double? {
|
|
336
|
+
let calendar = Calendar.current
|
|
337
|
+
if let startDate = calendar.date(from: dateComponent) {
|
|
338
|
+
return startDate.timeIntervalSince1970 * 1000
|
|
339
|
+
} else {
|
|
340
|
+
return nil
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
private func extractReminderRecurrenceRules(rules: [EKRecurrenceRule]) -> [[String: Any]] {
|
|
345
|
+
return rules.map { rule in
|
|
346
|
+
var obj = [String: Any]()
|
|
347
|
+
|
|
348
|
+
obj["frequency"] = rule.frequency.rawValue
|
|
349
|
+
obj["interval"] = rule.interval
|
|
350
|
+
|
|
351
|
+
if let endDate = rule.recurrenceEnd?.endDate {
|
|
352
|
+
obj["end"] = endDate.timeIntervalSince1970 * 1000
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return obj
|
|
356
|
+
}
|
|
357
|
+
}
|
|
236
358
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebarooni/capacitor-calendar",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|