@ebarooni/capacitor-calendar
Advanced tools
Comparing version 6.5.0 to 6.6.0
@@ -1,11 +0,13 @@ | ||
import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style'; | ||
import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style'; | ||
import { PluginPermission } from './schemas/enums/plugin-permission'; | ||
import type { PermissionState } from '@capacitor/core'; | ||
import type { Calendar } from './schemas/interfaces/calendar'; | ||
import type { RemindersList } from './schemas/interfaces/reminders-list'; | ||
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map'; | ||
import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule'; | ||
import type { CalendarEvent } from './schemas/interfaces/calendar-event'; | ||
import type { Reminder } from './schemas/interfaces/reminder'; | ||
import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style"; | ||
import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style"; | ||
import { PluginPermission } from "./schemas/enums/plugin-permission"; | ||
import { EventSpan } from "./schemas/enums/event-span"; | ||
import type { PermissionState } from "@capacitor/core"; | ||
import type { Calendar } from "./schemas/interfaces/calendar"; | ||
import type { RemindersList } from "./schemas/interfaces/reminders-list"; | ||
import type { PluginPermissionsMap } from "./schemas/interfaces/plugin-permissions-map"; | ||
import type { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule"; | ||
import type { CalendarEvent } from "./schemas/interfaces/calendar-event"; | ||
import type { Reminder } from "./schemas/interfaces/reminder"; | ||
import type { CalendarSource } from "./schemas/interfaces/calendar-source"; | ||
export interface CapacitorCalendarPlugin { | ||
@@ -15,3 +17,3 @@ /** | ||
* | ||
* @method checkPermission | ||
* @async | ||
* @since 0.1.0 | ||
@@ -32,3 +34,3 @@ * @platform iOS, Android | ||
* | ||
* @method checkAllPermissions | ||
* @async | ||
* @since 0.1.0 | ||
@@ -45,3 +47,3 @@ * @platform iOS, Android | ||
* | ||
* @method requestPermission | ||
* @async | ||
* @since 0.1.0 | ||
@@ -62,3 +64,3 @@ * @platform iOS, Android | ||
* | ||
* @method requestAllPermissions | ||
* @async | ||
* @since 0.1.0 | ||
@@ -75,3 +77,3 @@ * @platform iOS, Android | ||
* | ||
* @method createEventWithPrompt | ||
* @async | ||
* @since 0.1.0 | ||
@@ -132,3 +134,3 @@ * @platform iOS, Android | ||
* | ||
* @method selectCalendarsWithPrompt | ||
* @async | ||
* @since 0.2.0 | ||
@@ -162,3 +164,2 @@ * @platform iOS | ||
* @async | ||
* @method listCalendars | ||
* @platform iOS, Android | ||
@@ -177,3 +178,3 @@ * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device. | ||
* | ||
* @method getDefaultCalendar | ||
* @async | ||
* @since 0.3.0 | ||
@@ -199,3 +200,3 @@ * @platform iOS, Android | ||
* | ||
* @method createEvent | ||
* @async | ||
* @since 0.4.0 | ||
@@ -253,3 +254,3 @@ * @platform iOS, Android | ||
* | ||
* @method getDefaultRemindersList | ||
* @async | ||
* @platform iOS | ||
@@ -269,3 +270,2 @@ * @returns {Promise<{ result: RemindersList }>} A promise that resolves with the default reminder list set on the device. | ||
* @async | ||
* @method getRemindersLists | ||
* @platform iOS | ||
@@ -284,3 +284,3 @@ * @returns {Promise<{ result: RemindersList[] }>} A promise that resolves with an array of reminders lists available on the device. | ||
* | ||
* @method createReminder | ||
* @async | ||
* @since 0.5.0 | ||
@@ -348,3 +348,3 @@ * @platform iOS | ||
* | ||
* @method openCalendar | ||
* @async | ||
* @platform iOS, Android | ||
@@ -363,3 +363,3 @@ * @param {object} options - Options for opening the calendar. | ||
* | ||
* @method openReminders | ||
* @async | ||
* @platform iOS | ||
@@ -374,3 +374,3 @@ * @returns {Promise<void>} | ||
* | ||
* @method listEventsInRange | ||
* @async | ||
* @since 0.10.0 | ||
@@ -403,3 +403,3 @@ * @platform iOS, Android | ||
* | ||
* @method deleteEventsById | ||
* @async | ||
* @since 0.11.0 | ||
@@ -436,3 +436,3 @@ * @platform iOS, Android | ||
* | ||
* @method createCalendar | ||
* @async | ||
* @since 5.2.0 | ||
@@ -449,2 +449,6 @@ * @platform iOS | ||
* The color should be a HEX string. (Optional) | ||
* @param {string} options.sourceId The id of the source of the calendar. | ||
* If not provided, the source of the default calendar will be used. It is | ||
* recommended to use fetchAllCalendarSources method to fetch the id of the | ||
* desired source type. | ||
* @returns {Promise<{ result: string }>} The id of the created calendar. | ||
@@ -455,2 +459,3 @@ * @example | ||
* color: '#1d00fc', | ||
* sourceId: 'local-source-id', | ||
* }); | ||
@@ -462,2 +467,3 @@ * console.log(result); // 'CALENDAR_ID' | ||
color?: string; | ||
sourceId?: string; | ||
}): Promise<{ | ||
@@ -469,3 +475,3 @@ result: string; | ||
* | ||
* @method deleteCalendar | ||
* @async | ||
* @since 5.2.0 | ||
@@ -489,3 +495,3 @@ * @platform iOS | ||
* | ||
* @method getRemindersFromLists | ||
* @async | ||
* @since 5.3.0 | ||
@@ -516,3 +522,3 @@ * @platform iOS | ||
* | ||
* @method deleteRemindersById | ||
* @async | ||
* @since 5.3.0 | ||
@@ -548,3 +554,3 @@ * @platform iOS | ||
* | ||
* @method requestWriteOnlyCalendarAccess | ||
* @async | ||
* @since 5.4.0 | ||
@@ -562,3 +568,3 @@ * @platform iOS, Android | ||
* | ||
* @method requestReadOnlyCalendarAccess | ||
* @async | ||
* @since 5.4.0 | ||
@@ -576,3 +582,3 @@ * @platform Android | ||
* | ||
* @method requestFullCalendarAccess | ||
* @async | ||
* @since 5.4.0 | ||
@@ -590,3 +596,3 @@ * @platform iOS, Android | ||
* | ||
* @method requestFullRemindersAccess | ||
* @async | ||
* @since 5.4.0 | ||
@@ -601,2 +607,126 @@ * @platform iOS | ||
}>; | ||
/** | ||
* Opens a native prompt to modify an event given its id. | ||
* | ||
* @async | ||
* @since 5.6.0 | ||
* @platform iOS, Android | ||
* @permissions | ||
* <h3>Runtime Permissions:</h3> | ||
* <ul> | ||
* <li><strong>iOS:</strong> writeCalendar, readCalendar</li> | ||
* <li><strong>Android:</strong> writeCalendar, readCalendar</li> | ||
* </ul> | ||
* @param {Object} options The options for modifying an event. | ||
* @param {string} options.id The id of the event to be modified. | ||
* @param {object} options.update The set of event properties to be modified. (Optional) | ||
* If a property is not supported, it will be ignored. Setting alerts with prompt | ||
* is only supported on iOS. | ||
* @returns {Promise<{ result: string[] }>} On iOS, the promise resolves with an array containing | ||
* the initial event id if the modifications were saved and empty if it was cancelled. However, on | ||
* Android the array will be empty either way. | ||
* @throws {Error} throws an error if an event for the given id is not found. | ||
* @example | ||
* const { result } = await CapacitorCalendar.modifyEventWithPrompt({ | ||
* id: 'EVENT_ID_ONE', | ||
* update: { | ||
* title: 'newTitle', | ||
* startDate: Date.now(), | ||
* }, | ||
* }); | ||
* | ||
* console.log(result); // ['EVENT_ID_ONE'] or [] if on Android | ||
*/ | ||
modifyEventWithPrompt(options: { | ||
id: string; | ||
update?: { | ||
title?: string; | ||
calendarId?: string; | ||
location?: string; | ||
startDate?: number; | ||
endDate?: number; | ||
isAllDay?: boolean; | ||
alertOffsetInMinutes?: number | number[]; | ||
url?: string; | ||
notes?: string; | ||
}; | ||
}): Promise<{ | ||
result: string[]; | ||
}>; | ||
/** | ||
* Modifies an event given its id and update details. | ||
* | ||
* @async | ||
* @since 5.6.0 | ||
* @platform iOS, Android | ||
* @permissions | ||
* <h3>Runtime Permissions:</h3> | ||
* <ul> | ||
* <li><strong>iOS:</strong> writeCalendar, readCalendar</li> | ||
* <li><strong>Android:</strong> writeCalendar, readCalendar</li> | ||
* </ul> | ||
* @param {Object} options The options for updating an event. | ||
* @param {string} options.id The id of the event to be modified. | ||
* @param {EventSpan} options.span The scope of the modifications. | ||
* Only supported on iOS. (Optional) | ||
* @param {Object} options.update The set of event properties to be modified. | ||
* If a property is not supported, it will be ignored. Modifying the reminder of an | ||
* event is currently not supported on Android. | ||
* @returns {Promise<void>} A promise that resolves when the update operation is complete. | ||
* @throws {Error} throws an error if an event for the given id is not found. | ||
* @example | ||
* const { result } = await CapacitorCalendar.modifyEvent({ | ||
* id: 'EVENT_ID_ONE', | ||
* span: EventSpan.THIS_SPAN, | ||
* update: { | ||
* title: 'newTitle', | ||
* startDate: Date.now(), | ||
* }, | ||
* }); | ||
*/ | ||
modifyEvent(options: { | ||
id: string; | ||
span?: EventSpan; | ||
update: { | ||
title?: string; | ||
calendarId?: string; | ||
location?: string; | ||
startDate?: number; | ||
endDate?: number; | ||
isAllDay?: boolean; | ||
alertOffsetInMinutes?: number | number[]; | ||
url?: string; | ||
notes?: string; | ||
}; | ||
}): Promise<void>; | ||
/** | ||
* Retrieves a list of calendar sources. | ||
* | ||
* @async | ||
* @since 6.6.0 | ||
* @platform iOS | ||
* @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of | ||
* calendar sources. | ||
* @example | ||
* const { result } = await fetchAllCalendarSources(); | ||
* console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }] | ||
*/ | ||
fetchAllCalendarSources(): Promise<{ | ||
result: CalendarSource[]; | ||
}>; | ||
/** | ||
* Retrieves a list of reminders sources. | ||
* | ||
* @async | ||
* @since 6.6.0 | ||
* @platform iOS | ||
* @returns {Promise<{ result: CalendarSource[] }>} A promise that resolves with an array of | ||
* reminders sources. | ||
* @example | ||
* const { result } = await fetchAllRemindersSources(); | ||
* console.log(result); // [{ id: '1', type: '0', title: 'calDav' }, { id: '2', type: '2', title: '3' }] | ||
*/ | ||
fetchAllRemindersSources(): Promise<{ | ||
result: CalendarSource[]; | ||
}>; | ||
} |
@@ -1,15 +0,19 @@ | ||
import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style'; | ||
import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style'; | ||
import { PluginPermission } from './schemas/enums/plugin-permission'; | ||
import { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency'; | ||
import type { CapacitorCalendarPlugin } from './definitions'; | ||
import type { Calendar } from './schemas/interfaces/calendar'; | ||
import type { RemindersList } from './schemas/interfaces/reminders-list'; | ||
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map'; | ||
import type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule'; | ||
import type { CalendarEvent } from './schemas/interfaces/calendar-event'; | ||
import type { Reminder } from './schemas/interfaces/reminder'; | ||
import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style"; | ||
import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style"; | ||
import { PluginPermission } from "./schemas/enums/plugin-permission"; | ||
import { ReminderRecurrenceFrequency } from "./schemas/enums/reminder-recurrence-frequency"; | ||
import { EventSpan } from "./schemas/enums/event-span"; | ||
import { CalendarSourceType } from "./schemas/enums/calendar-source-type"; | ||
import { CalendarType } from "./schemas/enums/calendar-type"; | ||
import type { CapacitorCalendarPlugin } from "./definitions"; | ||
import type { Calendar } from "./schemas/interfaces/calendar"; | ||
import type { RemindersList } from "./schemas/interfaces/reminders-list"; | ||
import type { PluginPermissionsMap } from "./schemas/interfaces/plugin-permissions-map"; | ||
import type { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule"; | ||
import type { CalendarEvent } from "./schemas/interfaces/calendar-event"; | ||
import type { Reminder } from "./schemas/interfaces/reminder"; | ||
import type { CalendarSource } from "./schemas/interfaces/calendar-source"; | ||
declare const CapacitorCalendar: CapacitorCalendarPlugin; | ||
export * from './definitions'; | ||
export type { Calendar, RemindersList, ReminderRecurrenceRule }; | ||
export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CalendarEvent, Reminder, CapacitorCalendar, }; | ||
export * from "./definitions"; | ||
export type { Calendar, RemindersList, ReminderRecurrenceRule, CalendarSource }; | ||
export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, PluginPermissionsMap, ReminderRecurrenceFrequency, CalendarEvent, Reminder, EventSpan, CalendarSourceType, CalendarType, CapacitorCalendar, }; |
@@ -1,11 +0,14 @@ | ||
import { registerPlugin } from '@capacitor/core'; | ||
import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style'; | ||
import { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style'; | ||
import { PluginPermission } from './schemas/enums/plugin-permission'; | ||
import { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency'; | ||
const CapacitorCalendar = registerPlugin('CapacitorCalendar', { | ||
web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()), | ||
import { registerPlugin } from "@capacitor/core"; | ||
import { CalendarChooserDisplayStyle } from "./schemas/enums/calendar-chooser-display-style"; | ||
import { CalendarChooserSelectionStyle } from "./schemas/enums/calendar-chooser-selection-style"; | ||
import { PluginPermission } from "./schemas/enums/plugin-permission"; | ||
import { ReminderRecurrenceFrequency } from "./schemas/enums/reminder-recurrence-frequency"; | ||
import { EventSpan } from "./schemas/enums/event-span"; | ||
import { CalendarSourceType } from "./schemas/enums/calendar-source-type"; | ||
import { CalendarType } from "./schemas/enums/calendar-type"; | ||
const CapacitorCalendar = registerPlugin("CapacitorCalendar", { | ||
web: () => import("./web").then((m) => new m.CapacitorCalendarWeb()), | ||
}); | ||
export * from './definitions'; | ||
export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, }; | ||
export * from "./definitions"; | ||
export { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, EventSpan, CalendarSourceType, CalendarType, CapacitorCalendar, }; | ||
//# sourceMappingURL=index.js.map |
@@ -18,2 +18,3 @@ /** | ||
* @property {string} calendarId The calendar that the event belongs to. (Optional) | ||
* @property {string} url The URL of the event. (Optional) | ||
*/ | ||
@@ -34,3 +35,3 @@ export interface CalendarEvent { | ||
/** | ||
* @platform Android | ||
* @platform iOS, Android | ||
*/ | ||
@@ -57,7 +58,13 @@ eventColor?: string; | ||
*/ | ||
eventTimezone?: string; | ||
eventTimezone?: { | ||
region: string; | ||
abbreviation: string; | ||
}; | ||
/** | ||
* @platform iOS, Android | ||
*/ | ||
eventEndTimezone?: string; | ||
eventEndTimezone?: { | ||
region: string; | ||
abbreviation: string; | ||
}; | ||
/** | ||
@@ -75,2 +82,6 @@ * @platform Android | ||
calendarId: string; | ||
/** | ||
* @platform iOS | ||
*/ | ||
url: string; | ||
} |
@@ -0,1 +1,3 @@ | ||
import { CalendarSource } from "./calendar-source"; | ||
import { CalendarType } from "../enums/calendar-type"; | ||
/** | ||
@@ -6,8 +8,47 @@ * Represents a calendar object. | ||
* @platform iOS, Android | ||
* @property {string} id - The unique identifier of the calendar. | ||
* @property {string} title - The title or name of the calendar. | ||
* @property {string} id The unique identifier of the calendar. | ||
* @property {string} title The title or name of the calendar. | ||
* @property {string} color The color of the calendar. | ||
* @property {boolean} isImmutable Indicating whether the calendar's properties | ||
* can be modified. | ||
* @property {boolean} allowsContentModifications Indicating whether the calendar's | ||
* items (events or reminders) can be modified. | ||
* @property {CalendarType} type The type of the calendar. On iOS the type is of type | ||
* CalendarSourceType. | ||
* @property {boolean} isSubscribed Indicating whether the calendar is a subscribed calendar. | ||
* @property {CalendarSource} source The source of the calendar. | ||
*/ | ||
export interface Calendar { | ||
/** | ||
* @platform iOS, Android | ||
*/ | ||
id: string; | ||
/** | ||
* @platform iOS, Android | ||
*/ | ||
title: string; | ||
/** | ||
* @platform iOS, Android | ||
*/ | ||
color: string; | ||
/** | ||
* @platform iOS | ||
*/ | ||
isImmutable?: boolean; | ||
/** | ||
* @platform iOS | ||
*/ | ||
allowsContentModifications?: boolean; | ||
/** | ||
* @platform iOS, Android | ||
*/ | ||
type?: CalendarType; | ||
/** | ||
* @platform iOS | ||
*/ | ||
isSubscribed?: boolean; | ||
/** | ||
* @platform iOS | ||
*/ | ||
source?: CalendarSource; | ||
} |
@@ -1,10 +0,12 @@ | ||
import { PermissionState, WebPlugin } from '@capacitor/core'; | ||
import { CapacitorCalendarPlugin } from './definitions'; | ||
import { PluginPermission } from './schemas/enums/plugin-permission'; | ||
import { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule'; | ||
import type { Calendar } from './schemas/interfaces/calendar'; | ||
import type { RemindersList } from './schemas/interfaces/reminders-list'; | ||
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map'; | ||
import type { CalendarEvent } from './schemas/interfaces/calendar-event'; | ||
import type { Reminder } from './schemas/interfaces/reminder'; | ||
import { PermissionState, WebPlugin } from "@capacitor/core"; | ||
import { CapacitorCalendarPlugin } from "./definitions"; | ||
import { PluginPermission } from "./schemas/enums/plugin-permission"; | ||
import { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule"; | ||
import { EventSpan } from "./schemas/enums/event-span"; | ||
import type { Calendar } from "./schemas/interfaces/calendar"; | ||
import type { RemindersList } from "./schemas/interfaces/reminders-list"; | ||
import type { PluginPermissionsMap } from "./schemas/interfaces/plugin-permissions-map"; | ||
import type { CalendarEvent } from "./schemas/interfaces/calendar-event"; | ||
import type { Reminder } from "./schemas/interfaces/reminder"; | ||
import type { CalendarSource } from "./schemas/interfaces/calendar-source"; | ||
export declare class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin { | ||
@@ -100,2 +102,3 @@ checkPermission(_options: { | ||
color?: string; | ||
sourceId?: string; | ||
}): Promise<{ | ||
@@ -132,2 +135,39 @@ result: string; | ||
}>; | ||
modifyEventWithPrompt(_options: { | ||
id: string; | ||
update?: { | ||
title?: string; | ||
calendarId?: string; | ||
location?: string; | ||
startDate?: number; | ||
endDate?: number; | ||
isAllDay?: boolean; | ||
alertOffsetInMinutes?: number | number[]; | ||
url?: string; | ||
notes?: string; | ||
}; | ||
}): Promise<{ | ||
result: string[]; | ||
}>; | ||
modifyEvent(_options: { | ||
id: string; | ||
span?: EventSpan; | ||
update: { | ||
title?: string; | ||
calendarId?: string; | ||
location?: string; | ||
startDate?: number; | ||
endDate?: number; | ||
isAllDay?: boolean; | ||
alertOffsetInMinutes?: number | number[]; | ||
url?: string; | ||
notes?: string; | ||
}; | ||
}): Promise<void>; | ||
fetchAllCalendarSources(): Promise<{ | ||
result: CalendarSource[]; | ||
}>; | ||
fetchAllRemindersSources(): Promise<{ | ||
result: CalendarSource[]; | ||
}>; | ||
} |
@@ -1,3 +0,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { WebPlugin } from '@capacitor/core'; | ||
import { WebPlugin } from "@capacitor/core"; | ||
export class CapacitorCalendarWeb extends WebPlugin { | ||
@@ -76,3 +75,15 @@ checkPermission(_options) { | ||
} | ||
modifyEventWithPrompt(_options) { | ||
throw this.unimplemented(`${this.modifyEventWithPrompt.name} is not implemented on the web`); | ||
} | ||
modifyEvent(_options) { | ||
throw this.unimplemented(`${this.modifyEvent.name} is not implemented on the web`); | ||
} | ||
fetchAllCalendarSources() { | ||
throw this.unimplemented(`${this.fetchAllCalendarSources.name} is not implemented on the web`); | ||
} | ||
fetchAllRemindersSources() { | ||
throw this.unimplemented(`${this.fetchAllRemindersSources.name} is not implemented on the web`); | ||
} | ||
} | ||
//# sourceMappingURL=web.js.map |
@@ -127,7 +127,94 @@ 'use strict'; | ||
const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', { | ||
/** | ||
* Enum representing the span of modifications. | ||
* | ||
* @enum EventSpan | ||
* @platform iOS | ||
*/ | ||
exports.EventSpan = void 0; | ||
(function (EventSpan) { | ||
/** | ||
* The modifications should only be applied to this event. | ||
*/ | ||
EventSpan[EventSpan["THIS_EVENT"] = 0] = "THIS_EVENT"; | ||
/** | ||
* The modifications to this event should also be applied to the future instances of this event. | ||
*/ | ||
EventSpan[EventSpan["THIS_AND_FUTURE_EVENTS"] = 1] = "THIS_AND_FUTURE_EVENTS"; | ||
})(exports.EventSpan || (exports.EventSpan = {})); | ||
/** | ||
* Represents the different types of sources from which calendars can originate. | ||
* | ||
* @enum CalendarSourceType | ||
* @platform iOS | ||
*/ | ||
exports.CalendarSourceType = void 0; | ||
(function (CalendarSourceType) { | ||
/** | ||
* Calendars that are stored locally on the device. These calendars are not | ||
* synced with any external service. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["LOCAL"] = 0] = "LOCAL"; | ||
/** | ||
* Calendars that are associated with an Exchange server. Exchange is a | ||
* popular calendar and email service used by many enterprises. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["EXCHANGE"] = 1] = "EXCHANGE"; | ||
/** | ||
* Calendars that use the CalDAV protocol for synchronization. | ||
* This includes calendars from services like Google Calendar and Yahoo Calendar. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["CAL_DAV"] = 2] = "CAL_DAV"; | ||
/** | ||
* Calendars that were previously associated with MobileMe, Apple's cloud | ||
* service before iCloud. This source type is largely obsolete now. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["MOBILE_ME"] = 3] = "MOBILE_ME"; | ||
/** | ||
* Calendars that the user has subscribed to. These are read-only calendars | ||
* that can be added by subscribing to a calendar URL. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["SUBSCRIBED"] = 4] = "SUBSCRIBED"; | ||
/** | ||
* The built-in Birthdays calendar, which shows birthdays of contacts from the user's address book. | ||
* This calendar is typically read-only and is managed by the system. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["BIRTHDAYS"] = 5] = "BIRTHDAYS"; | ||
})(exports.CalendarSourceType || (exports.CalendarSourceType = {})); | ||
/** | ||
* An enum representing the type of calendar. | ||
* | ||
* @enum CalendarType | ||
* @platform iOS | ||
*/ | ||
exports.CalendarType = void 0; | ||
(function (CalendarType) { | ||
/** | ||
* This calendar is sync'd from either Mobile Me or tethered. | ||
*/ | ||
CalendarType[CalendarType["LOCAL"] = 0] = "LOCAL"; | ||
/** | ||
* This calendar is from a CalDAV server. | ||
*/ | ||
CalendarType[CalendarType["CAL_DAV"] = 1] = "CAL_DAV"; | ||
/** | ||
* This calendar comes from an Exchange server. | ||
*/ | ||
CalendarType[CalendarType["EXCHANGE"] = 2] = "EXCHANGE"; | ||
/** | ||
* This is a locally subscribed calendar. | ||
*/ | ||
CalendarType[CalendarType["SUBSCRIPTION"] = 3] = "SUBSCRIPTION"; | ||
/** | ||
* This is the built-in birthday calendar. | ||
*/ | ||
CalendarType[CalendarType["BIRTHDAY"] = 4] = "BIRTHDAY"; | ||
})(exports.CalendarType || (exports.CalendarType = {})); | ||
const CapacitorCalendar = core.registerPlugin("CapacitorCalendar", { | ||
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorCalendarWeb()), | ||
}); | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
class CapacitorCalendarWeb extends core.WebPlugin { | ||
@@ -206,2 +293,14 @@ checkPermission(_options) { | ||
} | ||
modifyEventWithPrompt(_options) { | ||
throw this.unimplemented(`${this.modifyEventWithPrompt.name} is not implemented on the web`); | ||
} | ||
modifyEvent(_options) { | ||
throw this.unimplemented(`${this.modifyEvent.name} is not implemented on the web`); | ||
} | ||
fetchAllCalendarSources() { | ||
throw this.unimplemented(`${this.fetchAllCalendarSources.name} is not implemented on the web`); | ||
} | ||
fetchAllRemindersSources() { | ||
throw this.unimplemented(`${this.fetchAllRemindersSources.name} is not implemented on the web`); | ||
} | ||
} | ||
@@ -208,0 +307,0 @@ |
@@ -126,7 +126,94 @@ var capacitorCapacitorCalendar = (function (exports, core) { | ||
const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', { | ||
/** | ||
* Enum representing the span of modifications. | ||
* | ||
* @enum EventSpan | ||
* @platform iOS | ||
*/ | ||
exports.EventSpan = void 0; | ||
(function (EventSpan) { | ||
/** | ||
* The modifications should only be applied to this event. | ||
*/ | ||
EventSpan[EventSpan["THIS_EVENT"] = 0] = "THIS_EVENT"; | ||
/** | ||
* The modifications to this event should also be applied to the future instances of this event. | ||
*/ | ||
EventSpan[EventSpan["THIS_AND_FUTURE_EVENTS"] = 1] = "THIS_AND_FUTURE_EVENTS"; | ||
})(exports.EventSpan || (exports.EventSpan = {})); | ||
/** | ||
* Represents the different types of sources from which calendars can originate. | ||
* | ||
* @enum CalendarSourceType | ||
* @platform iOS | ||
*/ | ||
exports.CalendarSourceType = void 0; | ||
(function (CalendarSourceType) { | ||
/** | ||
* Calendars that are stored locally on the device. These calendars are not | ||
* synced with any external service. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["LOCAL"] = 0] = "LOCAL"; | ||
/** | ||
* Calendars that are associated with an Exchange server. Exchange is a | ||
* popular calendar and email service used by many enterprises. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["EXCHANGE"] = 1] = "EXCHANGE"; | ||
/** | ||
* Calendars that use the CalDAV protocol for synchronization. | ||
* This includes calendars from services like Google Calendar and Yahoo Calendar. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["CAL_DAV"] = 2] = "CAL_DAV"; | ||
/** | ||
* Calendars that were previously associated with MobileMe, Apple's cloud | ||
* service before iCloud. This source type is largely obsolete now. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["MOBILE_ME"] = 3] = "MOBILE_ME"; | ||
/** | ||
* Calendars that the user has subscribed to. These are read-only calendars | ||
* that can be added by subscribing to a calendar URL. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["SUBSCRIBED"] = 4] = "SUBSCRIBED"; | ||
/** | ||
* The built-in Birthdays calendar, which shows birthdays of contacts from the user's address book. | ||
* This calendar is typically read-only and is managed by the system. | ||
*/ | ||
CalendarSourceType[CalendarSourceType["BIRTHDAYS"] = 5] = "BIRTHDAYS"; | ||
})(exports.CalendarSourceType || (exports.CalendarSourceType = {})); | ||
/** | ||
* An enum representing the type of calendar. | ||
* | ||
* @enum CalendarType | ||
* @platform iOS | ||
*/ | ||
exports.CalendarType = void 0; | ||
(function (CalendarType) { | ||
/** | ||
* This calendar is sync'd from either Mobile Me or tethered. | ||
*/ | ||
CalendarType[CalendarType["LOCAL"] = 0] = "LOCAL"; | ||
/** | ||
* This calendar is from a CalDAV server. | ||
*/ | ||
CalendarType[CalendarType["CAL_DAV"] = 1] = "CAL_DAV"; | ||
/** | ||
* This calendar comes from an Exchange server. | ||
*/ | ||
CalendarType[CalendarType["EXCHANGE"] = 2] = "EXCHANGE"; | ||
/** | ||
* This is a locally subscribed calendar. | ||
*/ | ||
CalendarType[CalendarType["SUBSCRIPTION"] = 3] = "SUBSCRIPTION"; | ||
/** | ||
* This is the built-in birthday calendar. | ||
*/ | ||
CalendarType[CalendarType["BIRTHDAY"] = 4] = "BIRTHDAY"; | ||
})(exports.CalendarType || (exports.CalendarType = {})); | ||
const CapacitorCalendar = core.registerPlugin("CapacitorCalendar", { | ||
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorCalendarWeb()), | ||
}); | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
class CapacitorCalendarWeb extends core.WebPlugin { | ||
@@ -205,2 +292,14 @@ checkPermission(_options) { | ||
} | ||
modifyEventWithPrompt(_options) { | ||
throw this.unimplemented(`${this.modifyEventWithPrompt.name} is not implemented on the web`); | ||
} | ||
modifyEvent(_options) { | ||
throw this.unimplemented(`${this.modifyEvent.name} is not implemented on the web`); | ||
} | ||
fetchAllCalendarSources() { | ||
throw this.unimplemented(`${this.fetchAllCalendarSources.name} is not implemented on the web`); | ||
} | ||
fetchAllRemindersSources() { | ||
throw this.unimplemented(`${this.fetchAllRemindersSources.name} is not implemented on the web`); | ||
} | ||
} | ||
@@ -207,0 +306,0 @@ |
{ | ||
"name": "@ebarooni/capacitor-calendar", | ||
"version": "6.5.0", | ||
"version": "6.6.0", | ||
"description": "The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.", | ||
@@ -14,3 +14,5 @@ "main": "dist/plugin.cjs.js", | ||
"ios/Plugin/", | ||
"EbarooniCapacitorCalendar.podspec" | ||
"EbarooniCapacitorCalendar.podspec", | ||
"LICENSE.txt", | ||
"assets/images/text-logo.png" | ||
], | ||
@@ -46,12 +48,12 @@ "author": "Ehsan Barooni", | ||
"verify:web": "npm run build", | ||
"prettier:check": "npx prettier . --check", | ||
"prettier:fix": "npx prettier . --write", | ||
"swiftlint": "node-swiftlint", | ||
"ktlint": "ktlint 'android/src/main/java/**'", | ||
"lint:ts": "npx eslint . --ext .ts", | ||
"lint:html": "npx eslint . --ext .html", | ||
"lint:ts-html": "npx eslint", | ||
"lint:css": "npx stylelint \"**/*.(css|scss)\"", | ||
"lint:swift": "npm run swiftlint -- lint", | ||
"lint:kt": "npm run ktlint", | ||
"lint": "npm run lint:ts && npm run lint:html && npm run lint:css && npm run lint:swift && npm run lint:kt", | ||
"fmt:ts": "npx eslint . --ext .ts --fix", | ||
"fmt:html": "npx eslint . --ext .html --fix", | ||
"lint": "npm run lint:ts-html && npm run lint:css && npm run lint:swift && npm run lint:kt", | ||
"fmt:ts-html": "npx eslint --fix", | ||
"fmt:css": "npx stylelint \"**/*.(css|scss)\" --fix", | ||
@@ -61,3 +63,3 @@ "fmt:swift": "npm run swiftlint -- --fix --format", | ||
"fmt:kt": "npm run ktlint -- -F", | ||
"fmt": "npm run fmt:ts && npm run fmt:html && npm run fmt:css && npm run fmt:swift && npm run fmt:md && npm run fmt:kt", | ||
"fmt": "npm run fmt:ts-html && npm run fmt:css && npm run fmt:swift && npm run fmt:md && npm run fmt:kt", | ||
"docgen:api": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json", | ||
@@ -67,8 +69,6 @@ "docgen:readme": "docgen --api CapacitorCalendarPlugin --output-readme README.md", | ||
"build": "npm run clean && npm run docgen:api && npm run docgen:readme && tsc && rollup -c rollup.config.mjs", | ||
"prepublishOnly": "npm run build" | ||
"prepublishOnly": "npm run build", | ||
"serve": "cd example && npx ng serve" | ||
}, | ||
"devDependencies": { | ||
"@angular-eslint/eslint-plugin": "^17.3.0", | ||
"@angular-eslint/eslint-plugin-template": "^17.3.0", | ||
"@angular-eslint/template-parser": "^17.3.0", | ||
"@angular/cli": "^17.1.2", | ||
@@ -80,12 +80,21 @@ "@capacitor/android": "^6.0.0", | ||
"@capacitor/ios": "^6.0.0", | ||
"@typescript-eslint/eslint-plugin": "^7.3.0", | ||
"@typescript-eslint/parser": "^7.3.0", | ||
"eslint": "^8.57.0", | ||
"@ebarooni/eslint-config": "^1.0.0", | ||
"@ebarooni/prettier-config": "^1.1.0", | ||
"@ebarooni/stylelint-config": "^1.1.0", | ||
"@ebarooni/swiftlint-config": "^1.1.0", | ||
"@eslint/js": "^9.4.0", | ||
"@types/eslint__js": "^8.42.3", | ||
"angular-eslint": "^18.0.1", | ||
"eslint": "^9.4.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"prettier": "~3.2.5", | ||
"postcss": "^8.4.38", | ||
"prettier": "^3.3.2", | ||
"rollup": "^4.17.0", | ||
"stylelint": "^16.6.1", | ||
"stylelint-config-standard-scss": "^13.1.0", | ||
"stylelint-prettier": "^5.0.0", | ||
"swiftlint": "^1.0.1", | ||
"typescript": "~5.4.2" | ||
"swiftlint": "^1.0.2", | ||
"typescript": "~5.4.2", | ||
"typescript-eslint": "^8.0.0-alpha.20" | ||
}, | ||
@@ -103,2 +112,3 @@ "peerDependencies": { | ||
}, | ||
"prettier": "@ebarooni/prettier-config", | ||
"publishConfig": { | ||
@@ -105,0 +115,0 @@ "access": "public" |
@@ -30,3 +30,9 @@ <p align="center"> | ||
- [Install](#install) | ||
- [Installation](#installation) | ||
- [Stable](#stable) | ||
- [Capacitor 6](#capacitor-6) | ||
- [Capacitor 5](#capacitor-5) | ||
- [Development](#development) | ||
- [Setup](#setup) | ||
- [Install](#install-1) | ||
- [Demo](#demo--click-for-details-) | ||
@@ -38,6 +44,14 @@ - [Permissions](#permissions) | ||
## Install | ||
## Installation | ||
### Capacitor 6 | ||
To use this package, follow the instructions for installing either the stable or development release. | ||
Stable releases are recommended for production, while development releases provide access to the latest features and | ||
fixes which are still under development. | ||
### Stable | ||
The stable releases are published to the npm package registry. | ||
#### Capacitor 6 | ||
```bash | ||
@@ -48,4 +62,7 @@ npm install @ebarooni/capacitor-calendar@latest | ||
### Capacitor 5 | ||
#### Capacitor 5 | ||
> [!IMPORTANT] | ||
> This plugin no longer receives updates for Capacitor v5 and only supports the latest version. | ||
```bash | ||
@@ -56,2 +73,29 @@ npm install @ebarooni/capacitor-calendar@^5 | ||
### Development | ||
Development releases are published to the GitHub package registry. These releases are automatically generated from the | ||
latest state of the `develop branch every time a pull request is merged into it. | ||
> [!WARNING] | ||
> Development releases are not recommended for production use as they may contain untested or experimental changes. | ||
#### Setup | ||
Create an `.npmrc` file and place it in the root of your project with the following content: | ||
``` | ||
//npm.pkg.github.com/:_authToken=$GITHUB_PAT | ||
@ebarooni:registry=https://npm.pkg.github.com | ||
always-auth=true | ||
``` | ||
Replace `$GITHUB_PAT` with your own personal access token with at least `read:packages` scope. | ||
#### Install | ||
```bash | ||
npm install @ebarooni/capacitor-calendar | ||
npx cap sync | ||
``` | ||
## [Demo (click for details)](./example/README.md) | ||
@@ -104,2 +148,6 @@ | ||
* [`requestFullRemindersAccess()`](#requestfullremindersaccess) | ||
* [`modifyEventWithPrompt(...)`](#modifyeventwithprompt) | ||
* [`modifyEvent(...)`](#modifyevent) | ||
* [`fetchAllCalendarSources()`](#fetchallcalendarsources) | ||
* [`fetchAllRemindersSources()`](#fetchallreminderssources) | ||
* [Interfaces](#interfaces) | ||
@@ -120,3 +168,3 @@ * [Type Aliases](#type-aliases) | ||
> [!WARNING] | ||
> [!NOTE] | ||
> Thank you for your interest in contributing to the project! At the moment, the focus is on reaching the first major | ||
@@ -123,0 +171,0 @@ > release. Until then, the contributions will not be accepted. This approach allows to set a solid |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1188875
79
4292
172
25