@capawesome/capacitor-alarm 0.0.1
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/CapawesomeCapacitorAlarm.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +28 -0
- package/README.md +449 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/Alarm.java +85 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/AlarmPlugin.java +154 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/classes/CustomException.java +20 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/classes/CustomExceptions.java +16 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/classes/options/CreateAlarmOptions.java +124 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/classes/options/CreateTimerOptions.java +48 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/classes/results/CreateAlarmResult.java +25 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/classes/results/IsAvailableResult.java +22 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/interfaces/Callback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/interfaces/EmptyCallback.java +5 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/interfaces/NonEmptyResultCallback.java +7 -0
- package/android/src/main/java/io/capawesome/capacitorjs/plugins/alarm/interfaces/Result.java +7 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +743 -0
- package/dist/esm/definitions.d.ts +349 -0
- package/dist/esm/definitions.js +55 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +12 -0
- package/dist/esm/web.js +28 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +97 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +100 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Alarm.swift +148 -0
- package/ios/Plugin/AlarmPlugin.swift +147 -0
- package/ios/Plugin/Classes/Options/CancelAlarmOptions.swift +20 -0
- package/ios/Plugin/Classes/Options/CreateAlarmOptions.swift +70 -0
- package/ios/Plugin/Classes/Results/CreateAlarmResult.swift +16 -0
- package/ios/Plugin/Classes/Results/GetAlarmsResult.swift +49 -0
- package/ios/Plugin/Classes/Results/IsAvailableResult.swift +16 -0
- package/ios/Plugin/Classes/Results/PermissionStatusResult.swift +16 -0
- package/ios/Plugin/Enums/CustomError.swift +47 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Protocols/Result.swift +6 -0
- package/package.json +95 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import type { PermissionState } from '@capacitor/core';
|
|
2
|
+
export interface AlarmPlugin {
|
|
3
|
+
/**
|
|
4
|
+
* Cancel an alarm that was created by the app.
|
|
5
|
+
*
|
|
6
|
+
* Only available on iOS.
|
|
7
|
+
*
|
|
8
|
+
* @since 0.1.0
|
|
9
|
+
*/
|
|
10
|
+
cancelAlarm(options: CancelAlarmOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Check permission to schedule alarms.
|
|
13
|
+
*
|
|
14
|
+
* On Android, this method always returns `granted` since
|
|
15
|
+
* alarms are created via the system clock app.
|
|
16
|
+
*
|
|
17
|
+
* Only available on Android and iOS.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
*/
|
|
21
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
22
|
+
/**
|
|
23
|
+
* Create a new alarm.
|
|
24
|
+
*
|
|
25
|
+
* On Android, the alarm is created in the system clock app.
|
|
26
|
+
* The app has no access to the created alarm afterwards.
|
|
27
|
+
*
|
|
28
|
+
* On iOS, the alarm is owned by the app and can be listed
|
|
29
|
+
* and canceled using the `getAlarms(...)` and `cancelAlarm(...)`
|
|
30
|
+
* methods.
|
|
31
|
+
*
|
|
32
|
+
* Only available on Android and iOS.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
createAlarm(options: CreateAlarmOptions): Promise<CreateAlarmResult>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new countdown timer in the system clock app.
|
|
39
|
+
*
|
|
40
|
+
* Only available on Android.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
*/
|
|
44
|
+
createTimer(options: CreateTimerOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Get all alarms that were created by the app.
|
|
47
|
+
*
|
|
48
|
+
* Only available on iOS.
|
|
49
|
+
*
|
|
50
|
+
* @since 0.1.0
|
|
51
|
+
*/
|
|
52
|
+
getAlarms(): Promise<GetAlarmsResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if alarms are available on this device.
|
|
55
|
+
*
|
|
56
|
+
* On Android, this checks whether an app that can handle
|
|
57
|
+
* alarms is installed. On iOS, this returns `true` if the
|
|
58
|
+
* device runs iOS 26 or later.
|
|
59
|
+
*
|
|
60
|
+
* Only available on Android and iOS.
|
|
61
|
+
*
|
|
62
|
+
* @since 0.1.0
|
|
63
|
+
*/
|
|
64
|
+
isAvailable(): Promise<IsAvailableResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Open the list of alarms in the system clock app.
|
|
67
|
+
*
|
|
68
|
+
* Only available on Android.
|
|
69
|
+
*
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
*/
|
|
72
|
+
openAlarms(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Request permission to schedule alarms.
|
|
75
|
+
*
|
|
76
|
+
* On Android, this method always returns `granted` since
|
|
77
|
+
* alarms are created via the system clock app.
|
|
78
|
+
*
|
|
79
|
+
* Only available on Android and iOS.
|
|
80
|
+
*
|
|
81
|
+
* @since 0.1.0
|
|
82
|
+
*/
|
|
83
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @since 0.1.0
|
|
87
|
+
*/
|
|
88
|
+
export interface AlarmInfo {
|
|
89
|
+
/**
|
|
90
|
+
* Whether or not the alarm is active.
|
|
91
|
+
*
|
|
92
|
+
* @since 0.1.0
|
|
93
|
+
* @example true
|
|
94
|
+
*/
|
|
95
|
+
enabled: boolean | null;
|
|
96
|
+
/**
|
|
97
|
+
* The hour of the alarm (0-23).
|
|
98
|
+
*
|
|
99
|
+
* @since 0.1.0
|
|
100
|
+
* @example 6
|
|
101
|
+
*/
|
|
102
|
+
hour: number | null;
|
|
103
|
+
/**
|
|
104
|
+
* The unique identifier of the alarm.
|
|
105
|
+
*
|
|
106
|
+
* @since 0.1.0
|
|
107
|
+
* @example '2B1A3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'
|
|
108
|
+
*/
|
|
109
|
+
id: string;
|
|
110
|
+
/**
|
|
111
|
+
* The label of the alarm.
|
|
112
|
+
*
|
|
113
|
+
* @since 0.1.0
|
|
114
|
+
* @example 'Wake up'
|
|
115
|
+
*/
|
|
116
|
+
label: string | null;
|
|
117
|
+
/**
|
|
118
|
+
* The minute of the alarm (0-59).
|
|
119
|
+
*
|
|
120
|
+
* @since 0.1.0
|
|
121
|
+
* @example 30
|
|
122
|
+
*/
|
|
123
|
+
minute: number | null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @since 0.1.0
|
|
127
|
+
*/
|
|
128
|
+
export interface CancelAlarmOptions {
|
|
129
|
+
/**
|
|
130
|
+
* The unique identifier of the alarm to cancel.
|
|
131
|
+
*
|
|
132
|
+
* @since 0.1.0
|
|
133
|
+
* @example '2B1A3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'
|
|
134
|
+
*/
|
|
135
|
+
id: string;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @since 0.1.0
|
|
139
|
+
*/
|
|
140
|
+
export interface CreateAlarmAndroidOptions {
|
|
141
|
+
/**
|
|
142
|
+
* Whether or not to create the alarm without showing
|
|
143
|
+
* the user interface of the system clock app.
|
|
144
|
+
*
|
|
145
|
+
* Only available on Android.
|
|
146
|
+
*
|
|
147
|
+
* @since 0.1.0
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
150
|
+
skipUi?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Whether or not the alarm should vibrate.
|
|
153
|
+
*
|
|
154
|
+
* If not provided, the default behavior of the system
|
|
155
|
+
* clock app is used.
|
|
156
|
+
*
|
|
157
|
+
* Only available on Android.
|
|
158
|
+
*
|
|
159
|
+
* @since 0.1.0
|
|
160
|
+
*/
|
|
161
|
+
vibrate?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @since 0.1.0
|
|
165
|
+
*/
|
|
166
|
+
export interface CreateAlarmOptions {
|
|
167
|
+
/**
|
|
168
|
+
* Android-specific options.
|
|
169
|
+
*
|
|
170
|
+
* Only available on Android.
|
|
171
|
+
*
|
|
172
|
+
* @since 0.1.0
|
|
173
|
+
*/
|
|
174
|
+
android?: CreateAlarmAndroidOptions;
|
|
175
|
+
/**
|
|
176
|
+
* The days of the week on which the alarm repeats.
|
|
177
|
+
*
|
|
178
|
+
* If not provided, the alarm fires once at the next
|
|
179
|
+
* occurrence of the given time.
|
|
180
|
+
*
|
|
181
|
+
* @since 0.1.0
|
|
182
|
+
* @example [Weekday.Monday, Weekday.Friday]
|
|
183
|
+
*/
|
|
184
|
+
days?: Weekday[];
|
|
185
|
+
/**
|
|
186
|
+
* The hour of the alarm (0-23).
|
|
187
|
+
*
|
|
188
|
+
* @since 0.1.0
|
|
189
|
+
* @example 6
|
|
190
|
+
*/
|
|
191
|
+
hour: number;
|
|
192
|
+
/**
|
|
193
|
+
* The label of the alarm.
|
|
194
|
+
*
|
|
195
|
+
* @since 0.1.0
|
|
196
|
+
* @example 'Wake up'
|
|
197
|
+
*/
|
|
198
|
+
label?: string;
|
|
199
|
+
/**
|
|
200
|
+
* The minute of the alarm (0-59).
|
|
201
|
+
*
|
|
202
|
+
* @since 0.1.0
|
|
203
|
+
* @example 30
|
|
204
|
+
*/
|
|
205
|
+
minute: number;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @since 0.1.0
|
|
209
|
+
*/
|
|
210
|
+
export interface CreateAlarmResult {
|
|
211
|
+
/**
|
|
212
|
+
* The unique identifier of the created alarm.
|
|
213
|
+
*
|
|
214
|
+
* On Android, this is always `null` since the alarm is
|
|
215
|
+
* created in the system clock app.
|
|
216
|
+
*
|
|
217
|
+
* @since 0.1.0
|
|
218
|
+
* @example '2B1A3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'
|
|
219
|
+
*/
|
|
220
|
+
id: string | null;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* @since 0.1.0
|
|
224
|
+
*/
|
|
225
|
+
export interface CreateTimerAndroidOptions {
|
|
226
|
+
/**
|
|
227
|
+
* Whether or not to create the timer without showing
|
|
228
|
+
* the user interface of the system clock app.
|
|
229
|
+
*
|
|
230
|
+
* Only available on Android.
|
|
231
|
+
*
|
|
232
|
+
* @since 0.1.0
|
|
233
|
+
* @default false
|
|
234
|
+
*/
|
|
235
|
+
skipUi?: boolean;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @since 0.1.0
|
|
239
|
+
*/
|
|
240
|
+
export interface CreateTimerOptions {
|
|
241
|
+
/**
|
|
242
|
+
* Android-specific options.
|
|
243
|
+
*
|
|
244
|
+
* Only available on Android.
|
|
245
|
+
*
|
|
246
|
+
* @since 0.1.0
|
|
247
|
+
*/
|
|
248
|
+
android?: CreateTimerAndroidOptions;
|
|
249
|
+
/**
|
|
250
|
+
* The length of the timer in seconds (1-86400).
|
|
251
|
+
*
|
|
252
|
+
* @since 0.1.0
|
|
253
|
+
* @example 300
|
|
254
|
+
*/
|
|
255
|
+
duration: number;
|
|
256
|
+
/**
|
|
257
|
+
* The label of the timer.
|
|
258
|
+
*
|
|
259
|
+
* @since 0.1.0
|
|
260
|
+
* @example 'Tea'
|
|
261
|
+
*/
|
|
262
|
+
label?: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* @since 0.1.0
|
|
266
|
+
*/
|
|
267
|
+
export interface GetAlarmsResult {
|
|
268
|
+
/**
|
|
269
|
+
* The alarms that were created by the app.
|
|
270
|
+
*
|
|
271
|
+
* @since 0.1.0
|
|
272
|
+
*/
|
|
273
|
+
alarms: AlarmInfo[];
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @since 0.1.0
|
|
277
|
+
*/
|
|
278
|
+
export interface IsAvailableResult {
|
|
279
|
+
/**
|
|
280
|
+
* Whether or not alarms are available on this device.
|
|
281
|
+
*
|
|
282
|
+
* @since 0.1.0
|
|
283
|
+
* @example true
|
|
284
|
+
*/
|
|
285
|
+
available: boolean;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* @since 0.1.0
|
|
289
|
+
*/
|
|
290
|
+
export interface PermissionStatus {
|
|
291
|
+
/**
|
|
292
|
+
* Permission state of scheduling alarms.
|
|
293
|
+
*
|
|
294
|
+
* @since 0.1.0
|
|
295
|
+
*/
|
|
296
|
+
alarms: PermissionState;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* @since 0.1.0
|
|
300
|
+
*/
|
|
301
|
+
export declare enum ErrorCode {
|
|
302
|
+
/**
|
|
303
|
+
* No app that can handle alarms was found on the device.
|
|
304
|
+
*
|
|
305
|
+
* @since 0.1.0
|
|
306
|
+
*/
|
|
307
|
+
NoClockApp = "NO_CLOCK_APP",
|
|
308
|
+
/**
|
|
309
|
+
* The permission to schedule alarms was denied.
|
|
310
|
+
*
|
|
311
|
+
* @since 0.1.0
|
|
312
|
+
*/
|
|
313
|
+
PermissionDenied = "PERMISSION_DENIED"
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* The days of the week.
|
|
317
|
+
*
|
|
318
|
+
* @since 0.1.0
|
|
319
|
+
*/
|
|
320
|
+
export declare enum Weekday {
|
|
321
|
+
/**
|
|
322
|
+
* @since 0.1.0
|
|
323
|
+
*/
|
|
324
|
+
Friday = "FRIDAY",
|
|
325
|
+
/**
|
|
326
|
+
* @since 0.1.0
|
|
327
|
+
*/
|
|
328
|
+
Monday = "MONDAY",
|
|
329
|
+
/**
|
|
330
|
+
* @since 0.1.0
|
|
331
|
+
*/
|
|
332
|
+
Saturday = "SATURDAY",
|
|
333
|
+
/**
|
|
334
|
+
* @since 0.1.0
|
|
335
|
+
*/
|
|
336
|
+
Sunday = "SUNDAY",
|
|
337
|
+
/**
|
|
338
|
+
* @since 0.1.0
|
|
339
|
+
*/
|
|
340
|
+
Thursday = "THURSDAY",
|
|
341
|
+
/**
|
|
342
|
+
* @since 0.1.0
|
|
343
|
+
*/
|
|
344
|
+
Tuesday = "TUESDAY",
|
|
345
|
+
/**
|
|
346
|
+
* @since 0.1.0
|
|
347
|
+
*/
|
|
348
|
+
Wednesday = "WEDNESDAY"
|
|
349
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 0.1.0
|
|
3
|
+
*/
|
|
4
|
+
export var ErrorCode;
|
|
5
|
+
(function (ErrorCode) {
|
|
6
|
+
/**
|
|
7
|
+
* No app that can handle alarms was found on the device.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
ErrorCode["NoClockApp"] = "NO_CLOCK_APP";
|
|
12
|
+
/**
|
|
13
|
+
* The permission to schedule alarms was denied.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.1.0
|
|
16
|
+
*/
|
|
17
|
+
ErrorCode["PermissionDenied"] = "PERMISSION_DENIED";
|
|
18
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
19
|
+
/**
|
|
20
|
+
* The days of the week.
|
|
21
|
+
*
|
|
22
|
+
* @since 0.1.0
|
|
23
|
+
*/
|
|
24
|
+
export var Weekday;
|
|
25
|
+
(function (Weekday) {
|
|
26
|
+
/**
|
|
27
|
+
* @since 0.1.0
|
|
28
|
+
*/
|
|
29
|
+
Weekday["Friday"] = "FRIDAY";
|
|
30
|
+
/**
|
|
31
|
+
* @since 0.1.0
|
|
32
|
+
*/
|
|
33
|
+
Weekday["Monday"] = "MONDAY";
|
|
34
|
+
/**
|
|
35
|
+
* @since 0.1.0
|
|
36
|
+
*/
|
|
37
|
+
Weekday["Saturday"] = "SATURDAY";
|
|
38
|
+
/**
|
|
39
|
+
* @since 0.1.0
|
|
40
|
+
*/
|
|
41
|
+
Weekday["Sunday"] = "SUNDAY";
|
|
42
|
+
/**
|
|
43
|
+
* @since 0.1.0
|
|
44
|
+
*/
|
|
45
|
+
Weekday["Thursday"] = "THURSDAY";
|
|
46
|
+
/**
|
|
47
|
+
* @since 0.1.0
|
|
48
|
+
*/
|
|
49
|
+
Weekday["Tuesday"] = "TUESDAY";
|
|
50
|
+
/**
|
|
51
|
+
* @since 0.1.0
|
|
52
|
+
*/
|
|
53
|
+
Weekday["Wednesday"] = "WEDNESDAY";
|
|
54
|
+
})(Weekday || (Weekday = {}));
|
|
55
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAqTA;;GAEG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB;;;;OAIG;IACH,wCAA2B,CAAA;IAC3B;;;;OAIG;IACH,mDAAsC,CAAA;AACxC,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,OA6BX;AA7BD,WAAY,OAAO;IACjB;;OAEG;IACH,4BAAiB,CAAA;IACjB;;OAEG;IACH,4BAAiB,CAAA;IACjB;;OAEG;IACH,gCAAqB,CAAA;IACrB;;OAEG;IACH,4BAAiB,CAAA;IACjB;;OAEG;IACH,gCAAqB,CAAA;IACrB;;OAEG;IACH,8BAAmB,CAAA;IACnB;;OAEG;IACH,kCAAuB,CAAA;AACzB,CAAC,EA7BW,OAAO,KAAP,OAAO,QA6BlB","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\nexport interface AlarmPlugin {\n /**\n * Cancel an alarm that was created by the app.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n cancelAlarm(options: CancelAlarmOptions): Promise<void>;\n /**\n * Check permission to schedule alarms.\n *\n * On Android, this method always returns `granted` since\n * alarms are created via the system clock app.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n /**\n * Create a new alarm.\n *\n * On Android, the alarm is created in the system clock app.\n * The app has no access to the created alarm afterwards.\n *\n * On iOS, the alarm is owned by the app and can be listed\n * and canceled using the `getAlarms(...)` and `cancelAlarm(...)`\n * methods.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n createAlarm(options: CreateAlarmOptions): Promise<CreateAlarmResult>;\n /**\n * Create a new countdown timer in the system clock app.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n createTimer(options: CreateTimerOptions): Promise<void>;\n /**\n * Get all alarms that were created by the app.\n *\n * Only available on iOS.\n *\n * @since 0.1.0\n */\n getAlarms(): Promise<GetAlarmsResult>;\n /**\n * Check if alarms are available on this device.\n *\n * On Android, this checks whether an app that can handle\n * alarms is installed. On iOS, this returns `true` if the\n * device runs iOS 26 or later.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n isAvailable(): Promise<IsAvailableResult>;\n /**\n * Open the list of alarms in the system clock app.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n openAlarms(): Promise<void>;\n /**\n * Request permission to schedule alarms.\n *\n * On Android, this method always returns `granted` since\n * alarms are created via the system clock app.\n *\n * Only available on Android and iOS.\n *\n * @since 0.1.0\n */\n requestPermissions(): Promise<PermissionStatus>;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface AlarmInfo {\n /**\n * Whether or not the alarm is active.\n *\n * @since 0.1.0\n * @example true\n */\n enabled: boolean | null;\n /**\n * The hour of the alarm (0-23).\n *\n * @since 0.1.0\n * @example 6\n */\n hour: number | null;\n /**\n * The unique identifier of the alarm.\n *\n * @since 0.1.0\n * @example '2B1A3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'\n */\n id: string;\n /**\n * The label of the alarm.\n *\n * @since 0.1.0\n * @example 'Wake up'\n */\n label: string | null;\n /**\n * The minute of the alarm (0-59).\n *\n * @since 0.1.0\n * @example 30\n */\n minute: number | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface CancelAlarmOptions {\n /**\n * The unique identifier of the alarm to cancel.\n *\n * @since 0.1.0\n * @example '2B1A3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'\n */\n id: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface CreateAlarmAndroidOptions {\n /**\n * Whether or not to create the alarm without showing\n * the user interface of the system clock app.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n * @default false\n */\n skipUi?: boolean;\n /**\n * Whether or not the alarm should vibrate.\n *\n * If not provided, the default behavior of the system\n * clock app is used.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n vibrate?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface CreateAlarmOptions {\n /**\n * Android-specific options.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n android?: CreateAlarmAndroidOptions;\n /**\n * The days of the week on which the alarm repeats.\n *\n * If not provided, the alarm fires once at the next\n * occurrence of the given time.\n *\n * @since 0.1.0\n * @example [Weekday.Monday, Weekday.Friday]\n */\n days?: Weekday[];\n /**\n * The hour of the alarm (0-23).\n *\n * @since 0.1.0\n * @example 6\n */\n hour: number;\n /**\n * The label of the alarm.\n *\n * @since 0.1.0\n * @example 'Wake up'\n */\n label?: string;\n /**\n * The minute of the alarm (0-59).\n *\n * @since 0.1.0\n * @example 30\n */\n minute: number;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface CreateAlarmResult {\n /**\n * The unique identifier of the created alarm.\n *\n * On Android, this is always `null` since the alarm is\n * created in the system clock app.\n *\n * @since 0.1.0\n * @example '2B1A3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D'\n */\n id: string | null;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface CreateTimerAndroidOptions {\n /**\n * Whether or not to create the timer without showing\n * the user interface of the system clock app.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n * @default false\n */\n skipUi?: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface CreateTimerOptions {\n /**\n * Android-specific options.\n *\n * Only available on Android.\n *\n * @since 0.1.0\n */\n android?: CreateTimerAndroidOptions;\n /**\n * The length of the timer in seconds (1-86400).\n *\n * @since 0.1.0\n * @example 300\n */\n duration: number;\n /**\n * The label of the timer.\n *\n * @since 0.1.0\n * @example 'Tea'\n */\n label?: string;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface GetAlarmsResult {\n /**\n * The alarms that were created by the app.\n *\n * @since 0.1.0\n */\n alarms: AlarmInfo[];\n}\n\n/**\n * @since 0.1.0\n */\nexport interface IsAvailableResult {\n /**\n * Whether or not alarms are available on this device.\n *\n * @since 0.1.0\n * @example true\n */\n available: boolean;\n}\n\n/**\n * @since 0.1.0\n */\nexport interface PermissionStatus {\n /**\n * Permission state of scheduling alarms.\n *\n * @since 0.1.0\n */\n alarms: PermissionState;\n}\n\n/**\n * @since 0.1.0\n */\nexport enum ErrorCode {\n /**\n * No app that can handle alarms was found on the device.\n *\n * @since 0.1.0\n */\n NoClockApp = 'NO_CLOCK_APP',\n /**\n * The permission to schedule alarms was denied.\n *\n * @since 0.1.0\n */\n PermissionDenied = 'PERMISSION_DENIED',\n}\n\n/**\n * The days of the week.\n *\n * @since 0.1.0\n */\nexport enum Weekday {\n /**\n * @since 0.1.0\n */\n Friday = 'FRIDAY',\n /**\n * @since 0.1.0\n */\n Monday = 'MONDAY',\n /**\n * @since 0.1.0\n */\n Saturday = 'SATURDAY',\n /**\n * @since 0.1.0\n */\n Sunday = 'SUNDAY',\n /**\n * @since 0.1.0\n */\n Thursday = 'THURSDAY',\n /**\n * @since 0.1.0\n */\n Tuesday = 'TUESDAY',\n /**\n * @since 0.1.0\n */\n Wednesday = 'WEDNESDAY',\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { AlarmPlugin } from './definitions';\n\nconst Alarm = registerPlugin<AlarmPlugin>('Alarm', {\n web: () => import('./web').then(m => new m.AlarmWeb()),\n});\n\nexport * from './definitions';\nexport { Alarm };\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { AlarmPlugin, CancelAlarmOptions, CreateAlarmOptions, CreateAlarmResult, CreateTimerOptions, GetAlarmsResult, IsAvailableResult, PermissionStatus } from './definitions';
|
|
3
|
+
export declare class AlarmWeb extends WebPlugin implements AlarmPlugin {
|
|
4
|
+
cancelAlarm(_options: CancelAlarmOptions): Promise<void>;
|
|
5
|
+
checkPermissions(): Promise<PermissionStatus>;
|
|
6
|
+
createAlarm(_options: CreateAlarmOptions): Promise<CreateAlarmResult>;
|
|
7
|
+
createTimer(_options: CreateTimerOptions): Promise<void>;
|
|
8
|
+
getAlarms(): Promise<GetAlarmsResult>;
|
|
9
|
+
isAvailable(): Promise<IsAvailableResult>;
|
|
10
|
+
openAlarms(): Promise<void>;
|
|
11
|
+
requestPermissions(): Promise<PermissionStatus>;
|
|
12
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export class AlarmWeb extends WebPlugin {
|
|
3
|
+
async cancelAlarm(_options) {
|
|
4
|
+
throw this.unimplemented('Not implemented on web.');
|
|
5
|
+
}
|
|
6
|
+
async checkPermissions() {
|
|
7
|
+
throw this.unimplemented('Not implemented on web.');
|
|
8
|
+
}
|
|
9
|
+
async createAlarm(_options) {
|
|
10
|
+
throw this.unimplemented('Not implemented on web.');
|
|
11
|
+
}
|
|
12
|
+
async createTimer(_options) {
|
|
13
|
+
throw this.unimplemented('Not implemented on web.');
|
|
14
|
+
}
|
|
15
|
+
async getAlarms() {
|
|
16
|
+
throw this.unimplemented('Not implemented on web.');
|
|
17
|
+
}
|
|
18
|
+
async isAvailable() {
|
|
19
|
+
throw this.unimplemented('Not implemented on web.');
|
|
20
|
+
}
|
|
21
|
+
async openAlarms() {
|
|
22
|
+
throw this.unimplemented('Not implemented on web.');
|
|
23
|
+
}
|
|
24
|
+
async requestPermissions() {
|
|
25
|
+
throw this.unimplemented('Not implemented on web.');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAa5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC,KAAK,CAAC,WAAW,CAAC,QAA4B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAA4B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAA4B;QAC5C,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n AlarmPlugin,\n CancelAlarmOptions,\n CreateAlarmOptions,\n CreateAlarmResult,\n CreateTimerOptions,\n GetAlarmsResult,\n IsAvailableResult,\n PermissionStatus,\n} from './definitions';\n\nexport class AlarmWeb extends WebPlugin implements AlarmPlugin {\n async cancelAlarm(_options: CancelAlarmOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async createAlarm(_options: CreateAlarmOptions): Promise<CreateAlarmResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async createTimer(_options: CreateTimerOptions): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async getAlarms(): Promise<GetAlarmsResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async isAvailable(): Promise<IsAvailableResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async openAlarms(): Promise<void> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @since 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
exports.ErrorCode = void 0;
|
|
9
|
+
(function (ErrorCode) {
|
|
10
|
+
/**
|
|
11
|
+
* No app that can handle alarms was found on the device.
|
|
12
|
+
*
|
|
13
|
+
* @since 0.1.0
|
|
14
|
+
*/
|
|
15
|
+
ErrorCode["NoClockApp"] = "NO_CLOCK_APP";
|
|
16
|
+
/**
|
|
17
|
+
* The permission to schedule alarms was denied.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
*/
|
|
21
|
+
ErrorCode["PermissionDenied"] = "PERMISSION_DENIED";
|
|
22
|
+
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
23
|
+
/**
|
|
24
|
+
* The days of the week.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
*/
|
|
28
|
+
exports.Weekday = void 0;
|
|
29
|
+
(function (Weekday) {
|
|
30
|
+
/**
|
|
31
|
+
* @since 0.1.0
|
|
32
|
+
*/
|
|
33
|
+
Weekday["Friday"] = "FRIDAY";
|
|
34
|
+
/**
|
|
35
|
+
* @since 0.1.0
|
|
36
|
+
*/
|
|
37
|
+
Weekday["Monday"] = "MONDAY";
|
|
38
|
+
/**
|
|
39
|
+
* @since 0.1.0
|
|
40
|
+
*/
|
|
41
|
+
Weekday["Saturday"] = "SATURDAY";
|
|
42
|
+
/**
|
|
43
|
+
* @since 0.1.0
|
|
44
|
+
*/
|
|
45
|
+
Weekday["Sunday"] = "SUNDAY";
|
|
46
|
+
/**
|
|
47
|
+
* @since 0.1.0
|
|
48
|
+
*/
|
|
49
|
+
Weekday["Thursday"] = "THURSDAY";
|
|
50
|
+
/**
|
|
51
|
+
* @since 0.1.0
|
|
52
|
+
*/
|
|
53
|
+
Weekday["Tuesday"] = "TUESDAY";
|
|
54
|
+
/**
|
|
55
|
+
* @since 0.1.0
|
|
56
|
+
*/
|
|
57
|
+
Weekday["Wednesday"] = "WEDNESDAY";
|
|
58
|
+
})(exports.Weekday || (exports.Weekday = {}));
|
|
59
|
+
|
|
60
|
+
const Alarm = core.registerPlugin('Alarm', {
|
|
61
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AlarmWeb()),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
class AlarmWeb extends core.WebPlugin {
|
|
65
|
+
async cancelAlarm(_options) {
|
|
66
|
+
throw this.unimplemented('Not implemented on web.');
|
|
67
|
+
}
|
|
68
|
+
async checkPermissions() {
|
|
69
|
+
throw this.unimplemented('Not implemented on web.');
|
|
70
|
+
}
|
|
71
|
+
async createAlarm(_options) {
|
|
72
|
+
throw this.unimplemented('Not implemented on web.');
|
|
73
|
+
}
|
|
74
|
+
async createTimer(_options) {
|
|
75
|
+
throw this.unimplemented('Not implemented on web.');
|
|
76
|
+
}
|
|
77
|
+
async getAlarms() {
|
|
78
|
+
throw this.unimplemented('Not implemented on web.');
|
|
79
|
+
}
|
|
80
|
+
async isAvailable() {
|
|
81
|
+
throw this.unimplemented('Not implemented on web.');
|
|
82
|
+
}
|
|
83
|
+
async openAlarms() {
|
|
84
|
+
throw this.unimplemented('Not implemented on web.');
|
|
85
|
+
}
|
|
86
|
+
async requestPermissions() {
|
|
87
|
+
throw this.unimplemented('Not implemented on web.');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
92
|
+
__proto__: null,
|
|
93
|
+
AlarmWeb: AlarmWeb
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
exports.Alarm = Alarm;
|
|
97
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No app that can handle alarms was found on the device.\n *\n * @since 0.1.0\n */\n ErrorCode[\"NoClockApp\"] = \"NO_CLOCK_APP\";\n /**\n * The permission to schedule alarms was denied.\n *\n * @since 0.1.0\n */\n ErrorCode[\"PermissionDenied\"] = \"PERMISSION_DENIED\";\n})(ErrorCode || (ErrorCode = {}));\n/**\n * The days of the week.\n *\n * @since 0.1.0\n */\nexport var Weekday;\n(function (Weekday) {\n /**\n * @since 0.1.0\n */\n Weekday[\"Friday\"] = \"FRIDAY\";\n /**\n * @since 0.1.0\n */\n Weekday[\"Monday\"] = \"MONDAY\";\n /**\n * @since 0.1.0\n */\n Weekday[\"Saturday\"] = \"SATURDAY\";\n /**\n * @since 0.1.0\n */\n Weekday[\"Sunday\"] = \"SUNDAY\";\n /**\n * @since 0.1.0\n */\n Weekday[\"Thursday\"] = \"THURSDAY\";\n /**\n * @since 0.1.0\n */\n Weekday[\"Tuesday\"] = \"TUESDAY\";\n /**\n * @since 0.1.0\n */\n Weekday[\"Wednesday\"] = \"WEDNESDAY\";\n})(Weekday || (Weekday = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst Alarm = registerPlugin('Alarm', {\n web: () => import('./web').then(m => new m.AlarmWeb()),\n});\nexport * from './definitions';\nexport { Alarm };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AlarmWeb extends WebPlugin {\n async cancelAlarm(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async checkPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n async createAlarm(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async createTimer(_options) {\n throw this.unimplemented('Not implemented on web.');\n }\n async getAlarms() {\n throw this.unimplemented('Not implemented on web.');\n }\n async isAvailable() {\n throw this.unimplemented('Not implemented on web.');\n }\n async openAlarms() {\n throw this.unimplemented('Not implemented on web.');\n }\n async requestPermissions() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","Weekday","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,YAAY,CAAC,GAAG,cAAc;AAC5C;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,kBAAkB,CAAC,GAAG,mBAAmB;AACvD,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACWC;AACX,CAAC,UAAU,OAAO,EAAE;AACpB;AACA;AACA;AACA,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;AAChC;AACA;AACA;AACA,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;AAChC;AACA;AACA;AACA,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU;AACpC;AACA;AACA;AACA,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;AAChC;AACA;AACA;AACA,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU;AACpC;AACA;AACA;AACA,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS;AAClC;AACA;AACA;AACA,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW;AACtC,CAAC,EAAEA,eAAO,KAAKA,eAAO,GAAG,EAAE,CAAC,CAAC;;ACpDxB,MAAC,KAAK,GAAGC,mBAAc,CAAC,OAAO,EAAE;AACtC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC1D,CAAC;;ACFM,MAAM,QAAQ,SAASC,cAAS,CAAC;AACxC,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,SAAS,GAAG;AACtB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
var capacitorAlarm = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.1.0
|
|
6
|
+
*/
|
|
7
|
+
exports.ErrorCode = void 0;
|
|
8
|
+
(function (ErrorCode) {
|
|
9
|
+
/**
|
|
10
|
+
* No app that can handle alarms was found on the device.
|
|
11
|
+
*
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
*/
|
|
14
|
+
ErrorCode["NoClockApp"] = "NO_CLOCK_APP";
|
|
15
|
+
/**
|
|
16
|
+
* The permission to schedule alarms was denied.
|
|
17
|
+
*
|
|
18
|
+
* @since 0.1.0
|
|
19
|
+
*/
|
|
20
|
+
ErrorCode["PermissionDenied"] = "PERMISSION_DENIED";
|
|
21
|
+
})(exports.ErrorCode || (exports.ErrorCode = {}));
|
|
22
|
+
/**
|
|
23
|
+
* The days of the week.
|
|
24
|
+
*
|
|
25
|
+
* @since 0.1.0
|
|
26
|
+
*/
|
|
27
|
+
exports.Weekday = void 0;
|
|
28
|
+
(function (Weekday) {
|
|
29
|
+
/**
|
|
30
|
+
* @since 0.1.0
|
|
31
|
+
*/
|
|
32
|
+
Weekday["Friday"] = "FRIDAY";
|
|
33
|
+
/**
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
Weekday["Monday"] = "MONDAY";
|
|
37
|
+
/**
|
|
38
|
+
* @since 0.1.0
|
|
39
|
+
*/
|
|
40
|
+
Weekday["Saturday"] = "SATURDAY";
|
|
41
|
+
/**
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
*/
|
|
44
|
+
Weekday["Sunday"] = "SUNDAY";
|
|
45
|
+
/**
|
|
46
|
+
* @since 0.1.0
|
|
47
|
+
*/
|
|
48
|
+
Weekday["Thursday"] = "THURSDAY";
|
|
49
|
+
/**
|
|
50
|
+
* @since 0.1.0
|
|
51
|
+
*/
|
|
52
|
+
Weekday["Tuesday"] = "TUESDAY";
|
|
53
|
+
/**
|
|
54
|
+
* @since 0.1.0
|
|
55
|
+
*/
|
|
56
|
+
Weekday["Wednesday"] = "WEDNESDAY";
|
|
57
|
+
})(exports.Weekday || (exports.Weekday = {}));
|
|
58
|
+
|
|
59
|
+
const Alarm = core.registerPlugin('Alarm', {
|
|
60
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AlarmWeb()),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
class AlarmWeb extends core.WebPlugin {
|
|
64
|
+
async cancelAlarm(_options) {
|
|
65
|
+
throw this.unimplemented('Not implemented on web.');
|
|
66
|
+
}
|
|
67
|
+
async checkPermissions() {
|
|
68
|
+
throw this.unimplemented('Not implemented on web.');
|
|
69
|
+
}
|
|
70
|
+
async createAlarm(_options) {
|
|
71
|
+
throw this.unimplemented('Not implemented on web.');
|
|
72
|
+
}
|
|
73
|
+
async createTimer(_options) {
|
|
74
|
+
throw this.unimplemented('Not implemented on web.');
|
|
75
|
+
}
|
|
76
|
+
async getAlarms() {
|
|
77
|
+
throw this.unimplemented('Not implemented on web.');
|
|
78
|
+
}
|
|
79
|
+
async isAvailable() {
|
|
80
|
+
throw this.unimplemented('Not implemented on web.');
|
|
81
|
+
}
|
|
82
|
+
async openAlarms() {
|
|
83
|
+
throw this.unimplemented('Not implemented on web.');
|
|
84
|
+
}
|
|
85
|
+
async requestPermissions() {
|
|
86
|
+
throw this.unimplemented('Not implemented on web.');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
91
|
+
__proto__: null,
|
|
92
|
+
AlarmWeb: AlarmWeb
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
exports.Alarm = Alarm;
|
|
96
|
+
|
|
97
|
+
return exports;
|
|
98
|
+
|
|
99
|
+
})({}, capacitorExports);
|
|
100
|
+
//# sourceMappingURL=plugin.js.map
|