@cap-kit/settings 8.0.0-next.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/CapKitSettings.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +29 -0
- package/README.md +428 -0
- package/android/build.gradle +103 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/io/capkit/settings/SettingsConfig.kt +39 -0
- package/android/src/main/java/io/capkit/settings/SettingsImpl.kt +95 -0
- package/android/src/main/java/io/capkit/settings/SettingsPlugin.kt +91 -0
- package/android/src/main/java/io/capkit/settings/utils/SettingsLogger.kt +85 -0
- package/android/src/main/java/io/capkit/settings/utils/SettingsUtils.kt +75 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +877 -0
- package/dist/esm/definitions.d.ts +686 -0
- package/dist/esm/definitions.js +423 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +16 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +43 -0
- package/dist/esm/web.js +68 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +516 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +519 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/SettingsPlugin/SettingsConfig.swift +54 -0
- package/ios/Sources/SettingsPlugin/SettingsImpl.swift +84 -0
- package/ios/Sources/SettingsPlugin/SettingsPlugin.swift +103 -0
- package/ios/Sources/SettingsPlugin/Utils/SettingsLogger.swift +57 -0
- package/ios/Sources/SettingsPlugin/Utils/SettingsUtils.swift +70 -0
- package/ios/Sources/SettingsPlugin/Version.swift +16 -0
- package/ios/Tests/SettingsPluginTests/SettingsPluginTests.swift +21 -0
- package/package.json +98 -0
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
/// <reference types="@capacitor/cli" />
|
|
2
|
+
/**
|
|
3
|
+
* Standardized error codes used by the Settings plugin.
|
|
4
|
+
*
|
|
5
|
+
* These codes are returned as part of structured error objects
|
|
6
|
+
* and allow consumers to implement programmatic error handling.
|
|
7
|
+
*
|
|
8
|
+
* Note:
|
|
9
|
+
* On iOS (Swift Package Manager), errors are returned as data
|
|
10
|
+
* objects rather than rejected Promises.
|
|
11
|
+
*
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
export var SettingsErrorCode;
|
|
15
|
+
(function (SettingsErrorCode) {
|
|
16
|
+
/** The device does not have the requested hardware. */
|
|
17
|
+
SettingsErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
|
|
18
|
+
/** The user denied the permission or the feature is disabled in settings. */
|
|
19
|
+
SettingsErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
|
|
20
|
+
/** The Settings plugin failed to initialize (e.g., runtime error or Looper failure). */
|
|
21
|
+
SettingsErrorCode["INIT_FAILED"] = "INIT_FAILED";
|
|
22
|
+
/** The requested Settings plugin type is not valid or not supported by the plugin. */
|
|
23
|
+
SettingsErrorCode["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
24
|
+
})(SettingsErrorCode || (SettingsErrorCode = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Enumeration of supported Android system settings.
|
|
27
|
+
*
|
|
28
|
+
* @platform Android
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Android settings are opened via system Intents.
|
|
32
|
+
* Availability depends on:
|
|
33
|
+
*
|
|
34
|
+
* - Android version
|
|
35
|
+
* - device manufacturer (OEM)
|
|
36
|
+
* - system configuration and user restrictions
|
|
37
|
+
*
|
|
38
|
+
* Some intents are not part of the public Android SDK and may not be
|
|
39
|
+
* available on all devices.
|
|
40
|
+
*
|
|
41
|
+
* When a requested settings screen cannot be resolved, the plugin
|
|
42
|
+
* resolves with:
|
|
43
|
+
* `{ success: false, code: SettingsErrorCode.UNAVAILABLE }`
|
|
44
|
+
*
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
*/
|
|
47
|
+
export var AndroidSettings;
|
|
48
|
+
(function (AndroidSettings) {
|
|
49
|
+
/**
|
|
50
|
+
* Opens Accessibility settings.
|
|
51
|
+
*/
|
|
52
|
+
AndroidSettings["Accessibility"] = "accessibility";
|
|
53
|
+
/**
|
|
54
|
+
* Opens the Add Account screen.
|
|
55
|
+
*/
|
|
56
|
+
AndroidSettings["Account"] = "account";
|
|
57
|
+
/**
|
|
58
|
+
* Opens Airplane Mode settings.
|
|
59
|
+
*/
|
|
60
|
+
AndroidSettings["AirplaneMode"] = "airplane_mode";
|
|
61
|
+
/**
|
|
62
|
+
* Opens Access Point Name (APN) settings.
|
|
63
|
+
*/
|
|
64
|
+
AndroidSettings["Apn"] = "apn";
|
|
65
|
+
/**
|
|
66
|
+
* Opens the Application Details screen for the current app.
|
|
67
|
+
*/
|
|
68
|
+
AndroidSettings["ApplicationDetails"] = "application_details";
|
|
69
|
+
/**
|
|
70
|
+
* Opens Application Development settings.
|
|
71
|
+
*
|
|
72
|
+
* Availability depends on developer options being enabled.
|
|
73
|
+
*/
|
|
74
|
+
AndroidSettings["ApplicationDevelopment"] = "application_development";
|
|
75
|
+
/**
|
|
76
|
+
* Opens Application settings.
|
|
77
|
+
*/
|
|
78
|
+
AndroidSettings["Application"] = "application";
|
|
79
|
+
/**
|
|
80
|
+
* Opens app-specific notification settings.
|
|
81
|
+
*/
|
|
82
|
+
AndroidSettings["AppNotification"] = "app_notification";
|
|
83
|
+
/**
|
|
84
|
+
* Opens Battery Optimization settings.
|
|
85
|
+
*
|
|
86
|
+
* Allows managing apps excluded from battery optimizations.
|
|
87
|
+
*/
|
|
88
|
+
AndroidSettings["BatteryOptimization"] = "battery_optimization";
|
|
89
|
+
/**
|
|
90
|
+
* Opens Bluetooth settings.
|
|
91
|
+
*/
|
|
92
|
+
AndroidSettings["Bluetooth"] = "bluetooth";
|
|
93
|
+
/**
|
|
94
|
+
* Opens Captioning settings.
|
|
95
|
+
*/
|
|
96
|
+
AndroidSettings["Captioning"] = "captioning";
|
|
97
|
+
/**
|
|
98
|
+
* Opens Cast device settings.
|
|
99
|
+
*/
|
|
100
|
+
AndroidSettings["Cast"] = "cast";
|
|
101
|
+
/**
|
|
102
|
+
* Opens Data Roaming settings.
|
|
103
|
+
*/
|
|
104
|
+
AndroidSettings["DataRoaming"] = "data_roaming";
|
|
105
|
+
/**
|
|
106
|
+
* Opens Date & Time settings.
|
|
107
|
+
*/
|
|
108
|
+
AndroidSettings["Date"] = "date";
|
|
109
|
+
/**
|
|
110
|
+
* Opens Display settings.
|
|
111
|
+
*/
|
|
112
|
+
AndroidSettings["Display"] = "display";
|
|
113
|
+
/**
|
|
114
|
+
* Opens Dream (Daydream / Screensaver) settings.
|
|
115
|
+
*/
|
|
116
|
+
AndroidSettings["Dream"] = "dream";
|
|
117
|
+
/**
|
|
118
|
+
* Opens Home app selection settings.
|
|
119
|
+
*/
|
|
120
|
+
AndroidSettings["Home"] = "home";
|
|
121
|
+
/**
|
|
122
|
+
* Opens Input Method (Keyboard) settings.
|
|
123
|
+
*/
|
|
124
|
+
AndroidSettings["Keyboard"] = "keyboard";
|
|
125
|
+
/**
|
|
126
|
+
* Opens Input Method Subtype settings.
|
|
127
|
+
*/
|
|
128
|
+
AndroidSettings["KeyboardSubType"] = "keyboard_subtype";
|
|
129
|
+
/**
|
|
130
|
+
* Opens Language & Input (Locale) settings.
|
|
131
|
+
*/
|
|
132
|
+
AndroidSettings["Locale"] = "locale";
|
|
133
|
+
/**
|
|
134
|
+
* Opens Location Services settings.
|
|
135
|
+
*/
|
|
136
|
+
AndroidSettings["Location"] = "location";
|
|
137
|
+
/**
|
|
138
|
+
* Opens Manage Applications settings.
|
|
139
|
+
*/
|
|
140
|
+
AndroidSettings["ManageApplications"] = "manage_applications";
|
|
141
|
+
/**
|
|
142
|
+
* Opens Manage All Applications settings.
|
|
143
|
+
*
|
|
144
|
+
* Availability depends on Android version and OEM.
|
|
145
|
+
*/
|
|
146
|
+
AndroidSettings["ManageAllApplications"] = "manage_all_applications";
|
|
147
|
+
/**
|
|
148
|
+
* Show settings for memory card storage
|
|
149
|
+
*/
|
|
150
|
+
AndroidSettings["MemoryCard"] = "memory_card";
|
|
151
|
+
/**
|
|
152
|
+
* Opens Network Operator settings.
|
|
153
|
+
*/
|
|
154
|
+
AndroidSettings["Network"] = "network";
|
|
155
|
+
/**
|
|
156
|
+
* Opens NFC settings.
|
|
157
|
+
*/
|
|
158
|
+
AndroidSettings["Nfc"] = "nfc";
|
|
159
|
+
/**
|
|
160
|
+
* Opens NFC Sharing settings.
|
|
161
|
+
*/
|
|
162
|
+
AndroidSettings["NfcSharing"] = "nfcsharing";
|
|
163
|
+
/**
|
|
164
|
+
* Opens NFC Payment settings.
|
|
165
|
+
*/
|
|
166
|
+
AndroidSettings["NfcPayment"] = "nfc_payment";
|
|
167
|
+
/**
|
|
168
|
+
* Opens Print settings.
|
|
169
|
+
*/
|
|
170
|
+
AndroidSettings["Print"] = "print";
|
|
171
|
+
/**
|
|
172
|
+
* Opens Privacy settings.
|
|
173
|
+
*/
|
|
174
|
+
AndroidSettings["Privacy"] = "privacy";
|
|
175
|
+
/**
|
|
176
|
+
* Opens Quick Launch settings.
|
|
177
|
+
*/
|
|
178
|
+
AndroidSettings["QuickLaunch"] = "quick_launch";
|
|
179
|
+
/**
|
|
180
|
+
* Opens Search settings.
|
|
181
|
+
*/
|
|
182
|
+
AndroidSettings["Search"] = "search";
|
|
183
|
+
/**
|
|
184
|
+
* Opens Security settings.
|
|
185
|
+
*/
|
|
186
|
+
AndroidSettings["Security"] = "security";
|
|
187
|
+
/**
|
|
188
|
+
* Opens the main System Settings screen.
|
|
189
|
+
*/
|
|
190
|
+
AndroidSettings["Settings"] = "settings";
|
|
191
|
+
/**
|
|
192
|
+
* Opens Regulatory Information screen.
|
|
193
|
+
*/
|
|
194
|
+
AndroidSettings["ShowRegulatoryInfo"] = "show_regulatory_info";
|
|
195
|
+
/**
|
|
196
|
+
* Opens Sound & Volume settings.
|
|
197
|
+
*/
|
|
198
|
+
AndroidSettings["Sound"] = "sound";
|
|
199
|
+
/**
|
|
200
|
+
* Opens Internal Storage settings.
|
|
201
|
+
*/
|
|
202
|
+
AndroidSettings["Storage"] = "storage";
|
|
203
|
+
/**
|
|
204
|
+
* Opens Sync settings.
|
|
205
|
+
*/
|
|
206
|
+
AndroidSettings["Sync"] = "sync";
|
|
207
|
+
/**
|
|
208
|
+
* Opens Text-to-Speech (TTS) settings.
|
|
209
|
+
*
|
|
210
|
+
* Uses a non-public intent on some devices.
|
|
211
|
+
*/
|
|
212
|
+
AndroidSettings["TextToSpeech"] = "text_to_speech";
|
|
213
|
+
/**
|
|
214
|
+
* Opens Usage Access settings.
|
|
215
|
+
*
|
|
216
|
+
* Allows managing apps with access to usage data.
|
|
217
|
+
*/
|
|
218
|
+
AndroidSettings["Usage"] = "usage";
|
|
219
|
+
/**
|
|
220
|
+
* Opens User Dictionary settings.
|
|
221
|
+
*/
|
|
222
|
+
AndroidSettings["UserDictionary"] = "user_dictionary";
|
|
223
|
+
/**
|
|
224
|
+
* Opens Voice Input settings.
|
|
225
|
+
*/
|
|
226
|
+
AndroidSettings["VoiceInput"] = "voice_input";
|
|
227
|
+
/**
|
|
228
|
+
* Opens VPN settings.
|
|
229
|
+
*/
|
|
230
|
+
AndroidSettings["VPN"] = "vpn";
|
|
231
|
+
/**
|
|
232
|
+
* Opens Wi-Fi settings.
|
|
233
|
+
*/
|
|
234
|
+
AndroidSettings["Wifi"] = "wifi";
|
|
235
|
+
/**
|
|
236
|
+
* Opens Wi-Fi IP settings.
|
|
237
|
+
*
|
|
238
|
+
* Availability varies by device and Android version.
|
|
239
|
+
*/
|
|
240
|
+
AndroidSettings["WifiIp"] = "wifi_ip";
|
|
241
|
+
/**
|
|
242
|
+
* Opens Wireless & Networks settings.
|
|
243
|
+
*/
|
|
244
|
+
AndroidSettings["Wireless"] = "wireless";
|
|
245
|
+
/**
|
|
246
|
+
* Opens Zen Mode (Do Not Disturb) settings.
|
|
247
|
+
*
|
|
248
|
+
* This uses a non-public intent and may not work on all devices.
|
|
249
|
+
*/
|
|
250
|
+
AndroidSettings["ZenMode"] = "zen_mode";
|
|
251
|
+
/**
|
|
252
|
+
* Opens Zen Mode Priority settings.
|
|
253
|
+
*/
|
|
254
|
+
AndroidSettings["ZenModePriority"] = "zen_mode_priority";
|
|
255
|
+
/**
|
|
256
|
+
* Opens Zen Mode Blocked Effects settings.
|
|
257
|
+
*/
|
|
258
|
+
AndroidSettings["ZenModeBlockedEffects"] = "zen_mode_blocked_effects";
|
|
259
|
+
})(AndroidSettings || (AndroidSettings = {}));
|
|
260
|
+
/**
|
|
261
|
+
* Enumeration of supported iOS system settings.
|
|
262
|
+
*
|
|
263
|
+
* @platform iOS
|
|
264
|
+
*
|
|
265
|
+
* @remarks
|
|
266
|
+
* Apple officially supports opening only the app-specific settings screen.
|
|
267
|
+
* All other values rely on undocumented URL schemes and may:
|
|
268
|
+
*
|
|
269
|
+
* - behave differently across iOS versions
|
|
270
|
+
* - stop working in future releases
|
|
271
|
+
* - be restricted during App Store review
|
|
272
|
+
*
|
|
273
|
+
* Availability is best-effort and not guaranteed.
|
|
274
|
+
*
|
|
275
|
+
* @since 1.0.0
|
|
276
|
+
*/
|
|
277
|
+
export var IOSSettings;
|
|
278
|
+
(function (IOSSettings) {
|
|
279
|
+
/**
|
|
280
|
+
* Opens the app-specific settings screen.
|
|
281
|
+
*
|
|
282
|
+
* This is the ONLY settings destination officially supported by Apple
|
|
283
|
+
* and is considered App Store safe.
|
|
284
|
+
*/
|
|
285
|
+
IOSSettings["App"] = "app";
|
|
286
|
+
/**
|
|
287
|
+
* Opens the app-specific notification settings.
|
|
288
|
+
*
|
|
289
|
+
* - iOS 16+: opens the dedicated notification settings screen
|
|
290
|
+
* - iOS <16: falls back to the app settings screen
|
|
291
|
+
*/
|
|
292
|
+
IOSSettings["AppNotification"] = "appNotification";
|
|
293
|
+
/**
|
|
294
|
+
* Opens iOS "About" settings.
|
|
295
|
+
*/
|
|
296
|
+
IOSSettings["About"] = "about";
|
|
297
|
+
/**
|
|
298
|
+
* Opens Auto-Lock settings.
|
|
299
|
+
*/
|
|
300
|
+
IOSSettings["AutoLock"] = "autoLock";
|
|
301
|
+
/**
|
|
302
|
+
* Opens Bluetooth settings.
|
|
303
|
+
*/
|
|
304
|
+
IOSSettings["Bluetooth"] = "bluetooth";
|
|
305
|
+
/**
|
|
306
|
+
* Opens Date & Time settings.
|
|
307
|
+
*/
|
|
308
|
+
IOSSettings["DateTime"] = "dateTime";
|
|
309
|
+
/**
|
|
310
|
+
* Opens FaceTime settings.
|
|
311
|
+
*/
|
|
312
|
+
IOSSettings["FaceTime"] = "facetime";
|
|
313
|
+
/**
|
|
314
|
+
* Opens General settings.
|
|
315
|
+
*/
|
|
316
|
+
IOSSettings["General"] = "general";
|
|
317
|
+
/**
|
|
318
|
+
* Opens Keyboard settings.
|
|
319
|
+
*/
|
|
320
|
+
IOSSettings["Keyboard"] = "keyboard";
|
|
321
|
+
/**
|
|
322
|
+
* Opens iCloud settings.
|
|
323
|
+
*/
|
|
324
|
+
IOSSettings["ICloud"] = "iCloud";
|
|
325
|
+
/**
|
|
326
|
+
* Opens iCloud Storage & Backup settings.
|
|
327
|
+
*/
|
|
328
|
+
IOSSettings["ICloudStorageBackup"] = "iCloudStorageBackup";
|
|
329
|
+
/**
|
|
330
|
+
* Opens Language & Region (International) settings.
|
|
331
|
+
*/
|
|
332
|
+
IOSSettings["International"] = "international";
|
|
333
|
+
/**
|
|
334
|
+
* Opens Location Services settings.
|
|
335
|
+
*/
|
|
336
|
+
IOSSettings["LocationServices"] = "locationServices";
|
|
337
|
+
/**
|
|
338
|
+
* Opens Music settings.
|
|
339
|
+
*/
|
|
340
|
+
IOSSettings["Music"] = "music";
|
|
341
|
+
/**
|
|
342
|
+
* Opens Notes settings.
|
|
343
|
+
*/
|
|
344
|
+
IOSSettings["Notes"] = "notes";
|
|
345
|
+
/**
|
|
346
|
+
* Opens Notifications settings.
|
|
347
|
+
*
|
|
348
|
+
* Note: this is the global notifications screen,
|
|
349
|
+
* not app-specific notifications.
|
|
350
|
+
*/
|
|
351
|
+
IOSSettings["Notifications"] = "notifications";
|
|
352
|
+
/**
|
|
353
|
+
* Opens Phone settings.
|
|
354
|
+
*/
|
|
355
|
+
IOSSettings["Phone"] = "phone";
|
|
356
|
+
/**
|
|
357
|
+
* Opens Photos settings.
|
|
358
|
+
*/
|
|
359
|
+
IOSSettings["Photos"] = "photos";
|
|
360
|
+
/**
|
|
361
|
+
* Opens Managed Configuration profiles list.
|
|
362
|
+
*/
|
|
363
|
+
IOSSettings["ManagedConfigurationList"] = "managedConfigurationList";
|
|
364
|
+
/**
|
|
365
|
+
* Opens Reset settings.
|
|
366
|
+
*/
|
|
367
|
+
IOSSettings["Reset"] = "reset";
|
|
368
|
+
/**
|
|
369
|
+
* Opens Ringtone settings.
|
|
370
|
+
*/
|
|
371
|
+
IOSSettings["Ringtone"] = "ringtone";
|
|
372
|
+
/**
|
|
373
|
+
* Opens Sounds settings.
|
|
374
|
+
*/
|
|
375
|
+
IOSSettings["Sounds"] = "sounds";
|
|
376
|
+
/**
|
|
377
|
+
* Opens Software Update settings.
|
|
378
|
+
*/
|
|
379
|
+
IOSSettings["SoftwareUpdate"] = "softwareUpdate";
|
|
380
|
+
/**
|
|
381
|
+
* Opens App Store settings.
|
|
382
|
+
*/
|
|
383
|
+
IOSSettings["Store"] = "store";
|
|
384
|
+
/**
|
|
385
|
+
* Opens App Tracking Transparency settings.
|
|
386
|
+
*
|
|
387
|
+
* Available on iOS 14+.
|
|
388
|
+
*/
|
|
389
|
+
IOSSettings["Tracking"] = "tracking";
|
|
390
|
+
/**
|
|
391
|
+
* Opens Wallpaper settings.
|
|
392
|
+
*/
|
|
393
|
+
IOSSettings["Wallpaper"] = "wallpaper";
|
|
394
|
+
/**
|
|
395
|
+
* Opens Wi-Fi settings.
|
|
396
|
+
*/
|
|
397
|
+
IOSSettings["WiFi"] = "wifi";
|
|
398
|
+
/**
|
|
399
|
+
* Opens Personal Hotspot (Tethering) settings.
|
|
400
|
+
*/
|
|
401
|
+
IOSSettings["Tethering"] = "tethering";
|
|
402
|
+
/**
|
|
403
|
+
* Opens Do Not Disturb settings.
|
|
404
|
+
*/
|
|
405
|
+
IOSSettings["DoNotDisturb"] = "doNotDisturb";
|
|
406
|
+
/**
|
|
407
|
+
* Opens Touch ID / Passcode settings.
|
|
408
|
+
*/
|
|
409
|
+
IOSSettings["TouchIdPasscode"] = "touchIdPasscode";
|
|
410
|
+
/**
|
|
411
|
+
* Opens Screen Time settings.
|
|
412
|
+
*/
|
|
413
|
+
IOSSettings["ScreenTime"] = "screenTime";
|
|
414
|
+
/**
|
|
415
|
+
* Opens Accessibility settings.
|
|
416
|
+
*/
|
|
417
|
+
IOSSettings["Accessibility"] = "accessibility";
|
|
418
|
+
/**
|
|
419
|
+
* Opens VPN settings.
|
|
420
|
+
*/
|
|
421
|
+
IOSSettings["VPN"] = "vpn";
|
|
422
|
+
})(IOSSettings || (IOSSettings = {}));
|
|
423
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAkDxC;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,uDAAuD;IACvD,gDAA2B,CAAA;IAC3B,6EAA6E;IAC7E,4DAAuC,CAAA;IACvC,wFAAwF;IACxF,gDAA2B,CAAA;IAC3B,sFAAsF;IACtF,kDAA6B,CAAA;AAC/B,CAAC,EATW,iBAAiB,KAAjB,iBAAiB,QAS5B;AAmKD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAN,IAAY,eAmQX;AAnQD,WAAY,eAAe;IACzB;;OAEG;IACH,kDAA+B,CAAA;IAE/B;;OAEG;IACH,sCAAmB,CAA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;IACH,8BAAe,CAAA;IAEf;;;;OAIG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;OAEG;IACH,4BAAa,CAAA;IAEb;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;OAEG;IACH,4CAA6B,CAAA;IAE7B;;OAEG;IACH,kDAAmC,CAAA;IAEnC;;OAEG;IACH,wCAAyB,CAAA;IAEzB;;OAEG;IACH,8CAA+B,CAAA;IAE/B;;OAEG;IACH,0BAAW,CAAA;AACb,CAAC,EAhLW,WAAW,KAAX,WAAW,QAgLtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* This file exports the Settings and registers it with Capacitor.
|
|
4
|
+
* It acts as the main entry point for accessing the plugin's functionality
|
|
5
|
+
* across different platforms, including web.
|
|
6
|
+
*/
|
|
7
|
+
import { SettingsPlugin } from './definitions';
|
|
8
|
+
/**
|
|
9
|
+
* Main entry point for the Settings Capacitor plugin.
|
|
10
|
+
*
|
|
11
|
+
* This file registers the plugin with Capacitor and exports
|
|
12
|
+
* both the runtime instance and the public TypeScript types.
|
|
13
|
+
*/
|
|
14
|
+
declare const Settings: SettingsPlugin;
|
|
15
|
+
export * from './definitions';
|
|
16
|
+
export { Settings };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* This file exports the Settings and registers it with Capacitor.
|
|
4
|
+
* It acts as the main entry point for accessing the plugin's functionality
|
|
5
|
+
* across different platforms, including web.
|
|
6
|
+
*/
|
|
7
|
+
import { registerPlugin } from '@capacitor/core';
|
|
8
|
+
/**
|
|
9
|
+
* Main entry point for the Settings Capacitor plugin.
|
|
10
|
+
*
|
|
11
|
+
* This file registers the plugin with Capacitor and exports
|
|
12
|
+
* both the runtime instance and the public TypeScript types.
|
|
13
|
+
*/
|
|
14
|
+
const Settings = registerPlugin('Settings', {
|
|
15
|
+
web: () => import('./web').then((m) => new m.SettingsWeb()),
|
|
16
|
+
});
|
|
17
|
+
export * from './definitions';
|
|
18
|
+
export { Settings };
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,cAAc,CAAiB,UAAU,EAAE;IAC1D,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;CAC5D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import { SettingsPlugin, SettingsResult, PluginVersionResult } from './definitions';
|
|
3
|
+
/**
|
|
4
|
+
* Web implementation of the Settings plugin.
|
|
5
|
+
*
|
|
6
|
+
* This implementation exists to satisfy Capacitor's multi-platform contract.
|
|
7
|
+
* Opening native system settings is not supported in web browsers.
|
|
8
|
+
*
|
|
9
|
+
* All methods follow the same state-based result model used on
|
|
10
|
+
* Android and iOS:
|
|
11
|
+
* - operations never throw
|
|
12
|
+
* - Promise rejection is not used
|
|
13
|
+
* - failures are reported via structured result objects
|
|
14
|
+
*/
|
|
15
|
+
export declare class SettingsWeb extends WebPlugin implements SettingsPlugin {
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Attempts to open a platform-specific settings screen.
|
|
19
|
+
*
|
|
20
|
+
* This operation is not supported on the Web, as browsers do not
|
|
21
|
+
* provide APIs to open operating system settings.
|
|
22
|
+
*/
|
|
23
|
+
open(): Promise<SettingsResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Attempts to open an iOS settings screen.
|
|
26
|
+
*
|
|
27
|
+
* This operation is not supported on the Web.
|
|
28
|
+
*/
|
|
29
|
+
openIOS(): Promise<SettingsResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Attempts to open an Android settings screen.
|
|
32
|
+
*
|
|
33
|
+
* This operation is not supported on the Web.
|
|
34
|
+
*/
|
|
35
|
+
openAndroid(): Promise<SettingsResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the plugin version.
|
|
38
|
+
*
|
|
39
|
+
* On the Web, this value represents the JavaScript package version
|
|
40
|
+
* rather than a native implementation.
|
|
41
|
+
*/
|
|
42
|
+
getPluginVersion(): Promise<PluginVersionResult>;
|
|
43
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import { SettingsErrorCode } from './definitions';
|
|
3
|
+
/**
|
|
4
|
+
* Web implementation of the Settings plugin.
|
|
5
|
+
*
|
|
6
|
+
* This implementation exists to satisfy Capacitor's multi-platform contract.
|
|
7
|
+
* Opening native system settings is not supported in web browsers.
|
|
8
|
+
*
|
|
9
|
+
* All methods follow the same state-based result model used on
|
|
10
|
+
* Android and iOS:
|
|
11
|
+
* - operations never throw
|
|
12
|
+
* - Promise rejection is not used
|
|
13
|
+
* - failures are reported via structured result objects
|
|
14
|
+
*/
|
|
15
|
+
export class SettingsWeb extends WebPlugin {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
// --- Open Settings ---
|
|
20
|
+
/**
|
|
21
|
+
* Attempts to open a platform-specific settings screen.
|
|
22
|
+
*
|
|
23
|
+
* This operation is not supported on the Web, as browsers do not
|
|
24
|
+
* provide APIs to open operating system settings.
|
|
25
|
+
*/
|
|
26
|
+
async open() {
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
error: 'Opening system settings is not supported on the Web.',
|
|
30
|
+
code: SettingsErrorCode.UNAVAILABLE,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Attempts to open an iOS settings screen.
|
|
35
|
+
*
|
|
36
|
+
* This operation is not supported on the Web.
|
|
37
|
+
*/
|
|
38
|
+
async openIOS() {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: 'iOS settings are not available in web environments.',
|
|
42
|
+
code: SettingsErrorCode.UNAVAILABLE,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Attempts to open an Android settings screen.
|
|
47
|
+
*
|
|
48
|
+
* This operation is not supported on the Web.
|
|
49
|
+
*/
|
|
50
|
+
async openAndroid() {
|
|
51
|
+
return {
|
|
52
|
+
success: false,
|
|
53
|
+
error: 'Android settings are not available in web environments.',
|
|
54
|
+
code: SettingsErrorCode.UNAVAILABLE,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// --- Plugin Info ---
|
|
58
|
+
/**
|
|
59
|
+
* Returns the plugin version.
|
|
60
|
+
*
|
|
61
|
+
* On the Web, this value represents the JavaScript package version
|
|
62
|
+
* rather than a native implementation.
|
|
63
|
+
*/
|
|
64
|
+
async getPluginVersion() {
|
|
65
|
+
return { version: 'web' };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# 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;AAE5C,OAAO,EAAE,iBAAiB,EAAuD,MAAM,eAAe,CAAC;AAEvG;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IACxC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,wBAAwB;IAExB;;;;;OAKG;IACH,KAAK,CAAC,IAAI;QACR,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,sDAAsD;YAC7D,IAAI,EAAE,iBAAiB,CAAC,WAAW;SACpC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO;QACX,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,qDAAqD;YAC5D,IAAI,EAAE,iBAAiB,CAAC,WAAW;SACpC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW;QACf,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,yDAAyD;YAChE,IAAI,EAAE,iBAAiB,CAAC,WAAW;SACpC,CAAC;IACJ,CAAC;IAED,sBAAsB;IAEtB;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
|