@ebarooni/capacitor-calendar 0.12.0 → 6.0.0

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/README.md CHANGED
@@ -10,17 +10,29 @@
10
10
  <br>
11
11
  </p>
12
12
  <p align="center">
13
+ <a href="documentation.md">Documentation</a>
14
+ ·
15
+ <a href="SECURITY.md#capacitor-compatibility">Capacitor Compatibility</a>
16
+ ·
13
17
  <a href="SECURITY.md#deployment-targets">Deployment Targets</a>
14
18
  <br>
15
19
  </p>
20
+ <p align="center">
21
+ <img src="https://img.shields.io/maintenance/yes/2024?style=flat-square" />
22
+ <a href="https://www.npmjs.com/package/@ebarooni/capacitor-calendar"><img src="https://img.shields.io/npm/l/@ebarooni/capacitor-calendar?style=flat-square" /></a>
23
+ <br>
24
+ <a href="https://www.npmjs.com/package/@ebarooni/capacitor-calendar"><img src="https://img.shields.io/npm/dw/@ebarooni/capacitor-calendar?style=flat-square" /></a>
25
+ <a href="https://www.npmjs.com/package/@ebarooni/capacitor-calendar"><img src="https://img.shields.io/npm/v/@ebarooni/capacitor-calendar?style=flat-square" /></a>
26
+ </p>
16
27
 
17
28
  ## Table of Contents
18
29
 
19
30
  - [Install](#install)
20
31
  - [Demo](#demo--click-for-details-)
21
32
  - [Permissions](#permissions)
33
+ - [API](#-api)
34
+ - [Documentation](#-documentation)
22
35
  - [Contributions](#-contributions)
23
- - [API](#api)
24
36
 
25
37
  ## Install
26
38
 
@@ -48,6 +60,32 @@ permissions can be found below:
48
60
  - [iOS](./ios/PERMISSIONS.md)
49
61
  - [Android](./android/PERMISSIONS.md)
50
62
 
63
+ ## 📋 API
64
+
65
+ - `checkPermission(...)`
66
+ - `checkAllPermissions()`
67
+ - `requestPermission(...)`
68
+ - `requestAllPermissions()`
69
+ - `createEventWithPrompt()`
70
+ - `selectCalendarsWithPrompt(...)`
71
+ - `listCalendars()`
72
+ - `getDefaultCalendar()`
73
+ - `createEvent(...)`
74
+ - `getDefaultRemindersList()`
75
+ - `getRemindersLists()`
76
+ - `createReminder(...)`
77
+ - `openCalendar(...)`
78
+ - `openReminders()`
79
+ - `listEventsInRange(...)`
80
+ - `deleteEventsById(...)`
81
+
82
+ ## 📚 Documentation
83
+
84
+ For detailed explanations, usage examples, and additional information:
85
+
86
+ - **documentation.md**: Autogenerated doc are available in the [documentation](documentation.md) file.
87
+ - **definitions.ts**: Complete documentation with usage examples is available in the [src/definitions.ts](src/definitions.ts) file.
88
+
51
89
  ## 💙 Contributions
52
90
 
53
91
  > [!WARNING]
@@ -59,374 +97,3 @@ permissions can be found below:
59
97
  > Feel free to open issues for bugs you've discovered or enhancements you'd like to see.
60
98
  >
61
99
  > Stay tuned for updates. Looking forward to collaborating with you in the future once contributions are opened up!
62
-
63
- ## API
64
-
65
- <docgen-index>
66
-
67
- * [`checkPermission(...)`](#checkpermission)
68
- * [`checkAllPermissions()`](#checkallpermissions)
69
- * [`requestPermission(...)`](#requestpermission)
70
- * [`requestAllPermissions()`](#requestallpermissions)
71
- * [`createEventWithPrompt()`](#createeventwithprompt)
72
- * [`selectCalendarsWithPrompt(...)`](#selectcalendarswithprompt)
73
- * [`listCalendars()`](#listcalendars)
74
- * [`getDefaultCalendar()`](#getdefaultcalendar)
75
- * [`createEvent(...)`](#createevent)
76
- * [`getDefaultRemindersList()`](#getdefaultreminderslist)
77
- * [`getRemindersLists()`](#getreminderslists)
78
- * [`createReminder(...)`](#createreminder)
79
- * [`openCalendar(...)`](#opencalendar)
80
- * [`openReminders()`](#openreminders)
81
- * [`listEventsInRange(...)`](#listeventsinrange)
82
- * [`deleteEventsById(...)`](#deleteeventsbyid)
83
- * [Interfaces](#interfaces)
84
- * [Type Aliases](#type-aliases)
85
- * [Enums](#enums)
86
-
87
- </docgen-index>
88
-
89
- <docgen-api>
90
- <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
91
-
92
- ### checkPermission(...)
93
-
94
- ```typescript
95
- checkPermission(options: { alias: PluginPermission; }) => Promise<{ result: PermissionState; }>
96
- ```
97
-
98
- Checks the current authorization status of a specific permission.
99
-
100
- | Param | Type | Description |
101
- | ------------- | ------------------------------------------------------------------------- | ----------------------------------------- |
102
- | **`options`** | <code>{ alias: <a href="#pluginpermission">PluginPermission</a>; }</code> | An object with the name of the permission |
103
-
104
- **Returns:** <code>Promise&lt;{ result: <a href="#permissionstate">PermissionState</a>; }&gt;</code>
105
-
106
- --------------------
107
-
108
-
109
- ### checkAllPermissions()
110
-
111
- ```typescript
112
- checkAllPermissions() => Promise<PluginPermissionsMap>
113
- ```
114
-
115
- Checks the current authorization status of all the required permissions for the plugin.
116
-
117
- **Returns:** <code>Promise&lt;<a href="#pluginpermissionsmap">PluginPermissionsMap</a>&gt;</code>
118
-
119
- --------------------
120
-
121
-
122
- ### requestPermission(...)
123
-
124
- ```typescript
125
- requestPermission(options: { alias: PluginPermission; }) => Promise<{ result: PermissionState; }>
126
- ```
127
-
128
- Requests authorization to a specific permission, if not already granted.
129
- If the permission is already granted, it will directly return the status.
130
-
131
- | Param | Type | Description |
132
- | ------------- | ------------------------------------------------------------------------- | ----------------------------------------- |
133
- | **`options`** | <code>{ alias: <a href="#pluginpermission">PluginPermission</a>; }</code> | An object with the name of the permission |
134
-
135
- **Returns:** <code>Promise&lt;{ result: <a href="#permissionstate">PermissionState</a>; }&gt;</code>
136
-
137
- --------------------
138
-
139
-
140
- ### requestAllPermissions()
141
-
142
- ```typescript
143
- requestAllPermissions() => Promise<PluginPermissionsMap>
144
- ```
145
-
146
- Requests authorization to all the required permissions for the plugin, if they have not already been granted.
147
-
148
- **Returns:** <code>Promise&lt;<a href="#pluginpermissionsmap">PluginPermissionsMap</a>&gt;</code>
149
-
150
- --------------------
151
-
152
-
153
- ### createEventWithPrompt()
154
-
155
- ```typescript
156
- createEventWithPrompt() => Promise<{ result: string[]; }>
157
- ```
158
-
159
- Creates an event in the calendar by using the native calendar.
160
- On iOS opens a native sheet and on Android opens an intent.
161
-
162
- **Returns:** <code>Promise&lt;{ result: string[]; }&gt;</code>
163
-
164
- --------------------
165
-
166
-
167
- ### selectCalendarsWithPrompt(...)
168
-
169
- ```typescript
170
- selectCalendarsWithPrompt(options: { displayStyle: CalendarChooserDisplayStyle; selectionStyle: CalendarChooserSelectionStyle; }) => Promise<{ result: Calendar[]; }>
171
- ```
172
-
173
- Presents a prompt to the user to select calendars. This method is available only on iOS.
174
-
175
- | Param | Type | Description |
176
- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
177
- | **`options`** | <code>{ displayStyle: <a href="#calendarchooserdisplaystyle">CalendarChooserDisplayStyle</a>; selectionStyle: <a href="#calendarchooserselectionstyle">CalendarChooserSelectionStyle</a>; }</code> | - Options for customizing the display and selection styles of the calendar chooser. |
178
-
179
- **Returns:** <code>Promise&lt;{ result: Calendar[]; }&gt;</code>
180
-
181
- --------------------
182
-
183
-
184
- ### listCalendars()
185
-
186
- ```typescript
187
- listCalendars() => Promise<{ result: Calendar[]; }>
188
- ```
189
-
190
- Retrieves a list of calendars available on the device.
191
-
192
- **Returns:** <code>Promise&lt;{ result: Calendar[]; }&gt;</code>
193
-
194
- --------------------
195
-
196
-
197
- ### getDefaultCalendar()
198
-
199
- ```typescript
200
- getDefaultCalendar() => Promise<{ result: Calendar; }>
201
- ```
202
-
203
- Retrieves the default calendar set on the device.
204
-
205
- **Returns:** <code>Promise&lt;{ result: <a href="#calendar">Calendar</a>; }&gt;</code>
206
-
207
- --------------------
208
-
209
-
210
- ### createEvent(...)
211
-
212
- ```typescript
213
- createEvent(options: { title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; }) => Promise<{ result: string; }>
214
- ```
215
-
216
- Creates an event with the provided options.
217
-
218
- | Param | Type | Description |
219
- | ------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
220
- | **`options`** | <code>{ title: string; calendarId?: string; location?: string; startDate?: number; endDate?: number; isAllDay?: boolean; }</code> | - Options for creating the event. |
221
-
222
- **Returns:** <code>Promise&lt;{ result: string; }&gt;</code>
223
-
224
- --------------------
225
-
226
-
227
- ### getDefaultRemindersList()
228
-
229
- ```typescript
230
- getDefaultRemindersList() => Promise<{ result: RemindersList; }>
231
- ```
232
-
233
- Retrieves the default reminders list set on the device.
234
-
235
- **Returns:** <code>Promise&lt;{ result: <a href="#reminderslist">RemindersList</a>; }&gt;</code>
236
-
237
- --------------------
238
-
239
-
240
- ### getRemindersLists()
241
-
242
- ```typescript
243
- getRemindersLists() => Promise<{ result: RemindersList[]; }>
244
- ```
245
-
246
- Retrieves all available reminders lists on the device.
247
-
248
- **Returns:** <code>Promise&lt;{ result: RemindersList[]; }&gt;</code>
249
-
250
- --------------------
251
-
252
-
253
- ### createReminder(...)
254
-
255
- ```typescript
256
- createReminder(options: { title: string; listId?: string; priority?: number; isCompleted?: boolean; startDate?: number; dueDate?: number; completionDate?: number; notes?: string; url?: string; location?: string; recurrence?: ReminderRecurrenceRule; }) => Promise<{ result: string; }>
257
- ```
258
-
259
- Creates a reminder with the provided options.
260
-
261
- | Param | Type | Description |
262
- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
263
- | **`options`** | <code>{ title: string; listId?: string; priority?: number; isCompleted?: boolean; startDate?: number; dueDate?: number; completionDate?: number; notes?: string; url?: string; location?: string; recurrence?: <a href="#reminderrecurrencerule">ReminderRecurrenceRule</a>; }</code> | - Options for creating the reminder. |
264
-
265
- **Returns:** <code>Promise&lt;{ result: string; }&gt;</code>
266
-
267
- **Since:** 0.5.0
268
-
269
- --------------------
270
-
271
-
272
- ### openCalendar(...)
273
-
274
- ```typescript
275
- openCalendar(options: { date?: number; }) => Promise<void>
276
- ```
277
-
278
- Opens the calendar app. Since the user leaves your app, use this method with caution.
279
- It will open the calendar on today's date if no date is provided.
280
-
281
- | Param | Type | Description |
282
- | ------------- | ------------------------------- | ----------------------------------- |
283
- | **`options`** | <code>{ date?: number; }</code> | - Options for opening the calendar. |
284
-
285
- --------------------
286
-
287
-
288
- ### openReminders()
289
-
290
- ```typescript
291
- openReminders() => Promise<void>
292
- ```
293
-
294
- Opens the reminders app. Since the user leaves your app, use this method with caution.
295
-
296
- --------------------
297
-
298
-
299
- ### listEventsInRange(...)
300
-
301
- ```typescript
302
- listEventsInRange(options: { startDate: number; endDate: number; }) => Promise<{ result: CalendarEvent[]; }>
303
- ```
304
-
305
- Retrieves the list of calendar events present in the given date range.
306
-
307
- | Param | Type | Description |
308
- | ------------- | ---------------------------------------------------- | ------------------------------------ |
309
- | **`options`** | <code>{ startDate: number; endDate: number; }</code> | Options for defining the date range. |
310
-
311
- **Returns:** <code>Promise&lt;{ result: CalendarEvent[]; }&gt;</code>
312
-
313
- **Since:** 0.10.0
314
-
315
- --------------------
316
-
317
-
318
- ### deleteEventsById(...)
319
-
320
- ```typescript
321
- deleteEventsById(options: { ids: string[]; }) => Promise<{ result: { deleted: string[]; failed: string[]; }; }>
322
- ```
323
-
324
- Deletes events from the calendar given their IDs.
325
-
326
- | Param | Type | Description |
327
- | ------------- | ------------------------------- | ------------------------------- |
328
- | **`options`** | <code>{ ids: string[]; }</code> | Options for defining event IDs. |
329
-
330
- **Returns:** <code>Promise&lt;{ result: { deleted: string[]; failed: string[]; }; }&gt;</code>
331
-
332
- **Since:** 0.11.0
333
-
334
- --------------------
335
-
336
-
337
- ### Interfaces
338
-
339
-
340
- #### PluginPermissionsMap
341
-
342
-
343
- #### Calendar
344
-
345
- Represents a calendar object.
346
-
347
- | Prop | Type |
348
- | ----------- | ------------------- |
349
- | **`id`** | <code>string</code> |
350
- | **`title`** | <code>string</code> |
351
-
352
-
353
- #### RemindersList
354
-
355
-
356
- #### ReminderRecurrenceRule
357
-
358
- | Prop | Type | Description |
359
- | --------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
360
- | **`frequency`** | <code><a href="#reminderrecurrencefrequency">ReminderRecurrenceFrequency</a></code> | How frequent should the reminder repeat. |
361
- | **`interval`** | <code>number</code> | The interval should be a number greater than 0. For values lower than 1 the method will throw an error. |
362
- | **`end`** | <code>number</code> | When provided, the reminder will stop repeating at the given time. |
363
-
364
-
365
- #### CalendarEvent
366
-
367
- Represents an event in the calendar.
368
-
369
- | Prop | Type |
370
- | ---------------------- | -------------------- |
371
- | **`id`** | <code>string</code> |
372
- | **`title`** | <code>string</code> |
373
- | **`location`** | <code>string</code> |
374
- | **`eventColor`** | <code>string</code> |
375
- | **`organizer`** | <code>string</code> |
376
- | **`description`** | <code>string</code> |
377
- | **`startDate`** | <code>number</code> |
378
- | **`endDate`** | <code>number</code> |
379
- | **`eventTimezone`** | <code>string</code> |
380
- | **`eventEndTimezone`** | <code>string</code> |
381
- | **`duration`** | <code>string</code> |
382
- | **`isAllDay`** | <code>boolean</code> |
383
- | **`calendarId`** | <code>string</code> |
384
-
385
-
386
- ### Type Aliases
387
-
388
-
389
- #### PermissionState
390
-
391
- <code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>
392
-
393
-
394
- ### Enums
395
-
396
-
397
- #### PluginPermission
398
-
399
- | Members | Value | Description |
400
- | --------------------- | ----------------------------- | ------------------------------------------------------ |
401
- | **`READ_CALENDAR`** | <code>'readCalendar'</code> | Represents the permission state for reading calendar. |
402
- | **`WRITE_CALENDAR`** | <code>'writeCalendar'</code> | Represents the permission state for writing calendar. |
403
- | **`READ_REMINDERS`** | <code>'readReminders'</code> | Represents the permission state for reading reminders. |
404
- | **`WRITE_REMINDERS`** | <code>'writeReminders'</code> | Represents the permission state for writing reminders. |
405
-
406
-
407
- #### CalendarChooserDisplayStyle
408
-
409
- | Members | Description |
410
- | ----------------------------- | -------------------------------------------------------- |
411
- | **`ALL_CALENDARS`** | Display all calendars available for selection. |
412
- | **`WRITABLE_CALENDARS_ONLY`** | Display only writable calendars available for selection. |
413
-
414
-
415
- #### CalendarChooserSelectionStyle
416
-
417
- | Members | Description |
418
- | -------------- | ------------------------------------------------------- |
419
- | **`SINGLE`** | Allows only a single selection in the calendar chooser. |
420
- | **`MULTIPLE`** | Allows multiple selections in the calendar chooser. |
421
-
422
-
423
- #### ReminderRecurrenceFrequency
424
-
425
- | Members | Description |
426
- | ------------- | --------------------------------------- |
427
- | **`DAILY`** | The reminder repeats on a daily basis |
428
- | **`WEEKLY`** | The reminder repeats on a weekly basis |
429
- | **`MONTHLY`** | The reminder repeats on a monthly basis |
430
- | **`YEARLY`** | The reminder repeats on a yearly basis |
431
-
432
- </docgen-api>
@@ -7,14 +7,14 @@ ext {
7
7
 
8
8
  buildscript {
9
9
  ext {
10
- kotlin_version = '1.9.22'
10
+ kotlin_version = '1.9.23'
11
11
  }
12
12
  repositories {
13
13
  google()
14
14
  mavenCentral()
15
15
  }
16
16
  dependencies {
17
- classpath 'com.android.tools.build:gradle:8.2.2'
17
+ classpath 'com.android.tools.build:gradle:8.3.2'
18
18
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19
19
  }
20
20
  }
@@ -24,7 +24,7 @@ apply plugin: 'org.jetbrains.kotlin.android'
24
24
 
25
25
  android {
26
26
  namespace "dev.barooni.capacitor.calendar"
27
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
27
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
28
28
  defaultConfig {
29
29
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
30
30
  targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebarooni/capacitor-calendar",
3
- "version": "0.12.0",
3
+ "version": "6.0.0",
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",
@@ -57,7 +57,7 @@
57
57
  "fmt:md": "npx prettier --write \"**/*.md\"",
58
58
  "fmt:kt": "npm run ktlint -- -F",
59
59
  "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",
60
- "docgen": "docgen --api CapacitorCalendarPlugin --output-readme README.md --output-json dist/docs.json",
60
+ "docgen": "docgen --api CapacitorCalendarPlugin --output-readme documentation.md --output-json dist/docs.json",
61
61
  "clean": "rm -rf ./dist",
62
62
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
63
63
  "prepublishOnly": "npm run build"
@@ -67,24 +67,24 @@
67
67
  "@angular-eslint/eslint-plugin-template": "^17.3.0",
68
68
  "@angular-eslint/template-parser": "^17.3.0",
69
69
  "@angular/cli": "^17.1.2",
70
- "@capacitor/android": "^5.0.0",
71
- "@capacitor/cli": "^5.6.0",
72
- "@capacitor/core": "^5.0.0",
70
+ "@capacitor/android": "^6.0.0",
71
+ "@capacitor/cli": "^6.0.0",
72
+ "@capacitor/core": "^6.0.0",
73
73
  "@capacitor/docgen": "^0.0.18",
74
- "@capacitor/ios": "^5.0.0",
74
+ "@capacitor/ios": "^6.0.0",
75
75
  "@typescript-eslint/eslint-plugin": "^7.3.0",
76
76
  "@typescript-eslint/parser": "^7.3.0",
77
77
  "eslint": "^8.57.0",
78
78
  "eslint-config-prettier": "^9.1.0",
79
79
  "eslint-plugin-prettier": "^5.1.3",
80
80
  "prettier": "~3.2.5",
81
- "rollup": "^4.13.0",
81
+ "rollup": "^4.17.0",
82
82
  "stylelint-prettier": "^5.0.0",
83
83
  "swiftlint": "^1.0.1",
84
84
  "typescript": "~5.4.2"
85
85
  },
86
86
  "peerDependencies": {
87
- "@capacitor/core": "^5.0.0"
87
+ "@capacitor/core": "^6.0.0"
88
88
  },
89
89
  "capacitor": {
90
90
  "ios": {