@ebarooni/capacitor-calendar 0.8.1 → 0.9.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 +40 -2
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +86 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +26 -8
- package/dist/docs.json +261 -0
- package/dist/esm/definitions.d.ts +22 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/schemas/interfaces/calendar-event.d.ts +72 -0
- package/dist/esm/schemas/interfaces/calendar-event.js +2 -0
- package/dist/esm/schemas/interfaces/calendar-event.js.map +1 -0
- package/dist/esm/web.d.ts +7 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendar.swift +44 -0
- package/ios/Plugin/CapacitorCalendarPlugin.m +1 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,8 +53,7 @@ The video is just for showing the functionality, otherwise the `createEventWithP
|
|
|
53
53
|
- ✅️ Create reminders (iOS)
|
|
54
54
|
- ✅ Open calendar app at a specific date
|
|
55
55
|
- ✅ Open reminders app (iOS)
|
|
56
|
-
-
|
|
57
|
-
- ⌛️ Find calendar events
|
|
56
|
+
- ✅️ Find calendar events
|
|
58
57
|
- ⌛️ Delete calendar events
|
|
59
58
|
|
|
60
59
|
## Permissions
|
|
@@ -83,6 +82,7 @@ permissions can be found below:
|
|
|
83
82
|
* [`createReminder(...)`](#createreminder)
|
|
84
83
|
* [`openCalendar(...)`](#opencalendar)
|
|
85
84
|
* [`openReminders()`](#openreminders)
|
|
85
|
+
* [`listEventsInRange(...)`](#listeventsinrange)
|
|
86
86
|
* [Interfaces](#interfaces)
|
|
87
87
|
* [Type Aliases](#type-aliases)
|
|
88
88
|
* [Enums](#enums)
|
|
@@ -299,6 +299,23 @@ Opens the reminders app. Since the user leaves your app, use this method with ca
|
|
|
299
299
|
--------------------
|
|
300
300
|
|
|
301
301
|
|
|
302
|
+
### listEventsInRange(...)
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
listEventsInRange(options: { startDate: number; endDate: number; }) => Promise<{ result: CalendarEvent[]; }>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Retrieves the list of calendar events present in the given date range.
|
|
309
|
+
|
|
310
|
+
| Param | Type | Description |
|
|
311
|
+
| ------------- | ---------------------------------------------------- | ------------------------------------ |
|
|
312
|
+
| **`options`** | <code>{ startDate: number; endDate: number; }</code> | Options for defining the date range. |
|
|
313
|
+
|
|
314
|
+
**Returns:** <code>Promise<{ result: CalendarEvent[]; }></code>
|
|
315
|
+
|
|
316
|
+
--------------------
|
|
317
|
+
|
|
318
|
+
|
|
302
319
|
### Interfaces
|
|
303
320
|
|
|
304
321
|
|
|
@@ -327,6 +344,27 @@ Represents a calendar object.
|
|
|
327
344
|
| **`end`** | <code>number</code> | When provided, the reminder will stop repeating at the given time. |
|
|
328
345
|
|
|
329
346
|
|
|
347
|
+
#### CalendarEvent
|
|
348
|
+
|
|
349
|
+
Represents an event in the calendar.
|
|
350
|
+
|
|
351
|
+
| Prop | Type |
|
|
352
|
+
| ---------------------- | -------------------- |
|
|
353
|
+
| **`id`** | <code>string</code> |
|
|
354
|
+
| **`title`** | <code>string</code> |
|
|
355
|
+
| **`location`** | <code>string</code> |
|
|
356
|
+
| **`eventColor`** | <code>string</code> |
|
|
357
|
+
| **`organizer`** | <code>string</code> |
|
|
358
|
+
| **`description`** | <code>string</code> |
|
|
359
|
+
| **`startDate`** | <code>number</code> |
|
|
360
|
+
| **`endDate`** | <code>number</code> |
|
|
361
|
+
| **`eventTimezone`** | <code>string</code> |
|
|
362
|
+
| **`eventEndTimezone`** | <code>string</code> |
|
|
363
|
+
| **`duration`** | <code>string</code> |
|
|
364
|
+
| **`isAllDay`** | <code>boolean</code> |
|
|
365
|
+
| **`calendarId`** | <code>string</code> |
|
|
366
|
+
|
|
367
|
+
|
|
330
368
|
### Type Aliases
|
|
331
369
|
|
|
332
370
|
|
|
@@ -87,7 +87,7 @@ class CapacitorCalendar() {
|
|
|
87
87
|
|
|
88
88
|
val calendarObject =
|
|
89
89
|
JSObject().apply {
|
|
90
|
-
put("id", id)
|
|
90
|
+
put("id", id.toString())
|
|
91
91
|
put("title", title)
|
|
92
92
|
}
|
|
93
93
|
return calendarObject
|
|
@@ -131,4 +131,89 @@ class CapacitorCalendar() {
|
|
|
131
131
|
data = Uri.parse("content://com.android.calendar/time/$timestamp")
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
@Throws(Exception::class)
|
|
136
|
+
fun listEventsInRange(
|
|
137
|
+
context: Context,
|
|
138
|
+
startDate: Long,
|
|
139
|
+
endDate: Long,
|
|
140
|
+
): JSArray {
|
|
141
|
+
val projection =
|
|
142
|
+
arrayOf(
|
|
143
|
+
CalendarContract.Events._ID,
|
|
144
|
+
CalendarContract.Events.TITLE,
|
|
145
|
+
CalendarContract.Events.EVENT_LOCATION,
|
|
146
|
+
CalendarContract.Events.EVENT_COLOR,
|
|
147
|
+
CalendarContract.Events.ORGANIZER,
|
|
148
|
+
CalendarContract.Events.DESCRIPTION,
|
|
149
|
+
CalendarContract.Events.DTSTART,
|
|
150
|
+
CalendarContract.Events.DTEND,
|
|
151
|
+
CalendarContract.Events.EVENT_TIMEZONE,
|
|
152
|
+
CalendarContract.Events.EVENT_END_TIMEZONE,
|
|
153
|
+
CalendarContract.Events.DURATION,
|
|
154
|
+
CalendarContract.Events.ALL_DAY,
|
|
155
|
+
CalendarContract.Events.CALENDAR_ID,
|
|
156
|
+
)
|
|
157
|
+
val selection = "(${CalendarContract.Events.DTSTART} >= ?) AND (${CalendarContract.Events.DTEND} <= ?)"
|
|
158
|
+
val selectionArgs = arrayOf(startDate.toString(), endDate.toString())
|
|
159
|
+
|
|
160
|
+
val events = JSArray()
|
|
161
|
+
|
|
162
|
+
context.contentResolver.query(
|
|
163
|
+
CalendarContract.Events.CONTENT_URI,
|
|
164
|
+
projection,
|
|
165
|
+
selection,
|
|
166
|
+
selectionArgs,
|
|
167
|
+
null,
|
|
168
|
+
)?.use { cursor ->
|
|
169
|
+
val idColumnIndex = cursor.getColumnIndex(CalendarContract.Events._ID)
|
|
170
|
+
val nameColumnIndex = cursor.getColumnIndex(CalendarContract.Events.TITLE)
|
|
171
|
+
val locationColumnIndex = cursor.getColumnIndex(CalendarContract.Events.EVENT_LOCATION)
|
|
172
|
+
val eventColorColumnIndex = cursor.getColumnIndex(CalendarContract.Events.EVENT_COLOR)
|
|
173
|
+
val organizerColumnIndex = cursor.getColumnIndex(CalendarContract.Events.ORGANIZER)
|
|
174
|
+
val descriptionColumnIndex = cursor.getColumnIndex(CalendarContract.Events.DESCRIPTION)
|
|
175
|
+
val dtStartColumnIndex = cursor.getColumnIndex(CalendarContract.Events.DTSTART)
|
|
176
|
+
val dtEndColumnIndex = cursor.getColumnIndex(CalendarContract.Events.DTEND)
|
|
177
|
+
val eventTimezoneColumnIndex = cursor.getColumnIndex(CalendarContract.Events.EVENT_TIMEZONE)
|
|
178
|
+
val eventEndTimezoneColumnIndex = cursor.getColumnIndex(CalendarContract.Events.EVENT_END_TIMEZONE)
|
|
179
|
+
val durationColumnIndex = cursor.getColumnIndex(CalendarContract.Events.DURATION)
|
|
180
|
+
val isAllDayColumnIndex = cursor.getColumnIndex(CalendarContract.Events.ALL_DAY)
|
|
181
|
+
val calendarIdColumnIndex = cursor.getColumnIndex(CalendarContract.Events.CALENDAR_ID)
|
|
182
|
+
|
|
183
|
+
while (cursor.moveToNext()) {
|
|
184
|
+
val id = cursor.getLong(idColumnIndex)
|
|
185
|
+
val title = cursor.getString(nameColumnIndex)
|
|
186
|
+
val location = cursor.getString(locationColumnIndex)
|
|
187
|
+
val eventColor = cursor.getInt(eventColorColumnIndex)
|
|
188
|
+
val organizer = cursor.getString(organizerColumnIndex)
|
|
189
|
+
val desc = cursor.getString(descriptionColumnIndex)
|
|
190
|
+
val dtStart = cursor.getLong(dtStartColumnIndex)
|
|
191
|
+
val dtEnd = cursor.getLong(dtEndColumnIndex)
|
|
192
|
+
val eventTimezone = cursor.getString(eventTimezoneColumnIndex)
|
|
193
|
+
val eventEndTimezone = cursor.getString(eventEndTimezoneColumnIndex)
|
|
194
|
+
val duration = cursor.getString(durationColumnIndex)
|
|
195
|
+
val allDay = cursor.getInt(isAllDayColumnIndex) == 1
|
|
196
|
+
val calendarId = cursor.getLong(calendarIdColumnIndex)
|
|
197
|
+
|
|
198
|
+
val event =
|
|
199
|
+
JSObject().apply {
|
|
200
|
+
put("id", id.toString())
|
|
201
|
+
title?.takeIf { it.isNotEmpty() }?.let { put("title", it) }
|
|
202
|
+
location?.takeIf { it.isNotEmpty() }?.let { put("location", it) }
|
|
203
|
+
eventColor.takeIf { it != 0 }?.let { put("eventColor", String.format("#%06X", 0xFFFFFF and it)) }
|
|
204
|
+
organizer?.takeIf { it.isNotEmpty() }?.let { put("organizer", it) }
|
|
205
|
+
desc?.takeIf { it.isNotEmpty() }?.let { put("description", it) }
|
|
206
|
+
dtStart.takeIf { it != 0.toLong() }?.let { put("startDate", it) }
|
|
207
|
+
dtEnd.takeIf { it != 0.toLong() }?.let { put("endDate", it) }
|
|
208
|
+
eventTimezone?.takeIf { it.isNotEmpty() }?.let { put("eventTimezone", it) }
|
|
209
|
+
eventEndTimezone?.takeIf { it.isNotEmpty() }?.let { put("eventEndTimezone", it) }
|
|
210
|
+
duration?.takeIf { it.isNotEmpty() }?.let { put("duration", it) }
|
|
211
|
+
put("isAllDay", allDay)
|
|
212
|
+
calendarId.takeIf { it != 0.toLong() }?.let { put("calendarId", it.toString()) }
|
|
213
|
+
}
|
|
214
|
+
events.put(event)
|
|
215
|
+
}
|
|
216
|
+
} ?: throw Exception("Cursor is null")
|
|
217
|
+
return events
|
|
218
|
+
}
|
|
134
219
|
}
|
|
@@ -33,7 +33,7 @@ import com.getcapacitor.annotation.PermissionCallback
|
|
|
33
33
|
class CapacitorCalendarPlugin : Plugin() {
|
|
34
34
|
private var implementation = CapacitorCalendar()
|
|
35
35
|
|
|
36
|
-
@PluginMethod
|
|
36
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
37
37
|
fun createEventWithPrompt(call: PluginCall) {
|
|
38
38
|
try {
|
|
39
39
|
implementation.eventsCount = implementation.getTotalEventsCount(context)
|
|
@@ -71,7 +71,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
71
71
|
call.resolve(ret)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
@PluginMethod
|
|
74
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
75
75
|
fun checkPermission(call: PluginCall) {
|
|
76
76
|
try {
|
|
77
77
|
val permissionName =
|
|
@@ -91,7 +91,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
@PluginMethod
|
|
94
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
95
95
|
fun checkAllPermissions(call: PluginCall) {
|
|
96
96
|
try {
|
|
97
97
|
return checkPermissions(call)
|
|
@@ -101,7 +101,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
@PluginMethod
|
|
104
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
105
105
|
fun requestPermission(call: PluginCall) {
|
|
106
106
|
try {
|
|
107
107
|
val alias =
|
|
@@ -130,7 +130,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
@PluginMethod
|
|
133
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
134
134
|
fun requestAllPermissions(call: PluginCall) {
|
|
135
135
|
try {
|
|
136
136
|
return requestPermissions(call)
|
|
@@ -146,7 +146,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
146
146
|
return
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
@PluginMethod
|
|
149
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
150
150
|
fun listCalendars(call: PluginCall) {
|
|
151
151
|
try {
|
|
152
152
|
val calendars = implementation.listCalendars(context)
|
|
@@ -158,7 +158,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
@PluginMethod
|
|
161
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
162
162
|
fun getDefaultCalendar(call: PluginCall) {
|
|
163
163
|
try {
|
|
164
164
|
val primaryCalendar = implementation.getDefaultCalendar(context)
|
|
@@ -170,7 +170,7 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
@PluginMethod
|
|
173
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
174
174
|
fun createEvent(call: PluginCall) {
|
|
175
175
|
try {
|
|
176
176
|
val title =
|
|
@@ -220,4 +220,22 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
220
220
|
return
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
+
|
|
224
|
+
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
225
|
+
fun listEventsInRange(call: PluginCall) {
|
|
226
|
+
try {
|
|
227
|
+
val startDate =
|
|
228
|
+
call.getLong("startDate")
|
|
229
|
+
?: throw Exception("[CapacitorCalendar.${::createEvent.name}] A start date was not provided")
|
|
230
|
+
val endDate =
|
|
231
|
+
call.getLong("endDate")
|
|
232
|
+
?: throw Exception("[CapacitorCalendar.${::createEvent.name}] An end date was not provided")
|
|
233
|
+
val ret = JSObject()
|
|
234
|
+
ret.put("result", implementation.listEventsInRange(context, startDate, endDate))
|
|
235
|
+
call.resolve(ret)
|
|
236
|
+
} catch (error: Exception) {
|
|
237
|
+
call.reject("", "[CapacitorCalendar.${::createEvent.name}] Could not get the list of events in requested range")
|
|
238
|
+
return
|
|
239
|
+
}
|
|
240
|
+
}
|
|
223
241
|
}
|
package/dist/docs.json
CHANGED
|
@@ -468,6 +468,45 @@
|
|
|
468
468
|
"docs": "Opens the reminders app. Since the user leaves your app, use this method with caution.",
|
|
469
469
|
"complexTypes": [],
|
|
470
470
|
"slug": "openreminders"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "listEventsInRange",
|
|
474
|
+
"signature": "(options: { startDate: number; endDate: number; }) => Promise<{ result: CalendarEvent[]; }>",
|
|
475
|
+
"parameters": [
|
|
476
|
+
{
|
|
477
|
+
"name": "options",
|
|
478
|
+
"docs": "Options for defining the date range.",
|
|
479
|
+
"type": "{ startDate: number; endDate: number; }"
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
"returns": "Promise<{ result: CalendarEvent[]; }>",
|
|
483
|
+
"tags": [
|
|
484
|
+
{
|
|
485
|
+
"name": "method",
|
|
486
|
+
"text": "listEventsInRange"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"name": "platform",
|
|
490
|
+
"text": "iOS, Android"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "param",
|
|
494
|
+
"text": "options Options for defining the date range."
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"name": "returns",
|
|
498
|
+
"text": "A Promise that resolves with the list of events."
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "example",
|
|
502
|
+
"text": "const { result } = await CapacitorCalendar.listEventsInRange({\n startDate: Date.now(),\n endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n})"
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
"docs": "Retrieves the list of calendar events present in the given date range.",
|
|
506
|
+
"complexTypes": [
|
|
507
|
+
"CalendarEvent"
|
|
508
|
+
],
|
|
509
|
+
"slug": "listeventsinrange"
|
|
471
510
|
}
|
|
472
511
|
],
|
|
473
512
|
"properties": []
|
|
@@ -575,6 +614,228 @@
|
|
|
575
614
|
"type": "number | undefined"
|
|
576
615
|
}
|
|
577
616
|
]
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"name": "CalendarEvent",
|
|
620
|
+
"slug": "calendarevent",
|
|
621
|
+
"docs": "Represents an event in the calendar.",
|
|
622
|
+
"tags": [
|
|
623
|
+
{
|
|
624
|
+
"text": "CalendarEvent",
|
|
625
|
+
"name": "interface"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"text": "{string} id The unique identifier of the event.",
|
|
629
|
+
"name": "property"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"text": "{string} title The title or name of the event. (Optional)",
|
|
633
|
+
"name": "property"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"text": "{string} location The location of the event. (Optional)",
|
|
637
|
+
"name": "property"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"text": "{string} eventColor The color of the individual event. (Optional)",
|
|
641
|
+
"name": "property"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"text": "{string} organizer The organizer of the event. (Optional)",
|
|
645
|
+
"name": "property"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"text": "{string} description The description of the event. (Optional)",
|
|
649
|
+
"name": "property"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"text": "{number} startDate The start date of the event. (Optional)",
|
|
653
|
+
"name": "property"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"text": "{number} endDate The end date of the event. (Optional)",
|
|
657
|
+
"name": "property"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"text": "{string} eventTimezone The timezone of the start date. (optional)",
|
|
661
|
+
"name": "property"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"text": "{string} eventEndTimezone The timezone of the end date. (optional)",
|
|
665
|
+
"name": "property"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"text": "{string} duration The duration of the event. (Optional)",
|
|
669
|
+
"name": "property"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"text": "{boolean} isAllDay Indicates if the event is all day. (Optional)",
|
|
673
|
+
"name": "property"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"text": "{string} calendarId The calendar that the event belongs to. (Optional)",
|
|
677
|
+
"name": "property"
|
|
678
|
+
}
|
|
679
|
+
],
|
|
680
|
+
"methods": [],
|
|
681
|
+
"properties": [
|
|
682
|
+
{
|
|
683
|
+
"name": "id",
|
|
684
|
+
"tags": [
|
|
685
|
+
{
|
|
686
|
+
"text": "iOS, Android",
|
|
687
|
+
"name": "platform"
|
|
688
|
+
}
|
|
689
|
+
],
|
|
690
|
+
"docs": "",
|
|
691
|
+
"complexTypes": [],
|
|
692
|
+
"type": "string"
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"name": "title",
|
|
696
|
+
"tags": [
|
|
697
|
+
{
|
|
698
|
+
"text": "iOS, Android",
|
|
699
|
+
"name": "platform"
|
|
700
|
+
}
|
|
701
|
+
],
|
|
702
|
+
"docs": "",
|
|
703
|
+
"complexTypes": [],
|
|
704
|
+
"type": "string | undefined"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"name": "location",
|
|
708
|
+
"tags": [
|
|
709
|
+
{
|
|
710
|
+
"text": "iOS, Android",
|
|
711
|
+
"name": "platform"
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"docs": "",
|
|
715
|
+
"complexTypes": [],
|
|
716
|
+
"type": "string | undefined"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"name": "eventColor",
|
|
720
|
+
"tags": [
|
|
721
|
+
{
|
|
722
|
+
"text": "Android",
|
|
723
|
+
"name": "platform"
|
|
724
|
+
}
|
|
725
|
+
],
|
|
726
|
+
"docs": "",
|
|
727
|
+
"complexTypes": [],
|
|
728
|
+
"type": "string | undefined"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"name": "organizer",
|
|
732
|
+
"tags": [
|
|
733
|
+
{
|
|
734
|
+
"text": "iOS, Android",
|
|
735
|
+
"name": "platform"
|
|
736
|
+
}
|
|
737
|
+
],
|
|
738
|
+
"docs": "",
|
|
739
|
+
"complexTypes": [],
|
|
740
|
+
"type": "string | undefined"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"name": "description",
|
|
744
|
+
"tags": [
|
|
745
|
+
{
|
|
746
|
+
"text": "iOS, Android",
|
|
747
|
+
"name": "platform"
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
"docs": "",
|
|
751
|
+
"complexTypes": [],
|
|
752
|
+
"type": "string | undefined"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "startDate",
|
|
756
|
+
"tags": [
|
|
757
|
+
{
|
|
758
|
+
"text": "iOS, Android",
|
|
759
|
+
"name": "platform"
|
|
760
|
+
}
|
|
761
|
+
],
|
|
762
|
+
"docs": "",
|
|
763
|
+
"complexTypes": [],
|
|
764
|
+
"type": "number | undefined"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"name": "endDate",
|
|
768
|
+
"tags": [
|
|
769
|
+
{
|
|
770
|
+
"text": "iOS, Android",
|
|
771
|
+
"name": "platform"
|
|
772
|
+
}
|
|
773
|
+
],
|
|
774
|
+
"docs": "",
|
|
775
|
+
"complexTypes": [],
|
|
776
|
+
"type": "number | undefined"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"name": "eventTimezone",
|
|
780
|
+
"tags": [
|
|
781
|
+
{
|
|
782
|
+
"text": "iOS, Android",
|
|
783
|
+
"name": "platform"
|
|
784
|
+
}
|
|
785
|
+
],
|
|
786
|
+
"docs": "",
|
|
787
|
+
"complexTypes": [],
|
|
788
|
+
"type": "string | undefined"
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"name": "eventEndTimezone",
|
|
792
|
+
"tags": [
|
|
793
|
+
{
|
|
794
|
+
"text": "iOS, Android",
|
|
795
|
+
"name": "platform"
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
"docs": "",
|
|
799
|
+
"complexTypes": [],
|
|
800
|
+
"type": "string | undefined"
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
"name": "duration",
|
|
804
|
+
"tags": [
|
|
805
|
+
{
|
|
806
|
+
"text": "Android",
|
|
807
|
+
"name": "platform"
|
|
808
|
+
}
|
|
809
|
+
],
|
|
810
|
+
"docs": "",
|
|
811
|
+
"complexTypes": [],
|
|
812
|
+
"type": "string | undefined"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"name": "isAllDay",
|
|
816
|
+
"tags": [
|
|
817
|
+
{
|
|
818
|
+
"text": "iOS, Android",
|
|
819
|
+
"name": "platform"
|
|
820
|
+
}
|
|
821
|
+
],
|
|
822
|
+
"docs": "",
|
|
823
|
+
"complexTypes": [],
|
|
824
|
+
"type": "boolean | undefined"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"name": "calendarId",
|
|
828
|
+
"tags": [
|
|
829
|
+
{
|
|
830
|
+
"text": "iOS, Android",
|
|
831
|
+
"name": "platform"
|
|
832
|
+
}
|
|
833
|
+
],
|
|
834
|
+
"docs": "",
|
|
835
|
+
"complexTypes": [],
|
|
836
|
+
"type": "string"
|
|
837
|
+
}
|
|
838
|
+
]
|
|
578
839
|
}
|
|
579
840
|
],
|
|
580
841
|
"enums": [
|
|
@@ -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 { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';
|
|
9
|
+
import type { CalendarEvent } from './schemas/interfaces/calendar-event';
|
|
9
10
|
export interface CapacitorCalendarPlugin {
|
|
10
11
|
/**
|
|
11
12
|
* Checks the current authorization status of a specific permission.
|
|
@@ -280,4 +281,25 @@ export interface CapacitorCalendarPlugin {
|
|
|
280
281
|
* void CapacitorCalendar.openReminders();
|
|
281
282
|
*/
|
|
282
283
|
openReminders(): Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* Retrieves the list of calendar events present in the given date range.
|
|
286
|
+
*
|
|
287
|
+
* @method listEventsInRange
|
|
288
|
+
* @platform iOS, Android
|
|
289
|
+
* @param {object} options Options for defining the date range.
|
|
290
|
+
* @param {number} options.startDate The start of the date range.
|
|
291
|
+
* @param {number} options.endDate The end of the date range.
|
|
292
|
+
* @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.
|
|
293
|
+
* @example
|
|
294
|
+
* const { result } = await CapacitorCalendar.listEventsInRange({
|
|
295
|
+
* startDate: Date.now(),
|
|
296
|
+
* endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now
|
|
297
|
+
* })
|
|
298
|
+
*/
|
|
299
|
+
listEventsInRange(options: {
|
|
300
|
+
startDate: number;
|
|
301
|
+
endDate: number;
|
|
302
|
+
}): Promise<{
|
|
303
|
+
result: CalendarEvent[];
|
|
304
|
+
}>;
|
|
283
305
|
}
|
|
@@ -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';\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 * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise<{ eventCreated: boolean }>} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @platform iOS\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @platform iOS, Android\n * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.\n * Each calendar object in the array contains an ID and a title.\n * @example\n * const { result } = await listCalendars();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]\n */\n listCalendars(): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves the default calendar set on the device.\n *\n * @method getDefaultCalendar\n * @platform iOS, Android\n * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @platform iOS, Android\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {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 * @returns {Promise<{ eventCreated: boolean }>} A Promise that resolves with an object indicating whether the event was created successfully.\n * The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false\n * };\n * const { eventCreated } = await createEvent(eventOptions);\n * console.log(eventCreated); // true\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n }): Promise<{ eventCreated: boolean }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @method getDefaultRemindersList\n * @platform iOS\n * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.\n * The returned reminders list object contains an ID and a title.\n * @example\n * const { result } = await getDefaultRemindersList();\n * console.log(result); // { id: '1', title: 'Default Reminders List' }\n */\n getDefaultRemindersList(): Promise<{ result: RemindersList }>;\n\n /**\n * Retrieves all available reminders lists on the device.\n *\n * @async\n * @method getRemindersLists\n * @platform iOS\n * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.\n * Each reminders list object in the array contains an ID and a title.\n * @example\n * const { result } = await getRemindersLists();\n * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]\n */\n getRemindersLists(): Promise<{ result: RemindersList[] }>;\n\n /**\n * Creates a reminder with the provided options.\n *\n * @method createReminder\n * @platform iOS\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ reminderCreated: boolean }>} A Promise that resolves with an object indicating whether the reminder was created successfully.\n * The resolved object has a property 'reminderCreated' which is a boolean value representing whether the reminder was created.\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { reminderCreated } = await createReminder(reminderOptions);\n * console.log(reminderCreated); // true\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ reminderCreated: boolean }>;\n\n /**\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"]}
|
|
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 * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @platform iOS, Android\n * @returns {Promise<{ eventCreated: boolean }>} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @platform iOS\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @platform iOS, Android\n * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.\n * Each calendar object in the array contains an ID and a title.\n * @example\n * const { result } = await listCalendars();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]\n */\n listCalendars(): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves the default calendar set on the device.\n *\n * @method getDefaultCalendar\n * @platform iOS, Android\n * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @platform iOS, Android\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {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 * @returns {Promise<{ eventCreated: boolean }>} A Promise that resolves with an object indicating whether the event was created successfully.\n * The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false\n * };\n * const { eventCreated } = await createEvent(eventOptions);\n * console.log(eventCreated); // true\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n }): Promise<{ eventCreated: boolean }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @method getDefaultRemindersList\n * @platform iOS\n * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.\n * The returned reminders list object contains an ID and a title.\n * @example\n * const { result } = await getDefaultRemindersList();\n * console.log(result); // { id: '1', title: 'Default Reminders List' }\n */\n getDefaultRemindersList(): Promise<{ result: RemindersList }>;\n\n /**\n * Retrieves all available reminders lists on the device.\n *\n * @async\n * @method getRemindersLists\n * @platform iOS\n * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.\n * Each reminders list object in the array contains an ID and a title.\n * @example\n * const { result } = await getRemindersLists();\n * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]\n */\n getRemindersLists(): Promise<{ result: RemindersList[] }>;\n\n /**\n * Creates a reminder with the provided options.\n *\n * @method createReminder\n * @platform iOS\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ reminderCreated: boolean }>} A Promise that resolves with an object indicating whether the reminder was created successfully.\n * The resolved object has a property 'reminderCreated' which is a boolean value representing whether the reminder was created.\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { reminderCreated } = await createReminder(reminderOptions);\n * console.log(reminderCreated); // true\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ reminderCreated: boolean }>;\n\n /**\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 * @platform iOS, Android\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"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an event in the calendar.
|
|
3
|
+
*
|
|
4
|
+
* @interface CalendarEvent
|
|
5
|
+
* @property {string} id The unique identifier of the event.
|
|
6
|
+
* @property {string} title The title or name of the event. (Optional)
|
|
7
|
+
* @property {string} location The location of the event. (Optional)
|
|
8
|
+
* @property {string} eventColor The color of the individual event. (Optional)
|
|
9
|
+
* @property {string} organizer The organizer of the event. (Optional)
|
|
10
|
+
* @property {string} description The description of the event. (Optional)
|
|
11
|
+
* @property {number} startDate The start date of the event. (Optional)
|
|
12
|
+
* @property {number} endDate The end date of the event. (Optional)
|
|
13
|
+
* @property {string} eventTimezone The timezone of the start date. (optional)
|
|
14
|
+
* @property {string} eventEndTimezone The timezone of the end date. (optional)
|
|
15
|
+
* @property {string} duration The duration of the event. (Optional)
|
|
16
|
+
* @property {boolean} isAllDay Indicates if the event is all day. (Optional)
|
|
17
|
+
* @property {string} calendarId The calendar that the event belongs to. (Optional)
|
|
18
|
+
*/
|
|
19
|
+
export interface CalendarEvent {
|
|
20
|
+
/**
|
|
21
|
+
* @platform iOS, Android
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* @platform iOS, Android
|
|
26
|
+
*/
|
|
27
|
+
title?: string;
|
|
28
|
+
/**
|
|
29
|
+
* @platform iOS, Android
|
|
30
|
+
*/
|
|
31
|
+
location?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @platform Android
|
|
34
|
+
*/
|
|
35
|
+
eventColor?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @platform iOS, Android
|
|
38
|
+
*/
|
|
39
|
+
organizer?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @platform iOS, Android
|
|
42
|
+
*/
|
|
43
|
+
description?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @platform iOS, Android
|
|
46
|
+
*/
|
|
47
|
+
startDate?: number;
|
|
48
|
+
/**
|
|
49
|
+
* @platform iOS, Android
|
|
50
|
+
*/
|
|
51
|
+
endDate?: number;
|
|
52
|
+
/**
|
|
53
|
+
* @platform iOS, Android
|
|
54
|
+
*/
|
|
55
|
+
eventTimezone?: string;
|
|
56
|
+
/**
|
|
57
|
+
* @platform iOS, Android
|
|
58
|
+
*/
|
|
59
|
+
eventEndTimezone?: string;
|
|
60
|
+
/**
|
|
61
|
+
* @platform Android
|
|
62
|
+
*/
|
|
63
|
+
duration?: string;
|
|
64
|
+
/**
|
|
65
|
+
* @platform iOS, Android
|
|
66
|
+
*/
|
|
67
|
+
isAllDay?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @platform iOS, Android
|
|
70
|
+
*/
|
|
71
|
+
calendarId: string;
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/calendar-event.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents an event in the calendar.\n *\n * @interface CalendarEvent\n * @property {string} id The unique identifier of the event.\n * @property {string} title The title or name of the event. (Optional)\n * @property {string} location The location of the event. (Optional)\n * @property {string} eventColor The color of the individual event. (Optional)\n * @property {string} organizer The organizer of the event. (Optional)\n * @property {string} description The description of the event. (Optional)\n * @property {number} startDate The start date of the event. (Optional)\n * @property {number} endDate The end date of the event. (Optional)\n * @property {string} eventTimezone The timezone of the start date. (optional)\n * @property {string} eventEndTimezone The timezone of the end date. (optional)\n * @property {string} duration The duration of the event. (Optional)\n * @property {boolean} isAllDay Indicates if the event is all day. (Optional)\n * @property {string} calendarId The calendar that the event belongs to. (Optional)\n */\nexport interface CalendarEvent {\n /**\n * @platform iOS, Android\n */\n id: string;\n\n /**\n * @platform iOS, Android\n */\n title?: string;\n\n /**\n * @platform iOS, Android\n */\n location?: string;\n\n /**\n * @platform Android\n */\n eventColor?: string;\n\n /**\n * @platform iOS, Android\n */\n organizer?: string;\n\n /**\n * @platform iOS, Android\n */\n description?: string;\n\n /**\n * @platform iOS, Android\n */\n startDate?: number;\n\n /**\n * @platform iOS, Android\n */\n endDate?: number;\n\n /**\n * @platform iOS, Android\n */\n eventTimezone?: string;\n\n /**\n * @platform iOS, Android\n */\n eventEndTimezone?: string;\n\n /**\n * @platform Android\n */\n duration?: string;\n\n /**\n * @platform iOS, Android\n */\n isAllDay?: boolean;\n\n /**\n * @platform iOS, Android\n */\n calendarId: string;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence
|
|
|
5
5
|
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
|
+
import type { CalendarEvent } from './schemas/interfaces/calendar-event';
|
|
8
9
|
export declare class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {
|
|
9
10
|
checkPermission(_options: {
|
|
10
11
|
alias: PluginPermission;
|
|
@@ -65,4 +66,10 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
65
66
|
date?: number;
|
|
66
67
|
}): Promise<void>;
|
|
67
68
|
openReminders(): Promise<void>;
|
|
69
|
+
listEventsInRange(_options: {
|
|
70
|
+
startDate: number;
|
|
71
|
+
endDate: number;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
result: CalendarEvent[];
|
|
74
|
+
}>;
|
|
68
75
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -43,5 +43,8 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
43
43
|
openReminders() {
|
|
44
44
|
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
45
45
|
}
|
|
46
|
+
listEventsInRange(_options) {
|
|
47
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
48
|
+
}
|
|
46
49
|
}
|
|
47
50
|
//# 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":"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,IAAI,gCAAgC,CAAC,CAAC;IACrF,CAAC;IAEM,cAAc,CAAC,QAYrB;QACC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;IAEM,uBAAuB;QAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;IAEM,iBAAiB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;IAEM,YAAY,CAAC,QAA2B;QAC7C,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;IAEM,aAAa;QAClB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;IAEM,iBAAiB,CAAC,QAAgD;QACvE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACxF,CAAC;CACF","sourcesContent":["/* 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';\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(): Promise<{ eventCreated: boolean }> {\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.createEventWithPrompt.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 }): Promise<{\n eventCreated: boolean;\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<{ reminderCreated: boolean }> {\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.createReminder.name} is not implemented on the web`);\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public openCalendar(_options: { date?: number }): Promise<void> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public openReminders(): Promise<void> {\n throw this.unimplemented(`${this.createReminder.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.createReminder.name} is not implemented on the web`);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -172,6 +172,9 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
172
172
|
openReminders() {
|
|
173
173
|
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
174
174
|
}
|
|
175
|
+
listEventsInRange(_options) {
|
|
176
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
177
|
+
}
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.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.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.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;AAC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AACL,IAAI,uBAAuB,GAAG;AAC9B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,iBAAiB,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,YAAY,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.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.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.createReminder.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;AACA;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AQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,uBAAuB,GAAG;AAC9B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,iBAAiB,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,YAAY,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -171,6 +171,9 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
171
171
|
openReminders() {
|
|
172
172
|
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
173
173
|
}
|
|
174
|
+
listEventsInRange(_options) {
|
|
175
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
176
|
+
}
|
|
174
177
|
}
|
|
175
178
|
|
|
176
179
|
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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.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.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.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,IA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AAM,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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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>iOS 10 ≤ x ≤ 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() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.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.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openCalendar(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n openReminders() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n listEventsInRange(_options) {\n throw this.unimplemented(`${this.createReminder.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;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AAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,aAAa,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
@@ -239,6 +239,18 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
public func listEventsInRange(
|
|
243
|
+
startDate: Double,
|
|
244
|
+
endDate: Double
|
|
245
|
+
) throws -> [[String: Any]] {
|
|
246
|
+
let predicate = eventStore.predicateForEvents(
|
|
247
|
+
withStart: Date(timeIntervalSince1970: startDate / 1000),
|
|
248
|
+
end: Date(timeIntervalSince1970: endDate / 1000), calendars: nil
|
|
249
|
+
)
|
|
250
|
+
let events = self.eventStore.events(matching: predicate)
|
|
251
|
+
return dictionaryRepresentationOfEvents(events: events)
|
|
252
|
+
}
|
|
253
|
+
|
|
242
254
|
public func eventEditViewController(
|
|
243
255
|
_ controller: EKEventEditViewController,
|
|
244
256
|
didCompleteWith action: EKEventEditViewAction
|
|
@@ -280,4 +292,36 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
280
292
|
|
|
281
293
|
return result
|
|
282
294
|
}
|
|
295
|
+
|
|
296
|
+
private func dictionaryRepresentationOfEvents(events: [EKEvent]) -> [[String: Any]] {
|
|
297
|
+
return events.map { event in
|
|
298
|
+
var dict = [String: Any]()
|
|
299
|
+
dict["id"] = event.eventIdentifier
|
|
300
|
+
if let title = event.title, !title.isEmpty {
|
|
301
|
+
dict["title"] = title
|
|
302
|
+
}
|
|
303
|
+
if let location = event.location, !location.isEmpty {
|
|
304
|
+
dict["location"] = location
|
|
305
|
+
}
|
|
306
|
+
if let organizer = event.organizer?.name, !organizer.isEmpty {
|
|
307
|
+
dict["organizer"] = organizer
|
|
308
|
+
}
|
|
309
|
+
if let notes = event.notes, !notes.isEmpty {
|
|
310
|
+
dict["description"] = notes
|
|
311
|
+
}
|
|
312
|
+
if let startDate = event.startDate {
|
|
313
|
+
dict["startDate"] = startDate.timeIntervalSince1970
|
|
314
|
+
}
|
|
315
|
+
if let endDate = event.endDate {
|
|
316
|
+
dict["endDate"] = endDate.timeIntervalSince1970
|
|
317
|
+
}
|
|
318
|
+
if let timezone = event.timeZone, (timezone.abbreviation()?.isEmpty) == nil {
|
|
319
|
+
dict["eventTimezone"] = timezone.abbreviation()
|
|
320
|
+
dict["eventEndTimezone"] = timezone.abbreviation()
|
|
321
|
+
}
|
|
322
|
+
dict["isAllDay"] = event.isAllDay
|
|
323
|
+
dict["calendarId"] = event.calendar.calendarIdentifier
|
|
324
|
+
return dict
|
|
325
|
+
}
|
|
326
|
+
}
|
|
283
327
|
}
|
|
@@ -18,4 +18,5 @@ CAP_PLUGIN(CapacitorCalendarPlugin, "CapacitorCalendar",
|
|
|
18
18
|
CAP_PLUGIN_METHOD(createReminder, CAPPluginReturnPromise);
|
|
19
19
|
CAP_PLUGIN_METHOD(openCalendar, CAPPluginReturnNone);
|
|
20
20
|
CAP_PLUGIN_METHOD(openReminders, CAPPluginReturnNone);
|
|
21
|
+
CAP_PLUGIN_METHOD(listEventsInRange, CAPPluginReturnPromise);
|
|
21
22
|
)
|
|
@@ -294,4 +294,22 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
+
|
|
298
|
+
@objc public func listEventsInRange(_ call: CAPPluginCall) {
|
|
299
|
+
guard let startDate = call.getDouble("startDate") else {
|
|
300
|
+
call.reject("[CapacitorCalendar.\(#function)] A start date was not provided")
|
|
301
|
+
return
|
|
302
|
+
}
|
|
303
|
+
guard let endDate = call.getDouble("endDate") else {
|
|
304
|
+
call.reject("[CapacitorCalendar.\(#function)] An end date was not provided")
|
|
305
|
+
return
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
do {
|
|
309
|
+
try call.resolve(["result": calendar.listEventsInRange(startDate: startDate, endDate: endDate)])
|
|
310
|
+
} catch {
|
|
311
|
+
call.reject("[CapacitorCalendar.\(#function)] Could not get the list of events in requested range")
|
|
312
|
+
return
|
|
313
|
+
}
|
|
314
|
+
}
|
|
297
315
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebarooni/capacitor-calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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",
|