@ebarooni/capacitor-calendar
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -155,3 +155,4 @@ { | ||
{ | ||
"name": "method" | ||
"name": "method", | ||
"text": "createEventWithPrompt" | ||
}, | ||
@@ -179,6 +180,2 @@ { | ||
{ | ||
"name": "throws", | ||
"text": "Error If prompt gets cancelled." | ||
}, | ||
{ | ||
"name": "example", | ||
@@ -209,2 +206,6 @@ "text": "if (capacitor.getPlatform() === 'android') {\n await this.requestPermission({ alias: 'readCalendar' });\n { result } = result = await this.createEventWithPrompt({\n title: 'Title',\n alertOffsetInMinutes: 5,\n });\n} else {\n { result } = result = await this.createEventWithPrompt({\n title: 'Title',\n alertOffsetInMinutes: 5,\n });\n}" | ||
{ | ||
"name": "since", | ||
"text": "0.2.0" | ||
}, | ||
{ | ||
"name": "platform", | ||
@@ -214,2 +215,6 @@ "text": "iOS" | ||
{ | ||
"name": "permissions", | ||
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> writeCalendar</li>\n</ul>" | ||
}, | ||
{ | ||
"name": "param", | ||
@@ -219,5 +224,2 @@ "text": "options - Options for customizing the display and selection styles of the calendar chooser." | ||
{ | ||
"name": "async" | ||
}, | ||
{ | ||
"name": "returns", | ||
@@ -602,2 +604,88 @@ "text": "A promise that resolves with an array of selected calendars,\nwhere each calendar object contains an ID and a title." | ||
"slug": "deleteeventsbyid" | ||
}, | ||
{ | ||
"name": "createCalendar", | ||
"signature": "(options: { title: string; color?: string; }) => Promise<{ result: string; }>", | ||
"parameters": [ | ||
{ | ||
"name": "options", | ||
"docs": "Options for creating a calendar.", | ||
"type": "{ title: string; color?: string | undefined; }" | ||
} | ||
], | ||
"returns": "Promise<{ result: string; }>", | ||
"tags": [ | ||
{ | ||
"name": "method", | ||
"text": "createCalendar" | ||
}, | ||
{ | ||
"name": "since", | ||
"text": "5.2.0" | ||
}, | ||
{ | ||
"name": "platform", | ||
"text": "iOS" | ||
}, | ||
{ | ||
"name": "permissions", | ||
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n</ul>" | ||
}, | ||
{ | ||
"name": "param", | ||
"text": "options Options for creating a calendar." | ||
}, | ||
{ | ||
"name": "returns", | ||
"text": "The id of the created calendar." | ||
}, | ||
{ | ||
"name": "example", | ||
"text": "{ result } = await CapacitorCalendar.createCalendar({\n title: 'New Calendar',\n color: '#1d00fc',\n });\n console.log(result); // 'CALENDAR_ID'" | ||
} | ||
], | ||
"docs": "Creates a calendar", | ||
"complexTypes": [], | ||
"slug": "createcalendar" | ||
}, | ||
{ | ||
"name": "deleteCalendar", | ||
"signature": "(options: { id: string; }) => Promise<void>", | ||
"parameters": [ | ||
{ | ||
"name": "options", | ||
"docs": "Options for deleting a calendar.", | ||
"type": "{ id: string; }" | ||
} | ||
], | ||
"returns": "Promise<void>", | ||
"tags": [ | ||
{ | ||
"name": "method", | ||
"text": "deleteCalendar" | ||
}, | ||
{ | ||
"name": "since", | ||
"text": "5.2.0" | ||
}, | ||
{ | ||
"name": "platform", | ||
"text": "iOS" | ||
}, | ||
{ | ||
"name": "permissions", | ||
"text": "<h3>Runtime Permissions:</h3>\n<ul>\n <li><strong>iOS:</strong> readCalendar, writeCalendar</li>\n</ul>" | ||
}, | ||
{ | ||
"name": "param", | ||
"text": "options Options for deleting a calendar." | ||
}, | ||
{ | ||
"name": "example", | ||
"text": "await CapacitorCalendar.deleteCalendar({ id: 'ID_1' });" | ||
} | ||
], | ||
"docs": "Deletes a calendar by id", | ||
"complexTypes": [], | ||
"slug": "deletecalendar" | ||
} | ||
@@ -604,0 +692,0 @@ ], |
@@ -66,3 +66,3 @@ import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style'; | ||
* | ||
* @method | ||
* @method createEventWithPrompt | ||
* @since 0.1.0 | ||
@@ -86,3 +86,2 @@ * @platform iOS, Android | ||
* @returns {Promise<{ result: string[] }>} A promise that resolves with an array of the ids of created events. | ||
* @throws Error If prompt gets cancelled. | ||
* @example | ||
@@ -117,5 +116,12 @@ * if (capacitor.getPlatform() === 'android') { | ||
* @method selectCalendarsWithPrompt | ||
* @since 0.2.0 | ||
* @platform iOS | ||
* @permissions | ||
* <h3>Runtime Permissions:</h3> | ||
* <ul> | ||
* <li><strong>iOS:</strong> writeCalendar</li> | ||
* </ul> | ||
* @param {object} options - Options for customizing the display and selection styles of the calendar chooser. | ||
* @async | ||
* @param {CalendarChooserDisplayStyle} options.displayStyle - To show all or only writeable calendars. | ||
* @param {CalendarChooserSelectionStyle} [options.selectionStyle] - To be able to select multiple calendars or only one. | ||
* @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars, | ||
@@ -384,2 +390,50 @@ * where each calendar object contains an ID and a title. | ||
}>; | ||
/** | ||
* Creates a calendar | ||
* | ||
* @method createCalendar | ||
* @since 5.2.0 | ||
* @platform iOS | ||
* @permissions | ||
* <h3>Runtime Permissions:</h3> | ||
* <ul> | ||
* <li><strong>iOS:</strong> readCalendar, writeCalendar</li> | ||
* </ul> | ||
* @param {object} options Options for creating a calendar. | ||
* @param {string} options.title The title of the calendar to create. | ||
* @param {string} options.color The color of the calendar to create. | ||
* The color should be a HEX string. (Optional) | ||
* @returns {Promise<{ result: string }>} The id of the created calendar. | ||
* @example | ||
* { result } = await CapacitorCalendar.createCalendar({ | ||
* title: 'New Calendar', | ||
* color: '#1d00fc', | ||
* }); | ||
* console.log(result); // 'CALENDAR_ID' | ||
*/ | ||
createCalendar(options: { | ||
title: string; | ||
color?: string; | ||
}): Promise<{ | ||
result: string; | ||
}>; | ||
/** | ||
* Deletes a calendar by id | ||
* | ||
* @method deleteCalendar | ||
* @since 5.2.0 | ||
* @platform iOS | ||
* @permissions | ||
* <h3>Runtime Permissions:</h3> | ||
* <ul> | ||
* <li><strong>iOS:</strong> readCalendar, writeCalendar</li> | ||
* </ul> | ||
* @param {object} options Options for deleting a calendar. | ||
* @param {string} options.id The id of the calendar to delete. | ||
* @example | ||
* await CapacitorCalendar.deleteCalendar({ id: 'ID_1' }); | ||
*/ | ||
deleteCalendar(options: { | ||
id: string; | ||
}): Promise<void>; | ||
} |
@@ -92,2 +92,11 @@ import { PermissionState, WebPlugin } from '@capacitor/core'; | ||
}>; | ||
createCalendar(_options: { | ||
title: string; | ||
color?: string; | ||
}): Promise<{ | ||
result: string; | ||
}>; | ||
deleteCalendar(_options: { | ||
id: string; | ||
}): Promise<void>; | ||
} |
@@ -20,3 +20,3 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
selectCalendarsWithPrompt() { | ||
throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`); | ||
} | ||
@@ -36,15 +36,15 @@ listCalendars() { | ||
getDefaultRemindersList() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`); | ||
} | ||
getRemindersLists() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`); | ||
} | ||
openCalendar(_options) { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`); | ||
} | ||
openReminders() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`); | ||
} | ||
listEventsInRange(_options) { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`); | ||
} | ||
@@ -54,3 +54,9 @@ deleteEventsById(_options) { | ||
} | ||
createCalendar(_options) { | ||
throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`); | ||
} | ||
deleteCalendar(_options) { | ||
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`); | ||
} | ||
} | ||
//# sourceMappingURL=web.js.map |
@@ -149,3 +149,3 @@ 'use strict'; | ||
selectCalendarsWithPrompt() { | ||
throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`); | ||
} | ||
@@ -165,15 +165,15 @@ listCalendars() { | ||
getDefaultRemindersList() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`); | ||
} | ||
getRemindersLists() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`); | ||
} | ||
openCalendar(_options) { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`); | ||
} | ||
openReminders() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`); | ||
} | ||
listEventsInRange(_options) { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`); | ||
} | ||
@@ -183,2 +183,8 @@ deleteEventsById(_options) { | ||
} | ||
createCalendar(_options) { | ||
throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`); | ||
} | ||
deleteCalendar(_options) { | ||
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`); | ||
} | ||
} | ||
@@ -185,0 +191,0 @@ |
@@ -148,3 +148,3 @@ var capacitorCapacitorCalendar = (function (exports, core) { | ||
selectCalendarsWithPrompt() { | ||
throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.selectCalendarsWithPrompt.name} is not implemented on the web`); | ||
} | ||
@@ -164,15 +164,15 @@ listCalendars() { | ||
getDefaultRemindersList() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.getDefaultRemindersList.name} is not implemented on the web`); | ||
} | ||
getRemindersLists() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.getRemindersLists.name} is not implemented on the web`); | ||
} | ||
openCalendar(_options) { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.openCalendar.name} is not implemented on the web`); | ||
} | ||
openReminders() { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.openReminders.name} is not implemented on the web`); | ||
} | ||
listEventsInRange(_options) { | ||
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`); | ||
throw this.unimplemented(`${this.listEventsInRange.name} is not implemented on the web`); | ||
} | ||
@@ -182,2 +182,8 @@ deleteEventsById(_options) { | ||
} | ||
createCalendar(_options) { | ||
throw this.unimplemented(`${this.createCalendar.name} is not implemented on the web`); | ||
} | ||
deleteCalendar(_options) { | ||
throw this.unimplemented(`${this.deleteCalendar.name} is not implemented on the web`); | ||
} | ||
} | ||
@@ -184,0 +190,0 @@ |
{ | ||
"name": "@ebarooni/capacitor-calendar", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "The Capacitor Calendar Plugin enables full calendar functionality on iOS and Android, with added reminder support for iOS devices.", | ||
@@ -60,5 +60,6 @@ "main": "dist/plugin.cjs.js", | ||
"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", | ||
"docgen": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json", | ||
"docgen:api": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json", | ||
"docgen:readme": "docgen --api CapacitorCalendarPlugin --output-readme README.md", | ||
"clean": "rm -rf ./dist", | ||
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs", | ||
"build": "npm run clean && npm run docgen:api && npm run docgen:readme && tsc && rollup -c rollup.config.mjs", | ||
"prepublishOnly": "npm run build" | ||
@@ -82,3 +83,3 @@ }, | ||
"prettier": "~3.2.5", | ||
"rollup": "^4.13.0", | ||
"rollup": "^4.17.0", | ||
"stylelint-prettier": "^5.0.0", | ||
@@ -85,0 +86,0 @@ "swiftlint": "^1.0.1", |
@@ -39,7 +39,16 @@ <p align="center"> | ||
### Capacitor 6 | ||
```bash | ||
npm install @ebarooni/capacitor-calendar | ||
npm install @ebarooni/capacitor-calendar@latest | ||
npx cap sync | ||
``` | ||
### Capacitor 5 | ||
```bash | ||
npm install @ebarooni/capacitor-calendar@^5 | ||
npx cap sync | ||
``` | ||
## [Demo (click for details)](./example/README.md) | ||
@@ -66,19 +75,28 @@ | ||
- `checkPermission(...)` | ||
- `checkAllPermissions()` | ||
- `requestPermission(...)` | ||
- `requestAllPermissions()` | ||
- `createEventWithPrompt()` | ||
- `selectCalendarsWithPrompt(...)` | ||
- `listCalendars()` | ||
- `getDefaultCalendar()` | ||
- `createEvent(...)` | ||
- `getDefaultRemindersList()` | ||
- `getRemindersLists()` | ||
- `createReminder(...)` | ||
- `openCalendar(...)` | ||
- `openReminders()` | ||
- `listEventsInRange(...)` | ||
- `deleteEventsById(...)` | ||
<docgen-index> | ||
* [`checkPermission(...)`](#checkpermission) | ||
* [`checkAllPermissions()`](#checkallpermissions) | ||
* [`requestPermission(...)`](#requestpermission) | ||
* [`requestAllPermissions()`](#requestallpermissions) | ||
* [`createEventWithPrompt(...)`](#createeventwithprompt) | ||
* [`selectCalendarsWithPrompt(...)`](#selectcalendarswithprompt) | ||
* [`listCalendars()`](#listcalendars) | ||
* [`getDefaultCalendar()`](#getdefaultcalendar) | ||
* [`createEvent(...)`](#createevent) | ||
* [`getDefaultRemindersList()`](#getdefaultreminderslist) | ||
* [`getRemindersLists()`](#getreminderslists) | ||
* [`createReminder(...)`](#createreminder) | ||
* [`openCalendar(...)`](#opencalendar) | ||
* [`openReminders()`](#openreminders) | ||
* [`listEventsInRange(...)`](#listeventsinrange) | ||
* [`deleteEventsById(...)`](#deleteeventsbyid) | ||
* [`createCalendar(...)`](#createcalendar) | ||
* [`deleteCalendar(...)`](#deletecalendar) | ||
* [Interfaces](#interfaces) | ||
* [Type Aliases](#type-aliases) | ||
* [Enums](#enums) | ||
</docgen-index> | ||
## ๐ Documentation | ||
@@ -88,3 +106,3 @@ | ||
- **documentation.md**: Autogenerated doc are available in the [documentation](documentation.md) file. | ||
- **documentation.md**: Autogenerated docs are available in the [documentation](documentation.md) file. | ||
- **definitions.ts**: Complete documentation with usage examples is available in the [src/definitions.ts](src/definitions.ts) file. | ||
@@ -91,0 +109,0 @@ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232686
63
2529
118