UNPKG

@ebarooni/capacitor-calendar

Version:

A capacitor plugin for managing calendar events on iOS and Android, with reminders support on iOS.

545 lines (526 loc) 17 kB
var capacitorCapacitorCalendar = (function (exports, core) { 'use strict'; /** * @since 7.1.0 */ exports.AttendeeRole = void 0; (function (AttendeeRole) { /** * @platform Android, iOS * @since 7.1.0 */ AttendeeRole["UNKNOWN"] = "unknown"; /** * @platform iOS * @since 7.1.0 */ AttendeeRole["REQUIRED"] = "required"; /** * @platform iOS * @since 7.1.0 */ AttendeeRole["OPTIONAL"] = "optional"; /** * @platform iOS * @since 7.1.0 */ AttendeeRole["CHAIR"] = "chair"; /** * @platform Android, iOS * @since 7.1.0 */ AttendeeRole["NON_PARTICIPANT"] = "nonParticipant"; /** * @platform Android * @since 7.1.0 */ AttendeeRole["ATTENDEE"] = "attendee"; /** * @platform Android * @since 7.1.0 */ AttendeeRole["ORGANIZER"] = "organizer"; /** * @platform Android * @since 7.1.0 */ AttendeeRole["PERFORMER"] = "performer"; /** * @platform Android * @since 7.1.0 */ AttendeeRole["SPEAKER"] = "speaker"; })(exports.AttendeeRole || (exports.AttendeeRole = {})); /** * @since 7.1.0 */ exports.AttendeeStatus = void 0; (function (AttendeeStatus) { /** * @platform Android * @since 7.1.0 */ AttendeeStatus["NONE"] = "none"; /** * @platform Android, iOS * @since 7.1.0 */ AttendeeStatus["ACCEPTED"] = "accepted"; /** * @platform Android, iOS * @since 7.1.0 */ AttendeeStatus["DECLINED"] = "declined"; /** * @platform Android * @since 7.1.0 */ AttendeeStatus["INVITED"] = "invited"; /** * @platform iOS * @since 7.1.0 */ AttendeeStatus["UNKNOWN"] = "unknown"; /** * @platform iOS * @since 7.1.0 */ AttendeeStatus["PENDING"] = "pending"; /** * @platform Android, iOS * @since 7.1.0 */ AttendeeStatus["TENTATIVE"] = "tentative"; /** * @platform iOS * @since 7.1.0 */ AttendeeStatus["DELEGATED"] = "delegated"; /** * @platform iOS * @since 7.1.0 */ AttendeeStatus["COMPLETED"] = "completed"; /** * @platform iOS * @since 7.1.0 */ AttendeeStatus["IN_PROCESS"] = "inProcess"; })(exports.AttendeeStatus || (exports.AttendeeStatus = {})); /** * @since 7.1.0 */ exports.AttendeeType = void 0; (function (AttendeeType) { /** * @platform Android, iOS * @since 7.1.0 */ AttendeeType["UNKNOWN"] = "unknown"; /** * @platform iOS * @since 7.1.0 */ AttendeeType["PERSON"] = "person"; /** * @platform iOS * @since 7.1.0 */ AttendeeType["ROOM"] = "room"; /** * @platform Android, iOS * @since 7.1.0 */ AttendeeType["RESOURCE"] = "resource"; /** * @platform iOS * @since 7.1.0 */ AttendeeType["GROUP"] = "group"; /** * @platform Android * @since 7.1.0 */ AttendeeType["REQUIRED"] = "required"; /** * @platform Android * @since 7.1.0 */ AttendeeType["NONE"] = "none"; /** * @platform Android * @since 7.1.0 */ AttendeeType["OPTIONAL"] = "optional"; })(exports.AttendeeType || (exports.AttendeeType = {})); /** * @since 0.2.0 */ exports.CalendarChooserDisplayStyle = void 0; (function (CalendarChooserDisplayStyle) { /** * @since 0.2.0 */ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS"; /** * @since 0.2.0 */ CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY"; })(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {})); /** * Enum defining available calendar and reminders related permissions. * * @since 7.1.0 */ exports.CalendarPermissionScope = void 0; (function (CalendarPermissionScope) { /** * Permission required for reading calendar events. * * @permissions * | Platform | Required | * |-----------|---------------------| * | iOS 17+ | `NSCalendarsFullAccessUsageDescription` | * | iOS 13-16 | `NSCalendarsUsageDescription` | * | Android | `android.permission.READ_CALENDAR` | * * @platform Android, iOS * @since 7.1.0 */ CalendarPermissionScope["READ_CALENDAR"] = "readCalendar"; /** * Permission required for reading reminders. * * @permissions * | Platform | Required | * |-----------|---------------------| * | iOS 17+ | `NSRemindersFullAccessUsageDescription` | * | iOS 10-16 | `NSRemindersUsageDescription` | * @platform iOS * @since 7.1.0 */ CalendarPermissionScope["READ_REMINDERS"] = "readReminders"; /** * Permission required for adding or modifying calendar events. * * @permissions * | Platform | Required | * |-----------|---------------------| * | iOS 17+ | `NSCalendarsWriteOnlyAccessUsageDescription` | * | iOS 13-16 | `NSCalendarsUsageDescription` | * | Android | `android.permission.WRITE_CALENDAR` | * * @platform Android, iOS * @since 7.1.0 */ CalendarPermissionScope["WRITE_CALENDAR"] = "writeCalendar"; /** * Permission required for adding or modifying reminders. * * @permissions * | Platform | Required | * |-----------|---------------------| * | iOS 17+ | `NSRemindersFullAccessUsageDescription` | * | iOS 13-16 | `NSRemindersUsageDescription` | * * @platform iOS * @since 7.1.0 */ CalendarPermissionScope["WRITE_REMINDERS"] = "writeReminders"; })(exports.CalendarPermissionScope || (exports.CalendarPermissionScope = {})); /** * @since 7.1.0 */ exports.CalendarSourceType = void 0; (function (CalendarSourceType) { /** * @since 7.1.0 */ CalendarSourceType[CalendarSourceType["LOCAL"] = 0] = "LOCAL"; /** * @since 7.1.0 */ CalendarSourceType[CalendarSourceType["EXCHANGE"] = 1] = "EXCHANGE"; /** * @since 7.1.0 */ CalendarSourceType[CalendarSourceType["CAL_DAV"] = 2] = "CAL_DAV"; /** * @since 7.1.0 */ CalendarSourceType[CalendarSourceType["MOBILE_ME"] = 3] = "MOBILE_ME"; /** * @since 7.1.0 */ CalendarSourceType[CalendarSourceType["SUBSCRIBED"] = 4] = "SUBSCRIBED"; /** * @since 7.1.0 */ CalendarSourceType[CalendarSourceType["BIRTHDAYS"] = 5] = "BIRTHDAYS"; })(exports.CalendarSourceType || (exports.CalendarSourceType = {})); /** * @since 7.1.0 */ exports.CalendarType = void 0; (function (CalendarType) { /** * @since 7.1.0 */ CalendarType[CalendarType["LOCAL"] = 0] = "LOCAL"; /** * @since 7.1.0 */ CalendarType[CalendarType["CAL_DAV"] = 1] = "CAL_DAV"; /** * @since 7.1.0 */ CalendarType[CalendarType["EXCHANGE"] = 2] = "EXCHANGE"; /** * @since 7.1.0 */ CalendarType[CalendarType["SUBSCRIPTION"] = 3] = "SUBSCRIPTION"; /** * @since 7.1.0 */ CalendarType[CalendarType["BIRTHDAY"] = 4] = "BIRTHDAY"; })(exports.CalendarType || (exports.CalendarType = {})); /** * @since 7.1.0 */ exports.EventAvailability = void 0; (function (EventAvailability) { /** * @platform iOS * @since 7.1.0 */ EventAvailability[EventAvailability["NOT_SUPPORTED"] = -1] = "NOT_SUPPORTED"; /** * @platform Android, iOS * @since 7.1.0 */ EventAvailability[EventAvailability["BUSY"] = 0] = "BUSY"; /** * @platform Android, iOS * @since 7.1.0 */ EventAvailability[EventAvailability["FREE"] = 1] = "FREE"; /** * @platform Android, iOS * @since 7.1.0 */ EventAvailability[EventAvailability["TENTATIVE"] = 2] = "TENTATIVE"; /** * @platform iOS * @since 7.1.0 */ EventAvailability[EventAvailability["UNAVAILABLE"] = 3] = "UNAVAILABLE"; })(exports.EventAvailability || (exports.EventAvailability = {})); /** * @since 7.1.0 */ exports.EventSpan = void 0; (function (EventSpan) { /** * @since 7.1.0 */ EventSpan[EventSpan["THIS_EVENT"] = 0] = "THIS_EVENT"; /** * @since 7.1.0 */ EventSpan[EventSpan["THIS_AND_FUTURE_EVENTS"] = 1] = "THIS_AND_FUTURE_EVENTS"; })(exports.EventSpan || (exports.EventSpan = {})); /** * @platform Android, iOS * @since 7.1.0 */ exports.EventStatus = void 0; (function (EventStatus) { /** * @platform iOS * @since 7.1.0 */ EventStatus["NONE"] = "none"; /** * @platform Android, iOS * @since 7.1.0 */ EventStatus["CONFIRMED"] = "confirmed"; /** * @platform Android, iOS * @since 7.1.0 */ EventStatus["TENTATIVE"] = "tentative"; /** * @platform Android, iOS * @since 7.1.0 */ EventStatus["CANCELED"] = "canceled"; })(exports.EventStatus || (exports.EventStatus = {})); /** * @since 7.1.0 */ exports.RecurrenceFrequency = void 0; (function (RecurrenceFrequency) { /** * @since 7.1.0 */ RecurrenceFrequency[RecurrenceFrequency["DAILY"] = 0] = "DAILY"; /** * @since 7.1.0 */ RecurrenceFrequency[RecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY"; /** * @since 7.1.0 */ RecurrenceFrequency[RecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY"; /** * @since 7.1.0 */ RecurrenceFrequency[RecurrenceFrequency["YEARLY"] = 3] = "YEARLY"; })(exports.RecurrenceFrequency || (exports.RecurrenceFrequency = {})); /** * @deprecated Use `RecurrenceFrequency`. */ exports.ReminderRecurrenceFrequency = void 0; (function (ReminderRecurrenceFrequency) { /** * @deprecated Use `RecurrenceFrequency.DAILY`. */ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY"; /** * @deprecated Use `RecurrenceFrequency.WEEKLY`. */ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY"; /** * @deprecated Use `RecurrenceFrequency.MONTHLY`. */ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY"; /** * @deprecated Use `RecurrenceFrequency.YEARLY`. */ ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY"; })(exports.ReminderRecurrenceFrequency || (exports.ReminderRecurrenceFrequency = {})); const CapacitorCalendar = core.registerPlugin("CapacitorCalendar", { web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorCalendarWeb()), }); class CapacitorCalendarWeb extends core.WebPlugin { checkPermission(_options) { return this.throwUnimplemented(this.checkPermission.name); } checkAllPermissions() { return this.throwUnimplemented(this.checkAllPermissions.name); } requestPermission(_options) { return this.throwUnimplemented(this.requestPermission.name); } requestAllPermissions() { return this.throwUnimplemented(this.requestAllPermissions.name); } requestWriteOnlyCalendarAccess() { return this.throwUnimplemented(this.requestWriteOnlyCalendarAccess.name); } requestReadOnlyCalendarAccess() { return this.throwUnimplemented(this.requestReadOnlyCalendarAccess.name); } requestFullCalendarAccess() { return this.throwUnimplemented(this.requestFullCalendarAccess.name); } requestFullRemindersAccess() { return this.throwUnimplemented(this.requestFullRemindersAccess.name); } createEventWithPrompt(_options) { return this.throwUnimplemented(this.createEventWithPrompt.name); } modifyEventWithPrompt(_options) { return this.throwUnimplemented(this.modifyEventWithPrompt.name); } createEvent(_options) { return this.throwUnimplemented(this.createEvent.name); } commit() { return this.throwUnimplemented(this.commit.name); } modifyEvent(_options) { return this.throwUnimplemented(this.modifyEvent.name); } selectCalendarsWithPrompt(_options) { return this.throwUnimplemented(this.selectCalendarsWithPrompt.name); } fetchAllCalendarSources() { return this.throwUnimplemented(this.fetchAllCalendarSources.name); } listCalendars() { return this.throwUnimplemented(this.listCalendars.name); } fetchAllRemindersSources() { return this.throwUnimplemented(this.fetchAllRemindersSources.name); } getDefaultCalendar() { return this.throwUnimplemented(this.getDefaultCalendar.name); } getDefaultRemindersList() { return this.throwUnimplemented(this.getDefaultRemindersList.name); } openReminders() { return this.throwUnimplemented(this.openReminders.name); } getRemindersLists() { return this.throwUnimplemented(this.getRemindersLists.name); } openCalendar(_options) { return this.throwUnimplemented(this.openCalendar.name); } createCalendar(_options) { return this.throwUnimplemented(this.createCalendar.name); } deleteCalendar(_options) { return this.throwUnimplemented(this.deleteCalendar.name); } createReminder(_options) { return this.throwUnimplemented(this.createReminder.name); } deleteRemindersById(_options) { return this.throwUnimplemented(this.deleteRemindersById.name); } deleteReminder(_options) { return this.throwUnimplemented(this.deleteReminder.name); } modifyReminder(_options) { return this.throwUnimplemented(this.modifyReminder.name); } getReminderById(_options) { return this.throwUnimplemented(this.getReminderById.name); } getRemindersFromLists(_options) { return this.throwUnimplemented(this.getRemindersFromLists.name); } deleteEventsById(_options) { return this.throwUnimplemented(this.deleteEventsById.name); } deleteEvent(_options) { return this.throwUnimplemented(this.deleteEvent.name); } deleteEventWithPrompt(_options) { return this.throwUnimplemented(this.deleteEventWithPrompt.name); } listEventsInRange(_options) { return this.throwUnimplemented(this.listEventsInRange.name); } modifyCalendar(_options) { return this.throwUnimplemented(this.modifyCalendar.name); } deleteReminderWithPrompt(_options) { return this.throwUnimplemented(this.deleteReminderWithPrompt.name); } throwUnimplemented(methodName) { return Promise.reject(this.unimplemented(`${methodName} is not implemented on the web.`)); } } var web = /*#__PURE__*/Object.freeze({ __proto__: null, CapacitorCalendarWeb: CapacitorCalendarWeb }); exports.CapacitorCalendar = CapacitorCalendar; return exports; })({}, capacitorExports); //# sourceMappingURL=plugin.js.map