@ebarooni/capacitor-calendar 0.8.1 → 0.10.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 +56 -8
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +104 -10
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +39 -21
- package/dist/docs.json +282 -9
- package/dist/esm/definitions.d.ts +43 -17
- 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 +9 -2
- 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 +56 -6
- package/ios/Plugin/CapacitorCalendarPlugin.m +1 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +21 -3
- package/ios/Plugin/CapacitorCalendarPluginError.swift +2 -0
- package/package.json +1 -1
package/dist/docs.json
CHANGED
|
@@ -141,9 +141,9 @@
|
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
"name": "createEventWithPrompt",
|
|
144
|
-
"signature": "() => Promise<{
|
|
144
|
+
"signature": "() => Promise<{ result: string[]; }>",
|
|
145
145
|
"parameters": [],
|
|
146
|
-
"returns": "Promise<{
|
|
146
|
+
"returns": "Promise<{ result: string[]; }>",
|
|
147
147
|
"tags": [
|
|
148
148
|
{
|
|
149
149
|
"name": "method"
|
|
@@ -152,16 +152,24 @@
|
|
|
152
152
|
"name": "platform",
|
|
153
153
|
"text": "iOS, Android"
|
|
154
154
|
},
|
|
155
|
+
{
|
|
156
|
+
"name": "permissions",
|
|
157
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>Android:</strong> readCalendar</li>\n</ul>"
|
|
158
|
+
},
|
|
155
159
|
{
|
|
156
160
|
"name": "returns",
|
|
157
|
-
"text": "
|
|
161
|
+
"text": "A promise that resolves with an array of the ids of created events."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "throws",
|
|
165
|
+
"text": "Error If prompt gets cancelled."
|
|
158
166
|
},
|
|
159
167
|
{
|
|
160
168
|
"name": "example",
|
|
161
|
-
"text": "
|
|
169
|
+
"text": "if (capacitor.getPlatform() === 'android') {\n await this.requestPermission({ alias: 'readCalendar' });\n { result } = result = await this.createEventWithPrompt();\n} else {\n { result } = await this.createEventWithPrompt();\n}"
|
|
162
170
|
}
|
|
163
171
|
],
|
|
164
|
-
"docs": "Creates an event in the calendar by using the native calendar.\nOn iOS opens a native sheet and on Android opens an intent
|
|
172
|
+
"docs": "Creates an event in the calendar by using the native calendar.\nOn iOS opens a native sheet and on Android opens an intent.",
|
|
165
173
|
"complexTypes": [],
|
|
166
174
|
"slug": "createeventwithprompt"
|
|
167
175
|
},
|
|
@@ -272,7 +280,7 @@
|
|
|
272
280
|
},
|
|
273
281
|
{
|
|
274
282
|
"name": "createEvent",
|
|
275
|
-
"signature": "(options: { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; }) => Promise<{
|
|
283
|
+
"signature": "(options: { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; }) => Promise<{ result: string[]; }>",
|
|
276
284
|
"parameters": [
|
|
277
285
|
{
|
|
278
286
|
"name": "options",
|
|
@@ -280,7 +288,7 @@
|
|
|
280
288
|
"type": "{ title: string; calendarId?: string | undefined; location?: string | undefined; startDate?: number | undefined; endDate?: number | undefined; isAllDay?: boolean | undefined; }"
|
|
281
289
|
}
|
|
282
290
|
],
|
|
283
|
-
"returns": "Promise<{
|
|
291
|
+
"returns": "Promise<{ result: string[]; }>",
|
|
284
292
|
"tags": [
|
|
285
293
|
{
|
|
286
294
|
"name": "method",
|
|
@@ -290,17 +298,21 @@
|
|
|
290
298
|
"name": "platform",
|
|
291
299
|
"text": "iOS, Android"
|
|
292
300
|
},
|
|
301
|
+
{
|
|
302
|
+
"name": "permissions",
|
|
303
|
+
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS 17 ≤:</strong> writeCalendar</li>\n <li><strong>iOS 10 ≤ x ≤ iOS 16:</strong> writeCalendar</li>\n <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n</ul>"
|
|
304
|
+
},
|
|
293
305
|
{
|
|
294
306
|
"name": "param",
|
|
295
307
|
"text": "options - Options for creating the event."
|
|
296
308
|
},
|
|
297
309
|
{
|
|
298
310
|
"name": "returns",
|
|
299
|
-
"text": "A
|
|
311
|
+
"text": "A promise that resolves with an array of the ids of created events."
|
|
300
312
|
},
|
|
301
313
|
{
|
|
302
314
|
"name": "example",
|
|
303
|
-
"text": "const now = Date.now();\nconst eventOptions = {\n title: 'Team Meeting',\n location: 'Conference Room A',\n startDate: now,\n endDate: now + 2 * 60 * 60 * 1000,\n isAllDay: false\n};\nconst {
|
|
315
|
+
"text": "const now = Date.now();\nconst eventOptions = {\n title: 'Team Meeting',\n location: 'Conference Room A',\n startDate: now,\n endDate: now + 2 * 60 * 60 * 1000,\n isAllDay: false\n};\nconst { result } = await createEvent(eventOptions);"
|
|
304
316
|
}
|
|
305
317
|
],
|
|
306
318
|
"docs": "Creates an event with the provided options.",
|
|
@@ -468,6 +480,45 @@
|
|
|
468
480
|
"docs": "Opens the reminders app. Since the user leaves your app, use this method with caution.",
|
|
469
481
|
"complexTypes": [],
|
|
470
482
|
"slug": "openreminders"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "listEventsInRange",
|
|
486
|
+
"signature": "(options: { startDate: number; endDate: number; }) => Promise<{ result: CalendarEvent[]; }>",
|
|
487
|
+
"parameters": [
|
|
488
|
+
{
|
|
489
|
+
"name": "options",
|
|
490
|
+
"docs": "Options for defining the date range.",
|
|
491
|
+
"type": "{ startDate: number; endDate: number; }"
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
"returns": "Promise<{ result: CalendarEvent[]; }>",
|
|
495
|
+
"tags": [
|
|
496
|
+
{
|
|
497
|
+
"name": "method",
|
|
498
|
+
"text": "listEventsInRange"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "platform",
|
|
502
|
+
"text": "iOS, Android"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "param",
|
|
506
|
+
"text": "options Options for defining the date range."
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "returns",
|
|
510
|
+
"text": "A Promise that resolves with the list of events."
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "example",
|
|
514
|
+
"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})"
|
|
515
|
+
}
|
|
516
|
+
],
|
|
517
|
+
"docs": "Retrieves the list of calendar events present in the given date range.",
|
|
518
|
+
"complexTypes": [
|
|
519
|
+
"CalendarEvent"
|
|
520
|
+
],
|
|
521
|
+
"slug": "listeventsinrange"
|
|
471
522
|
}
|
|
472
523
|
],
|
|
473
524
|
"properties": []
|
|
@@ -575,6 +626,228 @@
|
|
|
575
626
|
"type": "number | undefined"
|
|
576
627
|
}
|
|
577
628
|
]
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"name": "CalendarEvent",
|
|
632
|
+
"slug": "calendarevent",
|
|
633
|
+
"docs": "Represents an event in the calendar.",
|
|
634
|
+
"tags": [
|
|
635
|
+
{
|
|
636
|
+
"text": "CalendarEvent",
|
|
637
|
+
"name": "interface"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"text": "{string} id The unique identifier of the event.",
|
|
641
|
+
"name": "property"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"text": "{string} title The title or name of the event. (Optional)",
|
|
645
|
+
"name": "property"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"text": "{string} location The location of the event. (Optional)",
|
|
649
|
+
"name": "property"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"text": "{string} eventColor The color of the individual event. (Optional)",
|
|
653
|
+
"name": "property"
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"text": "{string} organizer The organizer of the event. (Optional)",
|
|
657
|
+
"name": "property"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"text": "{string} description The description of the event. (Optional)",
|
|
661
|
+
"name": "property"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"text": "{number} startDate The start date of the event. (Optional)",
|
|
665
|
+
"name": "property"
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"text": "{number} endDate The end date of the event. (Optional)",
|
|
669
|
+
"name": "property"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"text": "{string} eventTimezone The timezone of the start date. (optional)",
|
|
673
|
+
"name": "property"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"text": "{string} eventEndTimezone The timezone of the end date. (optional)",
|
|
677
|
+
"name": "property"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"text": "{string} duration The duration of the event. (Optional)",
|
|
681
|
+
"name": "property"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"text": "{boolean} isAllDay Indicates if the event is all day. (Optional)",
|
|
685
|
+
"name": "property"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"text": "{string} calendarId The calendar that the event belongs to. (Optional)",
|
|
689
|
+
"name": "property"
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
"methods": [],
|
|
693
|
+
"properties": [
|
|
694
|
+
{
|
|
695
|
+
"name": "id",
|
|
696
|
+
"tags": [
|
|
697
|
+
{
|
|
698
|
+
"text": "iOS, Android",
|
|
699
|
+
"name": "platform"
|
|
700
|
+
}
|
|
701
|
+
],
|
|
702
|
+
"docs": "",
|
|
703
|
+
"complexTypes": [],
|
|
704
|
+
"type": "string"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"name": "title",
|
|
708
|
+
"tags": [
|
|
709
|
+
{
|
|
710
|
+
"text": "iOS, Android",
|
|
711
|
+
"name": "platform"
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"docs": "",
|
|
715
|
+
"complexTypes": [],
|
|
716
|
+
"type": "string | undefined"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"name": "location",
|
|
720
|
+
"tags": [
|
|
721
|
+
{
|
|
722
|
+
"text": "iOS, Android",
|
|
723
|
+
"name": "platform"
|
|
724
|
+
}
|
|
725
|
+
],
|
|
726
|
+
"docs": "",
|
|
727
|
+
"complexTypes": [],
|
|
728
|
+
"type": "string | undefined"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"name": "eventColor",
|
|
732
|
+
"tags": [
|
|
733
|
+
{
|
|
734
|
+
"text": "Android",
|
|
735
|
+
"name": "platform"
|
|
736
|
+
}
|
|
737
|
+
],
|
|
738
|
+
"docs": "",
|
|
739
|
+
"complexTypes": [],
|
|
740
|
+
"type": "string | undefined"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"name": "organizer",
|
|
744
|
+
"tags": [
|
|
745
|
+
{
|
|
746
|
+
"text": "iOS, Android",
|
|
747
|
+
"name": "platform"
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
"docs": "",
|
|
751
|
+
"complexTypes": [],
|
|
752
|
+
"type": "string | undefined"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"name": "description",
|
|
756
|
+
"tags": [
|
|
757
|
+
{
|
|
758
|
+
"text": "iOS, Android",
|
|
759
|
+
"name": "platform"
|
|
760
|
+
}
|
|
761
|
+
],
|
|
762
|
+
"docs": "",
|
|
763
|
+
"complexTypes": [],
|
|
764
|
+
"type": "string | undefined"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"name": "startDate",
|
|
768
|
+
"tags": [
|
|
769
|
+
{
|
|
770
|
+
"text": "iOS, Android",
|
|
771
|
+
"name": "platform"
|
|
772
|
+
}
|
|
773
|
+
],
|
|
774
|
+
"docs": "",
|
|
775
|
+
"complexTypes": [],
|
|
776
|
+
"type": "number | undefined"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"name": "endDate",
|
|
780
|
+
"tags": [
|
|
781
|
+
{
|
|
782
|
+
"text": "iOS, Android",
|
|
783
|
+
"name": "platform"
|
|
784
|
+
}
|
|
785
|
+
],
|
|
786
|
+
"docs": "",
|
|
787
|
+
"complexTypes": [],
|
|
788
|
+
"type": "number | undefined"
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"name": "eventTimezone",
|
|
792
|
+
"tags": [
|
|
793
|
+
{
|
|
794
|
+
"text": "iOS, Android",
|
|
795
|
+
"name": "platform"
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
"docs": "",
|
|
799
|
+
"complexTypes": [],
|
|
800
|
+
"type": "string | undefined"
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
"name": "eventEndTimezone",
|
|
804
|
+
"tags": [
|
|
805
|
+
{
|
|
806
|
+
"text": "iOS, Android",
|
|
807
|
+
"name": "platform"
|
|
808
|
+
}
|
|
809
|
+
],
|
|
810
|
+
"docs": "",
|
|
811
|
+
"complexTypes": [],
|
|
812
|
+
"type": "string | undefined"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"name": "duration",
|
|
816
|
+
"tags": [
|
|
817
|
+
{
|
|
818
|
+
"text": "Android",
|
|
819
|
+
"name": "platform"
|
|
820
|
+
}
|
|
821
|
+
],
|
|
822
|
+
"docs": "",
|
|
823
|
+
"complexTypes": [],
|
|
824
|
+
"type": "string | undefined"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"name": "isAllDay",
|
|
828
|
+
"tags": [
|
|
829
|
+
{
|
|
830
|
+
"text": "iOS, Android",
|
|
831
|
+
"name": "platform"
|
|
832
|
+
}
|
|
833
|
+
],
|
|
834
|
+
"docs": "",
|
|
835
|
+
"complexTypes": [],
|
|
836
|
+
"type": "boolean | undefined"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"name": "calendarId",
|
|
840
|
+
"tags": [
|
|
841
|
+
{
|
|
842
|
+
"text": "iOS, Android",
|
|
843
|
+
"name": "platform"
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"docs": "",
|
|
847
|
+
"complexTypes": [],
|
|
848
|
+
"type": "string"
|
|
849
|
+
}
|
|
850
|
+
]
|
|
578
851
|
}
|
|
579
852
|
],
|
|
580
853
|
"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.
|
|
@@ -61,27 +62,26 @@ export interface CapacitorCalendarPlugin {
|
|
|
61
62
|
/**
|
|
62
63
|
* Creates an event in the calendar by using the native calendar.
|
|
63
64
|
* On iOS opens a native sheet and on Android opens an intent.
|
|
64
|
-
* 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.
|
|
65
|
-
* On Android, the user has to authorize for read access.
|
|
66
65
|
*
|
|
67
66
|
* @method
|
|
68
67
|
* @platform iOS, Android
|
|
69
|
-
* @
|
|
68
|
+
* @permissions
|
|
69
|
+
* <h3>Runtime Permissions:</h3>
|
|
70
|
+
* <ul>
|
|
71
|
+
* <li><strong>Android:</strong> readCalendar</li>
|
|
72
|
+
* </ul>
|
|
73
|
+
* @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.
|
|
74
|
+
* @throws Error If prompt gets cancelled.
|
|
70
75
|
* @example
|
|
71
|
-
* let result: CalendarEventActionResult;
|
|
72
76
|
* if (capacitor.getPlatform() === 'android') {
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* result = await this.createEventWithPrompt();
|
|
76
|
-
* } else {
|
|
77
|
-
* // handle the case when user rejects the permission
|
|
78
|
-
* }
|
|
77
|
+
* await this.requestPermission({ alias: 'readCalendar' });
|
|
78
|
+
* { result } = result = await this.createEventWithPrompt();
|
|
79
79
|
* } else {
|
|
80
|
-
* result = await this.createEventWithPrompt();
|
|
80
|
+
* { result } = await this.createEventWithPrompt();
|
|
81
81
|
* }
|
|
82
82
|
*/
|
|
83
83
|
createEventWithPrompt(): Promise<{
|
|
84
|
-
|
|
84
|
+
result: string[];
|
|
85
85
|
}>;
|
|
86
86
|
/**
|
|
87
87
|
* Presents a prompt to the user to select calendars. This method is available only on iOS.
|
|
@@ -138,6 +138,13 @@ export interface CapacitorCalendarPlugin {
|
|
|
138
138
|
*
|
|
139
139
|
* @method createEvent
|
|
140
140
|
* @platform iOS, Android
|
|
141
|
+
* @permissions
|
|
142
|
+
* <h3>Runtime Permissions:</h3>
|
|
143
|
+
* <ul>
|
|
144
|
+
* <li><strong>iOS 17 ≤:</strong> writeCalendar</li>
|
|
145
|
+
* <li><strong>iOS 10 ≤ x ≤ iOS 16:</strong> writeCalendar</li>
|
|
146
|
+
* <li><strong>Android:</strong> readCalendar, writeCalendar</li>
|
|
147
|
+
* </ul>
|
|
141
148
|
* @param {object} options - Options for creating the event.
|
|
142
149
|
* @param {string} options.title - The title of the event.
|
|
143
150
|
* @param {string} options.calendarId - The id of the destination calendar. (Optional)
|
|
@@ -145,8 +152,7 @@ export interface CapacitorCalendarPlugin {
|
|
|
145
152
|
* @param {number} [options.startDate] - The start date and time of the event. (Optional)
|
|
146
153
|
* @param {number} [options.endDate] - The end date and time of the event. (Optional)
|
|
147
154
|
* @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)
|
|
148
|
-
* @returns {Promise<{
|
|
149
|
-
* The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.
|
|
155
|
+
* @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.
|
|
150
156
|
* @example
|
|
151
157
|
* const now = Date.now();
|
|
152
158
|
* const eventOptions = {
|
|
@@ -156,8 +162,7 @@ export interface CapacitorCalendarPlugin {
|
|
|
156
162
|
* endDate: now + 2 * 60 * 60 * 1000,
|
|
157
163
|
* isAllDay: false
|
|
158
164
|
* };
|
|
159
|
-
* const {
|
|
160
|
-
* console.log(eventCreated); // true
|
|
165
|
+
* const { result } = await createEvent(eventOptions);
|
|
161
166
|
*/
|
|
162
167
|
createEvent(options: {
|
|
163
168
|
title: string;
|
|
@@ -167,7 +172,7 @@ export interface CapacitorCalendarPlugin {
|
|
|
167
172
|
endDate?: number;
|
|
168
173
|
isAllDay?: boolean;
|
|
169
174
|
}): Promise<{
|
|
170
|
-
|
|
175
|
+
result: string[];
|
|
171
176
|
}>;
|
|
172
177
|
/**
|
|
173
178
|
* Retrieves the default reminders list set on the device.
|
|
@@ -280,4 +285,25 @@ export interface CapacitorCalendarPlugin {
|
|
|
280
285
|
* void CapacitorCalendar.openReminders();
|
|
281
286
|
*/
|
|
282
287
|
openReminders(): Promise<void>;
|
|
288
|
+
/**
|
|
289
|
+
* Retrieves the list of calendar events present in the given date range.
|
|
290
|
+
*
|
|
291
|
+
* @method listEventsInRange
|
|
292
|
+
* @platform iOS, Android
|
|
293
|
+
* @param {object} options Options for defining the date range.
|
|
294
|
+
* @param {number} options.startDate The start of the date range.
|
|
295
|
+
* @param {number} options.endDate The end of the date range.
|
|
296
|
+
* @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.
|
|
297
|
+
* @example
|
|
298
|
+
* const { result } = await CapacitorCalendar.listEventsInRange({
|
|
299
|
+
* startDate: Date.now(),
|
|
300
|
+
* endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now
|
|
301
|
+
* })
|
|
302
|
+
*/
|
|
303
|
+
listEventsInRange(options: {
|
|
304
|
+
startDate: number;
|
|
305
|
+
endDate: number;
|
|
306
|
+
}): Promise<{
|
|
307
|
+
result: CalendarEvent[];
|
|
308
|
+
}>;
|
|
283
309
|
}
|
|
@@ -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 *\n * @method\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @throws Error If prompt gets cancelled.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt();\n * } else {\n * { result } = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @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 * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS 17 ≤:</strong> writeCalendar</li>\n * <li><strong>iOS 10 ≤ x ≤ iOS 16:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {number} [options.startDate] - The start date and time of the event. (Optional)\n * @param {number} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\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 { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n }): Promise<{ result: string[] }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @method getDefaultRemindersList\n * @platform iOS\n * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device.\n * The returned reminders list object contains an ID and a title.\n * @example\n * const { result } = await getDefaultRemindersList();\n * console.log(result); // { id: '1', title: 'Default Reminders List' }\n */\n getDefaultRemindersList(): Promise<{ result: RemindersList }>;\n\n /**\n * Retrieves all available reminders lists on the device.\n *\n * @async\n * @method getRemindersLists\n * @platform iOS\n * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device.\n * Each reminders list object in the array contains an ID and a title.\n * @example\n * const { result } = await getRemindersLists();\n * console.log(result); // [{ id: '1', title: 'Groceries' }, { id: '2', title: 'Subscriptions' }]\n */\n getRemindersLists(): Promise<{ result: RemindersList[] }>;\n\n /**\n * Creates a reminder with the provided options.\n *\n * @method createReminder\n * @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;
|
|
@@ -19,7 +20,7 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
19
20
|
}>;
|
|
20
21
|
requestAllPermissions(): Promise<PluginPermissionsMap>;
|
|
21
22
|
createEventWithPrompt(): Promise<{
|
|
22
|
-
|
|
23
|
+
result: string[];
|
|
23
24
|
}>;
|
|
24
25
|
selectCalendarsWithPrompt(): Promise<{
|
|
25
26
|
result: Calendar[];
|
|
@@ -38,7 +39,7 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
38
39
|
endDate?: number;
|
|
39
40
|
isAllDay?: boolean;
|
|
40
41
|
}): Promise<{
|
|
41
|
-
|
|
42
|
+
result: string[];
|
|
42
43
|
}>;
|
|
43
44
|
createReminder(_options: {
|
|
44
45
|
title: string;
|
|
@@ -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
|