@ebarooni/capacitor-calendar 6.7.0 → 6.7.2
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/android/build.gradle +10 -7
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +8 -5
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.d.ts +5 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js.map +1 -1
- package/package.json +5 -2
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -14,7 +14,7 @@ buildscript {
|
|
|
14
14
|
mavenCentral()
|
|
15
15
|
}
|
|
16
16
|
dependencies {
|
|
17
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
17
|
+
classpath 'com.android.tools.build:gradle:8.7.0'
|
|
18
18
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -24,10 +24,10 @@ apply plugin: 'org.jetbrains.kotlin.android'
|
|
|
24
24
|
|
|
25
25
|
android {
|
|
26
26
|
namespace "dev.barooni.capacitor.calendar"
|
|
27
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
27
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
28
28
|
defaultConfig {
|
|
29
29
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
30
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
30
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
31
31
|
versionCode 1
|
|
32
32
|
versionName "1.0"
|
|
33
33
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -45,6 +45,9 @@ android {
|
|
|
45
45
|
sourceCompatibility JavaVersion.VERSION_17
|
|
46
46
|
targetCompatibility JavaVersion.VERSION_17
|
|
47
47
|
}
|
|
48
|
+
kotlinOptions {
|
|
49
|
+
jvmTarget = '17'
|
|
50
|
+
}
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
repositories {
|
|
@@ -57,7 +60,7 @@ dependencies {
|
|
|
57
60
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
58
61
|
implementation project(':capacitor-android')
|
|
59
62
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
60
|
-
implementation 'androidx.core:core-ktx:1.
|
|
63
|
+
implementation 'androidx.core:core-ktx:1.15.0'
|
|
61
64
|
testImplementation "junit:junit:$junitVersion"
|
|
62
65
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
63
66
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
@@ -42,12 +42,11 @@ import com.getcapacitor.annotation.PermissionCallback
|
|
|
42
42
|
)
|
|
43
43
|
class CapacitorCalendarPlugin : Plugin() {
|
|
44
44
|
private var implementation = CapacitorCalendar()
|
|
45
|
+
private var eventIdOptional = false
|
|
45
46
|
|
|
46
47
|
@PluginMethod(returnType = PluginMethod.RETURN_PROMISE)
|
|
47
48
|
fun createEventWithPrompt(call: PluginCall) {
|
|
48
49
|
try {
|
|
49
|
-
implementation.eventIdsArray = implementation.fetchCalendarEventIDs(context)
|
|
50
|
-
|
|
51
50
|
val title = call.getString("title", "")
|
|
52
51
|
val calendarId = call.getString("calendarId")
|
|
53
52
|
val location = call.getString("location")
|
|
@@ -56,6 +55,9 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
56
55
|
val isAllDay = call.getBoolean("isAllDay", false)
|
|
57
56
|
val url = call.getString("url")
|
|
58
57
|
val notes = call.getString("notes")
|
|
58
|
+
eventIdOptional = call.getBoolean("eventIdOptional", false) ?: false
|
|
59
|
+
|
|
60
|
+
if (!eventIdOptional) implementation.eventIdsArray = implementation.fetchCalendarEventIDs(context)
|
|
59
61
|
|
|
60
62
|
val intent = Intent(Intent.ACTION_INSERT).setData(CalendarContract.Events.CONTENT_URI)
|
|
61
63
|
|
|
@@ -87,10 +89,11 @@ class CapacitorCalendarPlugin : Plugin() {
|
|
|
87
89
|
throw Exception("[CapacitorCalendar.${::createEventWithPrompt.name}] Call is not defined")
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
val newEventIds = implementation.getNewEventIds(implementation.fetchCalendarEventIDs(context))
|
|
91
92
|
val newIdsArray = JSArray()
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
if (!eventIdOptional) {
|
|
94
|
+
val newEventIds = implementation.getNewEventIds(implementation.fetchCalendarEventIDs(context))
|
|
95
|
+
newEventIds.forEach { id -> newIdsArray.put(id.toString()) }
|
|
96
|
+
}
|
|
94
97
|
val ret = JSObject()
|
|
95
98
|
ret.put("result", newIdsArray)
|
|
96
99
|
call.resolve(ret)
|
package/dist/docs.json
CHANGED
|
@@ -157,12 +157,12 @@
|
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"name": "createEventWithPrompt",
|
|
160
|
-
"signature": "(options: { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; alertOffsetInMinutes?: number | number[]; url?: string; notes?: string; }) => Promise<{ result: string[]; }>",
|
|
160
|
+
"signature": "(options: { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; alertOffsetInMinutes?: number | number[]; url?: string; notes?: string; eventIdOptional?: boolean; }) => Promise<{ result: string[]; }>",
|
|
161
161
|
"parameters": [
|
|
162
162
|
{
|
|
163
163
|
"name": "options",
|
|
164
164
|
"docs": "Options for creating the event.",
|
|
165
|
-
"type": "{ title: string; calendarId?: string | undefined; location?: string | undefined; startDate?: number | undefined; endDate?: number | undefined; isAllDay?: boolean | undefined; alertOffsetInMinutes?: number | number[] | undefined; url?: string | undefined; notes?: string | undefined; }"
|
|
165
|
+
"type": "{ title: string; calendarId?: string | undefined; location?: string | undefined; startDate?: number | undefined; endDate?: number | undefined; isAllDay?: boolean | undefined; alertOffsetInMinutes?: number | number[] | undefined; url?: string | undefined; notes?: string | undefined; eventIdOptional?: boolean | undefined; }"
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
168
|
"returns": "Promise<{ result: string[]; }>",
|
|
@@ -91,6 +91,10 @@ export interface CapacitorCalendarPlugin {
|
|
|
91
91
|
* The parameter is not supported on Android. Negative values are ignored. (Optional)
|
|
92
92
|
* @param {string} [options.url] The URL of the event. (Optional)
|
|
93
93
|
* @param {string} [options.notes] The notes of the event. (Optional)
|
|
94
|
+
* @param {boolean} [options.eventIdOptional] Only for Android. If set to true,
|
|
95
|
+
* READ_CALENDAR permission is not needed to call the method. However, the method will not
|
|
96
|
+
* return the id of the generated event and instead, the returned array will be empty (even if an event is successfully created).
|
|
97
|
+
* The default value is false. This property is ignored on iOS as it is not relevant. (Optional)
|
|
94
98
|
* @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.
|
|
95
99
|
* @example
|
|
96
100
|
* if (capacitor.getPlatform() === 'android') {
|
|
@@ -120,6 +124,7 @@ export interface CapacitorCalendarPlugin {
|
|
|
120
124
|
alertOffsetInMinutes?: number | number[];
|
|
121
125
|
url?: string;
|
|
122
126
|
notes?: string;
|
|
127
|
+
eventIdOptional?: boolean;
|
|
123
128
|
}): Promise<{
|
|
124
129
|
result: string[];
|
|
125
130
|
}>;
|
|
@@ -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 { EventSpan } from \"./schemas/enums/event-span\";\nimport type { PermissionState } from \"@capacitor/core\";\nimport type { Calendar } from \"./schemas/interfaces/calendar\";\nimport type { RemindersList } from \"./schemas/interfaces/reminders-list\";\nimport type { PluginPermissionsMap } from \"./schemas/interfaces/plugin-permissions-map\";\nimport type { ReminderRecurrenceRule } from \"./schemas/interfaces/reminder-recurrence-rule\";\nimport type { CalendarEvent } from \"./schemas/interfaces/calendar-event\";\nimport type { Reminder } from \"./schemas/interfaces/reminder\";\nimport type { CalendarSource } from \"./schemas/interfaces/calendar-source\";\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @async\n * @since 0.1.0\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 { result } = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @async\n * @since 0.1.0\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 * @async\n * @since 0.1.0\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: {\n alias: PluginPermission;\n }): 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 * @async\n * @since 0.1.0\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 * @async\n * @since 0.1.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for creating the event.\n * @param {string} options.title The title of the event.\n * @param {string} options.calendarId The id of the destination calendar. (Optional)\n * @param {string} [options.location] The location of the event. (Optional)\n * @param {number} [options.startDate] The start date and time of the event. (Optional)\n * @param {number} [options.endDate] The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * The parameter is not supported on Android. Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: [5, 30],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin',\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: [0, 1440],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\n * });\n * }\n */\n createEventWithPrompt(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n }): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @async\n * @since 0.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.\n * @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @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 * @async\n * @since 0.3.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: Calendar | null }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title. Returns null if there is no default calendar found.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar | null }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @async\n * @since 0.4.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating the event.\n * @param {string} options.title The title of the event.\n * @param {string} options.calendarId The id of the destination calendar. (Optional)\n * @param {string} [options.location] The location of the event. (Optional)\n * @param {number} [options.startDate] The start date and time of the event. (Optional)\n * @param {number} [options.endDate] The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (Optional)\n * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false,\n * alertOffsetInMinutes: 5,\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\n * };\n * const { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n }): Promise<{ result: string }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @async\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 * @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 * @async\n * @since 0.5.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { result } = await createReminder(reminderOptions);\n * console.log(result); // 'ID_1'\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }>;\n\n /**\n * Opens the calendar app. Since the user leaves your app, use this method with caution.\n * It will open the calendar on today's date if no date is provided.\n *\n * @async\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 * @async\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 * @async\n * @since 0.10.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * @param {number} options.startDate The start of the date range.\n * @param {number} options.endDate The end of the date range.\n * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.\n * @example\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * startDate: Date.now(),\n * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n * })\n */\n listEventsInRange(options: {\n startDate: number;\n endDate: number;\n }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @async\n * @since 0.11.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options Options for defining event IDs.\n * @param {number} options.ids An array of event IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteEventsById(options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Creates a calendar\n *\n * @async\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating a calendar.\n * @param {string} options.title The title of the calendar to create.\n * @param {string} options.color The color of the calendar to create.\n * The color should be a HEX string. (Optional)\n * @param {string} options.sourceId The id of the source of the calendar.\n * If not provided, the source of the default calendar will be used. It is\n * recommended to use fetchAllCalendarSources method to fetch the id of the\n * desired source type.\n * @returns {Promise<{ result: string }>} The id of the created calendar.\n * @example\n * { result } = await CapacitorCalendar.createCalendar({\n * title: 'New Calendar',\n * color: '#1d00fc',\n * sourceId: 'local-source-id',\n * });\n * console.log(result); // 'CALENDAR_ID'\n */\n createCalendar(options: {\n title: string;\n color?: string;\n sourceId?: string;\n }): Promise<{ result: string }>;\n\n /**\n * Deletes a calendar by id\n *\n * @async\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for deleting a calendar.\n * @param {string} options.id The id of the calendar to delete.\n * @example\n * await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });\n */\n deleteCalendar(options: { id: string }): Promise<void>;\n\n /**\n * Retrieves the list of reminders present in the given date range.\n *\n * @async\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readReminders</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * It Will fetch all reminders from all available lists if not provided. (Optional)\n * @param {string[]} options.listIds An array of reminder list ids.\n * @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.\n * @example\n * const now = Date.now();\n * const { result } = await CapacitorCalendar.getRemindersFromLists({\n * listIds: ['LIST_ID_1', 'LIST_ID_2'],\n * });\n */\n getRemindersFromLists(options?: {\n listIds: string[];\n }): Promise<{ result: Reminder[] }>;\n\n /**\n * Deletes reminders given their IDs.\n *\n * @async\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options Options for defining reminder IDs.\n * @param {number} options.ids An array of reminder IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteRemindersById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteRemindersById(options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Requests write access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the write access permission.\n * @example\n * const { result } = await this.requestWriteOnlyCalendarAccess();\n */\n requestWriteOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the read access permission.\n * @example\n * const { result } = await this.requestReadOnlyCalendarAccess();\n */\n requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullCalendarAccess();\n */\n requestFullCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the reminders. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullRemindersAccess();\n */\n requestFullRemindersAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Opens a native prompt to modify an event given its id.\n *\n * @async\n * @since 6.6.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * <li><strong>Android:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @param {Object} options The options for modifying an event.\n * @param {string} options.id The id of the event to be modified.\n * @param {object} options.update The set of event properties to be modified. (Optional)\n * If a property is not supported, it will be ignored. Setting alerts with prompt\n * is only supported on iOS.\n * @returns {Promise<{ result: string[] }>} On iOS, the promise resolves with an array containing\n * the initial event id if the modifications were saved and empty if it was cancelled. However, on\n * Android the array will be empty either way.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.modifyEventWithPrompt({\n * id: 'EVENT_ID_ONE',\n * update: {\n * title: 'newTitle',\n * startDate: Date.now(),\n * },\n * });\n *\n * console.log(result); // ['EVENT_ID_ONE'] or [] if on Android\n */\n modifyEventWithPrompt(options: {\n id: string;\n update?: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<{ result: string[] }>;\n\n /**\n * Modifies an event given its id and update details.\n *\n * @async\n * @since 6.6.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * <li><strong>Android:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @param {Object} options The options for updating an event.\n * @param {string} options.id The id of the event to be modified.\n * @param {EventSpan} options.span The scope of the modifications.\n * Only supported on iOS. (Optional)\n * @param {Object} options.update The set of event properties to be modified.\n * If a property is not supported, it will be ignored. Modifying the reminder of an\n * event is currently not supported on Android.\n * @returns {Promise<void>} A promise that resolves when the update operation is complete.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.modifyEvent({\n * id: 'EVENT_ID_ONE',\n * span: EventSpan.THIS_SPAN,\n * update: {\n * title: 'newTitle',\n * startDate: Date.now(),\n * },\n * });\n */\n modifyEvent(options: {\n id: string;\n span?: EventSpan;\n update: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<void>;\n\n /**\n * Retrieves a list of calendar sources.\n *\n * @async\n * @since 6.6.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of\n * calendar sources.\n * @example\n * const { result } = await fetchAllCalendarSources();\n * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]\n */\n fetchAllCalendarSources(): Promise<{ result: CalendarSource[] }>;\n\n /**\n * Retrieves a list of reminders sources.\n *\n * @async\n * @since 6.6.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of\n * reminders sources.\n * @example\n * const { result } = await fetchAllRemindersSources();\n * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]\n */\n fetchAllRemindersSources(): Promise<{ result: CalendarSource[] }>;\n\n /**\n * Modifies a reminder given its id and update details.\n *\n * @async\n * @since 6.7.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders, readReminders</li>\n * </ul>\n * @param {Object} options The options for updating a reminder.\n * @param {string} options.id The id of the reminder to be modified.\n * @param {Object} options.update The set of reminder properties to be modified.\n * @returns {Promise<void>} A promise that resolves when the update operation is complete.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.reminder({\n * id: 'REMINDER_ID_ONE',\n * update: {\n * title: 'newTitle',\n * isCompleted: true\n * },\n * });\n */\n modifyReminder(options: {\n id: string;\n update: {\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 };\n }): 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 { EventSpan } from \"./schemas/enums/event-span\";\nimport type { PermissionState } from \"@capacitor/core\";\nimport type { Calendar } from \"./schemas/interfaces/calendar\";\nimport type { RemindersList } from \"./schemas/interfaces/reminders-list\";\nimport type { PluginPermissionsMap } from \"./schemas/interfaces/plugin-permissions-map\";\nimport type { ReminderRecurrenceRule } from \"./schemas/interfaces/reminder-recurrence-rule\";\nimport type { CalendarEvent } from \"./schemas/interfaces/calendar-event\";\nimport type { Reminder } from \"./schemas/interfaces/reminder\";\nimport type { CalendarSource } from \"./schemas/interfaces/calendar-source\";\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @async\n * @since 0.1.0\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 { result } = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @async\n * @since 0.1.0\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 * @async\n * @since 0.1.0\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: {\n alias: PluginPermission;\n }): 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 * @async\n * @since 0.1.0\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 * @async\n * @since 0.1.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for creating the event.\n * @param {string} options.title The title of the event.\n * @param {string} options.calendarId The id of the destination calendar. (Optional)\n * @param {string} [options.location] The location of the event. (Optional)\n * @param {number} [options.startDate] The start date and time of the event. (Optional)\n * @param {number} [options.endDate] The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * The parameter is not supported on Android. Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (Optional)\n * @param {boolean} [options.eventIdOptional] Only for Android. If set to true,\n * READ_CALENDAR permission is not needed to call the method. However, the method will not\n * return the id of the generated event and instead, the returned array will be empty (even if an event is successfully created).\n * The default value is false. This property is ignored on iOS as it is not relevant. (Optional)\n * @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events.\n * @example\n * if (capacitor.getPlatform() === 'android') {\n * await this.requestPermission({ alias: 'readCalendar' });\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: [5, 30],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin',\n * });\n * } else {\n * { result } = result = await this.createEventWithPrompt({\n * title: 'Title',\n * alertOffsetInMinutes: [0, 1440],\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\n * });\n * }\n */\n createEventWithPrompt(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n eventIdOptional?: boolean;\n }): Promise<{ result: string[] }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @async\n * @since 0.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars.\n * @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one.\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle;\n selectionStyle: CalendarChooserSelectionStyle;\n }): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @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 * @async\n * @since 0.3.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: Calendar | null }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title. Returns null if there is no default calendar found.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar | null }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @async\n * @since 0.4.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating the event.\n * @param {string} options.title The title of the event.\n * @param {string} options.calendarId The id of the destination calendar. (Optional)\n * @param {string} [options.location] The location of the event. (Optional)\n * @param {number} [options.startDate] The start date and time of the event. (Optional)\n * @param {number} [options.endDate] The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] Weather the event is for the entire day or not. (Optional)\n * @param {number} [options.alertOffsetInMinutes] If a number >= 0 is provided, an alert will be set for the event this many\n * minutes *before* the event. If an array of number >= 0 are provided, it will add multiple alerts.\n * On iOS only the first two valid elements of the array are taken into account.\n * Negative values are ignored. (Optional)\n * @param {string} [options.url] The URL of the event. (Optional)\n * @param {string} [options.notes] The notes of the event. (Optional)\n * @returns {Promise<{ result: string }>} A promise that resolves with the id of the created event.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: now,\n * endDate: now + 2 * 60 * 60 * 1000,\n * isAllDay: false,\n * alertOffsetInMinutes: 5,\n * url: 'https://capacitor-calendar.pages.dev',\n * notes: 'A CapacitorJS plugin'\n * };\n * const { result } = await createEvent(eventOptions);\n */\n createEvent(options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n }): Promise<{ result: string }>;\n\n /**\n * Retrieves the default reminders list set on the device.\n *\n * @async\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 * @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 * @async\n * @since 0.5.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options - Options for creating the reminder.\n * @param {string} options.title - The title of the reminder.\n * @param {string} options.listId - The id of the destination reminders list. (Optional)\n * @param {number} [options.priority] - The priority of the reminder. A number between one and nine where nine\n * has the least priority and 0 means no priority at all. Values outside of this range will be rounded to the\n * nearest border. (Optional)\n * @param {boolean} [options.isCompleted] - Whether the reminder is completed already or not. (Optional)\n * @param {number} [options.startDate] - The start date of the reminder. (Optional)\n * @param {number} [options.dueDate] - The due date of the reminder. (Optional)\n * @param {number} [options.completionDate] - The date at which the reminder was completed. (Optional)\n * @param {string} [options.notes] - Additional notes about the reminder. (Optional)\n * @param {string} [options.url] - A URL to save under the reminder. (Optional)\n * @param {string} [options.location] - A location to save under the reminder. (Optional)\n * @param {string} [options.recurrence] - The rules for the recurrence of the reminder. (Optional)\n * @returns {Promise<{ result: string }>} A Promise that resolves with the id of the created reminder\n * @example\n * const now = Date.now();\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n * const reminderOptions = {\n * title: 'Buy cucumber',\n * listId: 'ABC12',\n * priority: 5,\n * isCompleted: false,\n * startDateComponents: now,\n * notes: 'Also buy tomatoes',\n * url: 'https://capacitor-calendar.pages.dev/',\n * location: 'My Local Supermarket',\n * recurrence: rules\n * };\n * const { result } = await createReminder(reminderOptions);\n * console.log(result); // 'ID_1'\n */\n createReminder(options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }>;\n\n /**\n * Opens the calendar app. Since the user leaves your app, use this method with caution.\n * It will open the calendar on today's date if no date is provided.\n *\n * @async\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 * @async\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 * @async\n * @since 0.10.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar</li>\n * <li><strong>Android:</strong> readCalendar</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * @param {number} options.startDate The start of the date range.\n * @param {number} options.endDate The end of the date range.\n * @returns {Promise<{ result: CalendarEvent[] }>} A Promise that resolves with the list of events.\n * @example\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * startDate: Date.now(),\n * endDate: Date.now() + 6 * 7 * 24 * 60 * 60 * 1000, // 6 weeks from now\n * })\n */\n listEventsInRange(options: {\n startDate: number;\n endDate: number;\n }): Promise<{ result: CalendarEvent[] }>;\n\n /**\n * Deletes events from the calendar given their IDs.\n *\n * @async\n * @since 0.11.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar</li>\n * <li><strong>Android:</strong> writeCalendar</li>\n * </ul>\n * @param {object} options Options for defining event IDs.\n * @param {number} options.ids An array of event IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteEventsById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteEventsById(options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Creates a calendar\n *\n * @async\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for creating a calendar.\n * @param {string} options.title The title of the calendar to create.\n * @param {string} options.color The color of the calendar to create.\n * The color should be a HEX string. (Optional)\n * @param {string} options.sourceId The id of the source of the calendar.\n * If not provided, the source of the default calendar will be used. It is\n * recommended to use fetchAllCalendarSources method to fetch the id of the\n * desired source type.\n * @returns {Promise<{ result: string }>} The id of the created calendar.\n * @example\n * { result } = await CapacitorCalendar.createCalendar({\n * title: 'New Calendar',\n * color: '#1d00fc',\n * sourceId: 'local-source-id',\n * });\n * console.log(result); // 'CALENDAR_ID'\n */\n createCalendar(options: {\n title: string;\n color?: string;\n sourceId?: string;\n }): Promise<{ result: string }>;\n\n /**\n * Deletes a calendar by id\n *\n * @async\n * @since 5.2.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n * </ul>\n * @param {object} options Options for deleting a calendar.\n * @param {string} options.id The id of the calendar to delete.\n * @example\n * await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });\n */\n deleteCalendar(options: { id: string }): Promise<void>;\n\n /**\n * Retrieves the list of reminders present in the given date range.\n *\n * @async\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> readReminders</li>\n * </ul>\n * @param {object} options Options for defining the date range.\n * It Will fetch all reminders from all available lists if not provided. (Optional)\n * @param {string[]} options.listIds An array of reminder list ids.\n * @returns {Promise<{ result: Reminder[] }>} A Promise that resolves with the list of reminders.\n * @example\n * const now = Date.now();\n * const { result } = await CapacitorCalendar.getRemindersFromLists({\n * listIds: ['LIST_ID_1', 'LIST_ID_2'],\n * });\n */\n getRemindersFromLists(options?: {\n listIds: string[];\n }): Promise<{ result: Reminder[] }>;\n\n /**\n * Deletes reminders given their IDs.\n *\n * @async\n * @since 5.3.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders</li>\n * </ul>\n * @param {object} options Options for defining reminder IDs.\n * @param {number} options.ids An array of reminder IDs to be deleted.\n * @returns {Promise<{ deleted: string[], failed: string[] }>}\n * A promise that resolves to an object with two properties:\n * - deleted: string[] - An array of IDs that were successfully deleted.\n * - failed: string[] - An array of IDs that could not be deleted.\n * @example\n * const idsToDelete = ['ID_1', 'ID_2', 'ID_DOES_NOT_EXIST'];\n * const { result } = await CapacitorCalendar.deleteRemindersById(idsToDelete)\n * console.log(result.deleted) // ['ID_1', 'ID_2']\n * console.log(result.failed) // ['ID_DOES_NOT_EXIST']\n */\n deleteRemindersById(options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }>;\n\n /**\n * Requests write access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the write access permission.\n * @example\n * const { result } = await this.requestWriteOnlyCalendarAccess();\n */\n requestWriteOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of the read access permission.\n * @example\n * const { result } = await this.requestReadOnlyCalendarAccess();\n */\n requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the calendar. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS, Android\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullCalendarAccess();\n */\n requestFullCalendarAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Requests read and write access for the reminders. If its already granted, it will directly return the state.\n *\n * @async\n * @since 5.4.0\n * @platform iOS\n * @returns {Promise<{ result: PermissionState }>} A promise that resolves with the state of read and write access permission.\n * @example\n * const { result } = await this.requestFullRemindersAccess();\n */\n requestFullRemindersAccess(): Promise<{ result: PermissionState }>;\n\n /**\n * Opens a native prompt to modify an event given its id.\n *\n * @async\n * @since 6.6.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * <li><strong>Android:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @param {Object} options The options for modifying an event.\n * @param {string} options.id The id of the event to be modified.\n * @param {object} options.update The set of event properties to be modified. (Optional)\n * If a property is not supported, it will be ignored. Setting alerts with prompt\n * is only supported on iOS.\n * @returns {Promise<{ result: string[] }>} On iOS, the promise resolves with an array containing\n * the initial event id if the modifications were saved and empty if it was cancelled. However, on\n * Android the array will be empty either way.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.modifyEventWithPrompt({\n * id: 'EVENT_ID_ONE',\n * update: {\n * title: 'newTitle',\n * startDate: Date.now(),\n * },\n * });\n *\n * console.log(result); // ['EVENT_ID_ONE'] or [] if on Android\n */\n modifyEventWithPrompt(options: {\n id: string;\n update?: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<{ result: string[] }>;\n\n /**\n * Modifies an event given its id and update details.\n *\n * @async\n * @since 6.6.0\n * @platform iOS, Android\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * <li><strong>Android:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @param {Object} options The options for updating an event.\n * @param {string} options.id The id of the event to be modified.\n * @param {EventSpan} options.span The scope of the modifications.\n * Only supported on iOS. (Optional)\n * @param {Object} options.update The set of event properties to be modified.\n * If a property is not supported, it will be ignored. Modifying the reminder of an\n * event is currently not supported on Android.\n * @returns {Promise<void>} A promise that resolves when the update operation is complete.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.modifyEvent({\n * id: 'EVENT_ID_ONE',\n * span: EventSpan.THIS_SPAN,\n * update: {\n * title: 'newTitle',\n * startDate: Date.now(),\n * },\n * });\n */\n modifyEvent(options: {\n id: string;\n span?: EventSpan;\n update: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<void>;\n\n /**\n * Retrieves a list of calendar sources.\n *\n * @async\n * @since 6.6.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of\n * calendar sources.\n * @example\n * const { result } = await fetchAllCalendarSources();\n * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]\n */\n fetchAllCalendarSources(): Promise<{ result: CalendarSource[] }>;\n\n /**\n * Retrieves a list of reminders sources.\n *\n * @async\n * @since 6.6.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeCalendar, readCalendar</li>\n * </ul>\n * @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of\n * reminders sources.\n * @example\n * const { result } = await fetchAllRemindersSources();\n * console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }]\n */\n fetchAllRemindersSources(): Promise<{ result: CalendarSource[] }>;\n\n /**\n * Modifies a reminder given its id and update details.\n *\n * @async\n * @since 6.7.0\n * @platform iOS\n * @permissions\n * <h3>Runtime Permissions:</h3>\n * <ul>\n * <li><strong>iOS:</strong> writeReminders, readReminders</li>\n * </ul>\n * @param {Object} options The options for updating a reminder.\n * @param {string} options.id The id of the reminder to be modified.\n * @param {Object} options.update The set of reminder properties to be modified.\n * @returns {Promise<void>} A promise that resolves when the update operation is complete.\n * @throws {Error} throws an error if an event for the given id is not found.\n * @example\n * const { result } = await CapacitorCalendar.reminder({\n * id: 'REMINDER_ID_ONE',\n * update: {\n * title: 'newTitle',\n * isCompleted: true\n * },\n * });\n */\n modifyReminder(options: {\n id: string;\n update: {\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 };\n }): Promise<void>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY7D,MAAM,OAAO,oBACX,SAAQ,SAAS;IAGV,eAAe,CAAC,QAEtB;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAC7D,CAAC;IACJ,CAAC;IAEM,mBAAmB;QACxB,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CACjE,CAAC;IACJ,CAAC;IAEM,iBAAiB,CAAC,QAExB;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAC/D,CAAC;IACJ,CAAC;IAEM,qBAAqB;QAC1B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CACnE,CAAC;IACJ,CAAC;IAEM,qBAAqB,CAAC,QAU5B;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CACnE,CAAC;IACJ,CAAC;IAEM,yBAAyB;QAC9B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,gCAAgC,CACvE,CAAC;IACJ,CAAC;IAEM,aAAa;QAClB,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,gCAAgC,CAC3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B;QAC5B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,gCAAgC,CACrE,CAAC;IACJ,CAAC;IAEM,wBAAwB;QAC7B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,gCAAgC,CACtE,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,QAed;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAC5D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { 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 { EventSpan } from \"./schemas/enums/event-span\";\nimport type { Calendar } from \"./schemas/interfaces/calendar\";\nimport type { RemindersList } from \"./schemas/interfaces/reminders-list\";\nimport type { PluginPermissionsMap } from \"./schemas/interfaces/plugin-permissions-map\";\nimport type { CalendarEvent } from \"./schemas/interfaces/calendar-event\";\nimport type { Reminder } from \"./schemas/interfaces/reminder\";\nimport type { CalendarSource } from \"./schemas/interfaces/calendar-source\";\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.checkPermission.name} is not implemented on the web`,\n );\n }\n\n public checkAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(\n `${this.checkAllPermissions.name} is not implemented on the web`,\n );\n }\n\n public requestPermission(_options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestPermission.name} is not implemented on the web`,\n );\n }\n\n public requestAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(\n `${this.requestAllPermissions.name} is not implemented on the web`,\n );\n }\n\n public createEventWithPrompt(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n }): Promise<{ result: string[] }> {\n throw this.unimplemented(\n `${this.createEventWithPrompt.name} is not implemented on the web`,\n );\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(\n `${this.selectCalendarsWithPrompt.name} is not implemented on the web`,\n );\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(\n `${this.listCalendars.name} is not implemented on the web`,\n );\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar | null }> {\n throw this.unimplemented(\n `${this.getDefaultCalendar.name} is not implemented on the web`,\n );\n }\n\n public createEvent(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n }): Promise<{\n result: string;\n }> {\n throw this.unimplemented(\n `${this.createEvent.name} is not implemented on the web`,\n );\n }\n\n public createReminder(_options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }> {\n throw this.unimplemented(\n `${this.createReminder.name} is not implemented on the web`,\n );\n }\n\n public getDefaultRemindersList(): Promise<{ result: RemindersList }> {\n throw this.unimplemented(\n `${this.getDefaultRemindersList.name} is not implemented on the web`,\n );\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(\n `${this.getRemindersLists.name} is not implemented on the web`,\n );\n }\n\n public openCalendar(_options: { date?: number }): Promise<void> {\n throw this.unimplemented(\n `${this.openCalendar.name} is not implemented on the web`,\n );\n }\n\n public openReminders(): Promise<void> {\n throw this.unimplemented(\n `${this.openReminders.name} is not implemented on the web`,\n );\n }\n\n public listEventsInRange(_options: {\n startDate: number;\n endDate: number;\n }): Promise<{ result: CalendarEvent[] }> {\n throw this.unimplemented(\n `${this.listEventsInRange.name} is not implemented on the web`,\n );\n }\n\n public deleteEventsById(_options: { ids: string[] }): Promise<{\n result: { deleted: string[]; failed: string[] };\n }> {\n throw this.unimplemented(\n `${this.deleteEventsById.name} is not implemented on the web`,\n );\n }\n\n public createCalendar(_options: {\n title: string;\n color?: string;\n sourceId?: string;\n }): Promise<{ result: string }> {\n throw this.unimplemented(\n `${this.createCalendar.name} is not implemented on the web`,\n );\n }\n\n public deleteCalendar(_options: { id: string }): Promise<void> {\n throw this.unimplemented(\n `${this.deleteCalendar.name} is not implemented on the web`,\n );\n }\n\n public getRemindersFromLists(_options?: {\n listIds: string[];\n }): Promise<{ result: Reminder[] }> {\n throw this.unimplemented(\n `${this.getRemindersFromLists.name} is not implemented on the web`,\n );\n }\n\n public deleteRemindersById(_options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }> {\n throw this.unimplemented(\n `${this.deleteRemindersById.name} is not implemented on the web`,\n );\n }\n\n public requestWriteOnlyCalendarAccess(): Promise<{\n result: PermissionState;\n }> {\n throw this.unimplemented(\n `${this.requestWriteOnlyCalendarAccess.name} is not implemented on the web`,\n );\n }\n\n public requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestReadOnlyCalendarAccess.name} is not implemented on the web`,\n );\n }\n\n public requestFullCalendarAccess(): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestFullCalendarAccess.name} is not implemented on the web`,\n );\n }\n\n public requestFullRemindersAccess(): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestFullRemindersAccess.name} is not implemented on the web`,\n );\n }\n\n public modifyEventWithPrompt(_options: {\n id: string;\n update?: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<{ result: string[] }> {\n throw this.unimplemented(\n `${this.modifyEventWithPrompt.name} is not implemented on the web`,\n );\n }\n\n public modifyEvent(_options: {\n id: string;\n span?: EventSpan;\n update: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<void> {\n throw this.unimplemented(\n `${this.modifyEvent.name} is not implemented on the web`,\n );\n }\n\n public fetchAllCalendarSources(): Promise<{ result: CalendarSource[] }> {\n throw this.unimplemented(\n `${this.fetchAllCalendarSources.name} is not implemented on the web`,\n );\n }\n\n public fetchAllRemindersSources(): Promise<{ result: CalendarSource[] }> {\n throw this.unimplemented(\n `${this.fetchAllRemindersSources.name} is not implemented on the web`,\n );\n }\n\n modifyReminder(_options: {\n id: string;\n update: {\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 };\n }): Promise<void> {\n throw this.unimplemented(\n `${this.modifyReminder.name} is not implemented on the web`,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY7D,MAAM,OAAO,oBACX,SAAQ,SAAS;IAGV,eAAe,CAAC,QAEtB;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAC7D,CAAC;IACJ,CAAC;IAEM,mBAAmB;QACxB,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CACjE,CAAC;IACJ,CAAC;IAEM,iBAAiB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CACtB,GAAG,IAAI,CAAC,6BAA6B,CAAC,IAAI,gCAAgC,CAC3E,CAAC;IACJ,CAAC;IAEM,yBAAyB;QAC9B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,gCAAgC,CACvE,CAAC;IACJ,CAAC;IAEM,0BAA0B;QAC/B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,0BAA0B,CAAC,IAAI,gCAAgC,CACxE,CAAC;IACJ,CAAC;IAEM,qBAAqB,CAAC,QAa5B;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CACnE,CAAC;IACJ,CAAC;IAEM,WAAW,CAAC,QAclB;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,gCAAgC,CACzD,CAAC;IACJ,CAAC;IAEM,uBAAuB;QAC5B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,uBAAuB,CAAC,IAAI,gCAAgC,CACrE,CAAC;IACJ,CAAC;IAEM,wBAAwB;QAC7B,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,gCAAgC,CACtE,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,QAed;QACC,MAAM,IAAI,CAAC,aAAa,CACtB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAC5D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { 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 { EventSpan } from \"./schemas/enums/event-span\";\nimport type { Calendar } from \"./schemas/interfaces/calendar\";\nimport type { RemindersList } from \"./schemas/interfaces/reminders-list\";\nimport type { PluginPermissionsMap } from \"./schemas/interfaces/plugin-permissions-map\";\nimport type { CalendarEvent } from \"./schemas/interfaces/calendar-event\";\nimport type { Reminder } from \"./schemas/interfaces/reminder\";\nimport type { CalendarSource } from \"./schemas/interfaces/calendar-source\";\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.checkPermission.name} is not implemented on the web`,\n );\n }\n\n public checkAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(\n `${this.checkAllPermissions.name} is not implemented on the web`,\n );\n }\n\n public requestPermission(_options: {\n alias: PluginPermission;\n }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestPermission.name} is not implemented on the web`,\n );\n }\n\n public requestAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(\n `${this.requestAllPermissions.name} is not implemented on the web`,\n );\n }\n\n public createEventWithPrompt(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n eventIdOptional?: boolean;\n }): Promise<{ result: string[] }> {\n throw this.unimplemented(\n `${this.createEventWithPrompt.name} is not implemented on the web`,\n );\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(\n `${this.selectCalendarsWithPrompt.name} is not implemented on the web`,\n );\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(\n `${this.listCalendars.name} is not implemented on the web`,\n );\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar | null }> {\n throw this.unimplemented(\n `${this.getDefaultCalendar.name} is not implemented on the web`,\n );\n }\n\n public createEvent(_options: {\n title: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n }): Promise<{\n result: string;\n }> {\n throw this.unimplemented(\n `${this.createEvent.name} is not implemented on the web`,\n );\n }\n\n public createReminder(_options: {\n title: string;\n listId?: string;\n priority?: number;\n isCompleted?: boolean;\n startDate?: number;\n dueDate?: number;\n completionDate?: number;\n notes?: string;\n url?: string;\n location?: string;\n recurrence?: ReminderRecurrenceRule;\n }): Promise<{ result: string }> {\n throw this.unimplemented(\n `${this.createReminder.name} is not implemented on the web`,\n );\n }\n\n public getDefaultRemindersList(): Promise<{ result: RemindersList }> {\n throw this.unimplemented(\n `${this.getDefaultRemindersList.name} is not implemented on the web`,\n );\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(\n `${this.getRemindersLists.name} is not implemented on the web`,\n );\n }\n\n public openCalendar(_options: { date?: number }): Promise<void> {\n throw this.unimplemented(\n `${this.openCalendar.name} is not implemented on the web`,\n );\n }\n\n public openReminders(): Promise<void> {\n throw this.unimplemented(\n `${this.openReminders.name} is not implemented on the web`,\n );\n }\n\n public listEventsInRange(_options: {\n startDate: number;\n endDate: number;\n }): Promise<{ result: CalendarEvent[] }> {\n throw this.unimplemented(\n `${this.listEventsInRange.name} is not implemented on the web`,\n );\n }\n\n public deleteEventsById(_options: { ids: string[] }): Promise<{\n result: { deleted: string[]; failed: string[] };\n }> {\n throw this.unimplemented(\n `${this.deleteEventsById.name} is not implemented on the web`,\n );\n }\n\n public createCalendar(_options: {\n title: string;\n color?: string;\n sourceId?: string;\n }): Promise<{ result: string }> {\n throw this.unimplemented(\n `${this.createCalendar.name} is not implemented on the web`,\n );\n }\n\n public deleteCalendar(_options: { id: string }): Promise<void> {\n throw this.unimplemented(\n `${this.deleteCalendar.name} is not implemented on the web`,\n );\n }\n\n public getRemindersFromLists(_options?: {\n listIds: string[];\n }): Promise<{ result: Reminder[] }> {\n throw this.unimplemented(\n `${this.getRemindersFromLists.name} is not implemented on the web`,\n );\n }\n\n public deleteRemindersById(_options: {\n ids: string[];\n }): Promise<{ result: { deleted: string[]; failed: string[] } }> {\n throw this.unimplemented(\n `${this.deleteRemindersById.name} is not implemented on the web`,\n );\n }\n\n public requestWriteOnlyCalendarAccess(): Promise<{\n result: PermissionState;\n }> {\n throw this.unimplemented(\n `${this.requestWriteOnlyCalendarAccess.name} is not implemented on the web`,\n );\n }\n\n public requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestReadOnlyCalendarAccess.name} is not implemented on the web`,\n );\n }\n\n public requestFullCalendarAccess(): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestFullCalendarAccess.name} is not implemented on the web`,\n );\n }\n\n public requestFullRemindersAccess(): Promise<{ result: PermissionState }> {\n throw this.unimplemented(\n `${this.requestFullRemindersAccess.name} is not implemented on the web`,\n );\n }\n\n public modifyEventWithPrompt(_options: {\n id: string;\n update?: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<{ result: string[] }> {\n throw this.unimplemented(\n `${this.modifyEventWithPrompt.name} is not implemented on the web`,\n );\n }\n\n public modifyEvent(_options: {\n id: string;\n span?: EventSpan;\n update: {\n title?: string;\n calendarId?: string;\n location?: string;\n startDate?: number;\n endDate?: number;\n isAllDay?: boolean;\n alertOffsetInMinutes?: number | number[];\n url?: string;\n notes?: string;\n };\n }): Promise<void> {\n throw this.unimplemented(\n `${this.modifyEvent.name} is not implemented on the web`,\n );\n }\n\n public fetchAllCalendarSources(): Promise<{ result: CalendarSource[] }> {\n throw this.unimplemented(\n `${this.fetchAllCalendarSources.name} is not implemented on the web`,\n );\n }\n\n public fetchAllRemindersSources(): Promise<{ result: CalendarSource[] }> {\n throw this.unimplemented(\n `${this.fetchAllRemindersSources.name} is not implemented on the web`,\n );\n }\n\n modifyReminder(_options: {\n id: string;\n update: {\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 };\n }): Promise<void> {\n throw this.unimplemented(\n `${this.modifyReminder.name} is not implemented on the web`,\n );\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebarooni/capacitor-calendar",
|
|
3
|
-
"version": "6.7.
|
|
3
|
+
"version": "6.7.2",
|
|
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",
|
|
@@ -65,7 +65,10 @@
|
|
|
65
65
|
"clean": "rm -rf ./dist",
|
|
66
66
|
"build": "npm run clean && npm run docgen:api-reference && npm run docgen:readme && tsc && rollup -c rollup.config.mjs",
|
|
67
67
|
"prepublishOnly": "npm run build",
|
|
68
|
-
"serve": "cd example && npx ng serve"
|
|
68
|
+
"serve": "cd example && npx ng serve",
|
|
69
|
+
"version:patch": "npm version patch --git-tag-version false",
|
|
70
|
+
"version:minor": "npm version minor --git-tag-version false",
|
|
71
|
+
"version:major": "npm version major --git-tag-version false"
|
|
69
72
|
},
|
|
70
73
|
"devDependencies": {
|
|
71
74
|
"@angular/cli": "^17.1.2",
|