@ebarooni/capacitor-calendar
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -187,2 +187,58 @@ { | ||
"slug": "selectcalendarswithprompt" | ||
}, | ||
{ | ||
"name": "listCalendars", | ||
"signature": "() => Promise<{ result: Calendar[]; }>", | ||
"parameters": [], | ||
"returns": "Promise<{ result: Calendar[]; }>", | ||
"tags": [ | ||
{ | ||
"name": "async" | ||
}, | ||
{ | ||
"name": "method", | ||
"text": "listCalendars" | ||
}, | ||
{ | ||
"name": "returns", | ||
"text": "A promise that resolves with an array of calendars available on the device.\nEach calendar object in the array contains an ID and a title." | ||
}, | ||
{ | ||
"name": "example", | ||
"text": "const calendars = await listCalendars();\nconsole.log(calendars); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]" | ||
} | ||
], | ||
"docs": "Retrieves a list of calendars available on the device.", | ||
"complexTypes": [ | ||
"Calendar" | ||
], | ||
"slug": "listcalendars" | ||
}, | ||
{ | ||
"name": "getDefaultCalendar", | ||
"signature": "() => Promise<{ result: Calendar; }>", | ||
"parameters": [], | ||
"returns": "Promise<{ result: Calendar; }>", | ||
"tags": [ | ||
{ | ||
"name": "async" | ||
}, | ||
{ | ||
"name": "method", | ||
"text": "getDefaultCalendar" | ||
}, | ||
{ | ||
"name": "returns", | ||
"text": "A promise that resolves with the default calendar set on the device.\nThe returned calendar object contains an ID and a title." | ||
}, | ||
{ | ||
"name": "example", | ||
"text": "const defaultCalendar = await getDefaultCalendar();\nconsole.log(defaultCalendar); // { id: '1', title: 'Default Calendar' }" | ||
} | ||
], | ||
"docs": "Retrieves the default calendar set on the device.", | ||
"complexTypes": [ | ||
"Calendar" | ||
], | ||
"slug": "getdefaultcalendar" | ||
} | ||
@@ -189,0 +245,0 @@ ], |
@@ -143,2 +143,30 @@ import type { PermissionState } from '@capacitor/core'; | ||
}>; | ||
/** | ||
* Retrieves a list of calendars available on the device. | ||
* | ||
* @async | ||
* @method listCalendars | ||
* @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device. | ||
* Each calendar object in the array contains an ID and a title. | ||
* @example | ||
* const calendars = await listCalendars(); | ||
* console.log(calendars); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }] | ||
*/ | ||
listCalendars(): Promise<{ | ||
result: Calendar[]; | ||
}>; | ||
/** | ||
* Retrieves the default calendar set on the device. | ||
* | ||
* @async | ||
* @method getDefaultCalendar | ||
* @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device. | ||
* The returned calendar object contains an ID and a title. | ||
* @example | ||
* const defaultCalendar = await getDefaultCalendar(); | ||
* console.log(defaultCalendar); // { id: '1', title: 'Default Calendar' } | ||
*/ | ||
getDefaultCalendar(): Promise<{ | ||
result: Calendar; | ||
}>; | ||
} |
@@ -22,2 +22,8 @@ import { PermissionState, WebPlugin } from '@capacitor/core'; | ||
}>; | ||
listCalendars(): Promise<{ | ||
result: Calendar[]; | ||
}>; | ||
getDefaultCalendar(): Promise<{ | ||
result: Calendar; | ||
}>; | ||
} |
@@ -21,3 +21,9 @@ import { WebPlugin } from '@capacitor/core'; | ||
} | ||
listCalendars() { | ||
throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`); | ||
} | ||
getDefaultCalendar() { | ||
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`); | ||
} | ||
} | ||
//# sourceMappingURL=web.js.map |
@@ -62,2 +62,8 @@ 'use strict'; | ||
} | ||
listCalendars() { | ||
throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`); | ||
} | ||
getDefaultCalendar() { | ||
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`); | ||
} | ||
} | ||
@@ -64,0 +70,0 @@ |
@@ -59,2 +59,8 @@ var capacitorCapacitorCalendar = (function (exports, core) { | ||
} | ||
listCalendars() { | ||
throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`); | ||
} | ||
getDefaultCalendar() { | ||
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`); | ||
} | ||
} | ||
@@ -61,0 +67,0 @@ |
{ | ||
"name": "@ebarooni/capacitor-calendar", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "The Capacitor Calendar Plugin exposes functionalities for interacting with the calendar of iOS and Android devices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
@@ -16,9 +16,23 @@ <h1 align="center">CapacitorCalendar</h1> | ||
- [Install](#install) | ||
- [Support Range](#support-range) | ||
- [Demo](#demo--click-for-details-) | ||
- [MVP](#mvp) | ||
- [Support Range](#support-range) | ||
- [Install](#install) | ||
- [Permissions](#permissions) | ||
- [API](#api) | ||
## Install | ||
```bash | ||
npm install @ebarooni/capacitor-calendar | ||
npx cap sync | ||
``` | ||
## Support Range | ||
| Platform | range | | ||
|:----------:|:------------------------------------:| | ||
| iOS | ≥ 13 | | ||
| Android | ≥ 4 (SDK 14 – Ice Cream Sandwich) | | ||
## [Demo (click for details)](./example/README.md) | ||
@@ -37,2 +51,4 @@ | ||
- ✅ Choose calendars with prompt (only supported on iOS) | ||
- ✅ Get list of available calendars | ||
- ✅ Get default calendar | ||
- ⌛ Create calendar events without native prompts | ||
@@ -43,16 +59,2 @@ - ⌛️ Create reminders (only supported on iOS) | ||
## Support Range | ||
| Platform | range | | ||
|:----------:|:------------------------------------:| | ||
| iOS | ≥ 13 | | ||
| Android | ≥ 4 (SDK 14 – Ice Cream Sandwich) | | ||
## Install | ||
```bash | ||
npm install @ebarooni/capacitor-calendar | ||
npx cap sync | ||
``` | ||
## Permissions | ||
@@ -76,2 +78,4 @@ | ||
* [`selectCalendarsWithPrompt(...)`](#selectcalendarswithprompt) | ||
* [`listCalendars()`](#listcalendars) | ||
* [`getDefaultCalendar()`](#getdefaultcalendar) | ||
* [Interfaces](#interfaces) | ||
@@ -180,2 +184,28 @@ * [Type Aliases](#type-aliases) | ||
### listCalendars() | ||
```typescript | ||
listCalendars() => Promise<{ result: Calendar[]; }> | ||
``` | ||
Retrieves a list of calendars available on the device. | ||
**Returns:** <code>Promise<{ result: Calendar[]; }></code> | ||
-------------------- | ||
### getDefaultCalendar() | ||
```typescript | ||
getDefaultCalendar() => Promise<{ result: Calendar; }> | ||
``` | ||
Retrieves the default calendar set on the device. | ||
**Returns:** <code>Promise<{ result: <a href="#calendar">Calendar</a>; }></code> | ||
-------------------- | ||
### Interfaces | ||
@@ -182,0 +212,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
90488
30
784
256