react-native-permission-handler 0.2.1 → 0.3.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/README.md CHANGED
@@ -61,14 +61,25 @@ npm install expo-camera expo-notifications # whichever modules you need
61
61
  import { setDefaultEngine } from "react-native-permission-handler";
62
62
  import { createExpoEngine } from "react-native-permission-handler/expo";
63
63
  import * as Camera from "expo-camera";
64
+ import * as Location from "expo-location";
64
65
  import * as Notifications from "expo-notifications";
65
66
 
66
67
  // Set once at app startup
67
68
  setDefaultEngine(
68
69
  createExpoEngine({
69
70
  permissions: {
70
- camera: Camera,
71
+ // Modules with standard getPermissionsAsync/requestPermissionsAsync work directly
71
72
  notifications: Notifications,
73
+
74
+ // Modules with non-standard names use { get, request }
75
+ camera: {
76
+ get: () => Camera.getCameraPermissionsAsync(),
77
+ request: () => Camera.requestCameraPermissionsAsync(),
78
+ },
79
+ locationForeground: {
80
+ get: () => Location.getForegroundPermissionsAsync(),
81
+ request: () => Location.requestForegroundPermissionsAsync(),
82
+ },
72
83
  },
73
84
  })
74
85
  );
@@ -209,6 +220,9 @@ The main hook. Manages the full permission lifecycle.
209
220
  // Options
210
221
  autoCheck?: boolean; // default: true — check on mount
211
222
  recheckOnForeground?: boolean; // default: false
223
+ requestTimeout?: number; // timeout for request() in ms (opt-in)
224
+ onTimeout?: () => void; // called if request() times out
225
+ debug?: boolean | ((msg: string) => void); // log state transitions
212
226
  }
213
227
  ```
214
228
 
@@ -302,6 +316,9 @@ Orchestrates flows for features needing multiple permissions (e.g., video call =
302
316
 
303
317
  engine?: PermissionEngine; // optional — overrides global/fallback
304
318
  autoCheck?: boolean; // default: true — check all on mount
319
+ requestTimeout?: number; // timeout for request() in ms (opt-in)
320
+ onTimeout?: () => void; // called if any request() times out
321
+ debug?: boolean | ((msg: string) => void); // log state transitions
305
322
  onAllGranted?: () => void;
306
323
  }
307
324
  ```
@@ -464,48 +481,85 @@ You don't need to call this explicitly if `react-native-permissions` is installe
464
481
 
465
482
  ---
466
483
 
467
- ### `Permissions` (cross-platform constants)
484
+ ### `Permissions`
468
485
 
469
- The RNP entry point also exports cross-platform permission constants that resolve to the correct platform-specific string via `Platform.select`:
486
+ The RNP entry point exports permission constants. Cross-platform permissions resolve to the correct platform string at runtime via `Platform.select`:
470
487
 
471
488
  ```typescript
472
489
  import { Permissions } from "react-native-permission-handler/rnp";
473
490
 
474
- Permissions.CAMERA // ios: "ios.permission.CAMERA", android: "android.permission.CAMERA"
475
- Permissions.MICROPHONE // ios: "ios.permission.MICROPHONE", android: "android.permission.RECORD_AUDIO"
476
- Permissions.CONTACTS // ios: "ios.permission.CONTACTS", android: "android.permission.READ_CONTACTS"
477
- Permissions.CALENDARS // ios: "ios.permission.CALENDARS", android: "android.permission.READ_CALENDAR"
491
+ // Cross-platform (resolve per platform)
492
+ Permissions.CAMERA // ios: "ios.permission.CAMERA", android: "android.permission.CAMERA"
493
+ Permissions.MICROPHONE // ios: "ios.permission.MICROPHONE", android: "android.permission.RECORD_AUDIO"
494
+ Permissions.CONTACTS
495
+ Permissions.CALENDARS
496
+ Permissions.CALENDARS_WRITE_ONLY
478
497
  Permissions.LOCATION_WHEN_IN_USE
479
498
  Permissions.LOCATION_ALWAYS
480
499
  Permissions.PHOTO_LIBRARY
481
500
  Permissions.PHOTO_LIBRARY_ADD_ONLY
501
+ Permissions.MEDIA_LIBRARY
482
502
  Permissions.BLUETOOTH
483
- Permissions.NOTIFICATIONS // "notifications" (routed to notification-specific APIs by the engine)
503
+ Permissions.SPEECH_RECOGNITION
504
+ Permissions.MOTION
505
+ Permissions.NOTIFICATIONS // "notifications" (routed to notification-specific APIs)
506
+
507
+ // iOS-only
508
+ Permissions.IOS.APP_TRACKING_TRANSPARENCY
509
+ Permissions.IOS.FACE_ID
510
+ Permissions.IOS.REMINDERS
511
+ Permissions.IOS.SIRI
512
+ Permissions.IOS.STOREKIT
513
+
514
+ // Android-only
515
+ Permissions.ANDROID.BODY_SENSORS
516
+ Permissions.ANDROID.CALL_PHONE
517
+ Permissions.ANDROID.READ_SMS
518
+ Permissions.ANDROID.BLUETOOTH_SCAN
519
+ Permissions.ANDROID.BLUETOOTH_ADVERTISE
520
+ // ... and 26 more (full list in source)
484
521
  ```
485
522
 
486
- For platform-specific permissions not in this map, pass the raw string directly (e.g., `"ios.permission.FACE_ID"`).
487
-
488
523
  ---
489
524
 
490
525
  ### `createExpoEngine(config)`
491
526
 
492
- Create an engine adapter for Expo permission modules. Pass a map of permission keys to Expo modules.
527
+ Create an engine adapter for Expo permission modules. Each permission entry can be either:
528
+ - A module with standard `getPermissionsAsync`/`requestPermissionsAsync` methods
529
+ - An explicit `{ get, request }` pair for modules with non-standard method names
493
530
 
494
531
  ```typescript
495
532
  import { createExpoEngine } from "react-native-permission-handler/expo";
496
533
  import * as Camera from "expo-camera";
497
534
  import * as Location from "expo-location";
498
535
  import * as Notifications from "expo-notifications";
536
+ import * as Contacts from "expo-contacts";
499
537
 
500
538
  const engine = createExpoEngine({
501
539
  permissions: {
502
- camera: Camera,
503
- location: Location,
540
+ // Standard modules — pass directly
504
541
  notifications: Notifications,
542
+ contacts: Contacts,
543
+
544
+ // Non-standard method names — use { get, request }
545
+ camera: {
546
+ get: () => Camera.getCameraPermissionsAsync(),
547
+ request: () => Camera.requestCameraPermissionsAsync(),
548
+ },
549
+ microphone: {
550
+ get: () => Camera.getMicrophonePermissionsAsync(),
551
+ request: () => Camera.requestMicrophonePermissionsAsync(),
552
+ },
553
+ locationForeground: {
554
+ get: () => Location.getForegroundPermissionsAsync(),
555
+ request: () => Location.requestForegroundPermissionsAsync(),
556
+ },
557
+ locationBackground: {
558
+ get: () => Location.getBackgroundPermissionsAsync(),
559
+ request: () => Location.requestBackgroundPermissionsAsync(),
560
+ },
505
561
  },
506
562
  });
507
-
508
- setDefaultEngine(engine);
509
563
  ```
510
564
 
511
565
  The adapter maps Expo's `{ status, canAskAgain }` response to the library's `PermissionStatus`:
@@ -538,6 +592,44 @@ The engine is responsible for:
538
592
  - Handling special cases like notifications internally
539
593
  - Opening the correct settings screen
540
594
 
595
+ ## Debugging & Reliability
596
+
597
+ ### Request Timeout
598
+
599
+ On Android 16, `request()` can hang indefinitely when a permission is in `never_ask_again` state ([facebook/react-native#53887](https://github.com/facebook/react-native/issues/53887)). Enable `requestTimeout` to recover:
600
+
601
+ ```tsx
602
+ const camera = usePermissionHandler({
603
+ permission: Permissions.CAMERA,
604
+ requestTimeout: 15000, // 15 seconds
605
+ onTimeout: () => console.warn("Permission request timed out"),
606
+ prePrompt: { title: "Camera", message: "..." },
607
+ blockedPrompt: { title: "Blocked", message: "..." },
608
+ });
609
+ ```
610
+
611
+ On timeout, the hook transitions to `blockedPrompt` (since the hanging bug only occurs for already-blocked permissions) and fires `onTimeout`.
612
+
613
+ ### Debug Logging
614
+
615
+ Enable `debug` to log state transitions — useful for bug reports and support workflows:
616
+
617
+ ```tsx
618
+ const camera = usePermissionHandler({
619
+ permission: Permissions.CAMERA,
620
+ debug: true,
621
+ // ...
622
+ });
623
+ // Console: [permission-handler] camera: idle → checking (CHECK)
624
+ // Console: [permission-handler] camera: checking → prePrompt (CHECK_RESULT:denied)
625
+ ```
626
+
627
+ Pass a function to route logs to your own logger:
628
+
629
+ ```tsx
630
+ debug: (msg) => Sentry.addBreadcrumb({ message: msg, category: "permissions" })
631
+ ```
632
+
541
633
  ## Platform Notes
542
634
 
543
635
  **iOS:**
@@ -0,0 +1,127 @@
1
+ import {
2
+ __esm,
3
+ __export
4
+ } from "./chunk-NFEGQTCC.mjs";
5
+
6
+ // src/engines/rnp.ts
7
+ var rnp_exports = {};
8
+ __export(rnp_exports, {
9
+ Permissions: () => Permissions,
10
+ createRNPEngine: () => createRNPEngine
11
+ });
12
+ import { Platform } from "react-native";
13
+ import {
14
+ check,
15
+ checkNotifications,
16
+ openSettings,
17
+ request,
18
+ requestNotifications
19
+ } from "react-native-permissions";
20
+ function p(ios, android) {
21
+ return Platform.select({ ios, android, default: ios }) ?? ios;
22
+ }
23
+ function createRNPEngine() {
24
+ return {
25
+ async check(permission) {
26
+ if (permission === "notifications") {
27
+ const result = await checkNotifications();
28
+ return result.status;
29
+ }
30
+ return await check(permission);
31
+ },
32
+ async request(permission) {
33
+ if (permission === "notifications") {
34
+ const result = await requestNotifications(["alert", "badge", "sound"]);
35
+ return result.status;
36
+ }
37
+ return await request(permission);
38
+ },
39
+ async openSettings() {
40
+ await openSettings();
41
+ }
42
+ };
43
+ }
44
+ var Permissions;
45
+ var init_rnp = __esm({
46
+ "src/engines/rnp.ts"() {
47
+ Permissions = {
48
+ // Cross-platform
49
+ CAMERA: p("ios.permission.CAMERA", "android.permission.CAMERA"),
50
+ MICROPHONE: p("ios.permission.MICROPHONE", "android.permission.RECORD_AUDIO"),
51
+ CONTACTS: p("ios.permission.CONTACTS", "android.permission.READ_CONTACTS"),
52
+ CALENDARS: p("ios.permission.CALENDARS", "android.permission.READ_CALENDAR"),
53
+ CALENDARS_WRITE_ONLY: p(
54
+ "ios.permission.CALENDARS_WRITE_ONLY",
55
+ "android.permission.WRITE_CALENDAR"
56
+ ),
57
+ LOCATION_WHEN_IN_USE: p(
58
+ "ios.permission.LOCATION_WHEN_IN_USE",
59
+ "android.permission.ACCESS_FINE_LOCATION"
60
+ ),
61
+ LOCATION_ALWAYS: p(
62
+ "ios.permission.LOCATION_ALWAYS",
63
+ "android.permission.ACCESS_BACKGROUND_LOCATION"
64
+ ),
65
+ PHOTO_LIBRARY: p("ios.permission.PHOTO_LIBRARY", "android.permission.READ_MEDIA_IMAGES"),
66
+ PHOTO_LIBRARY_ADD_ONLY: p(
67
+ "ios.permission.PHOTO_LIBRARY_ADD_ONLY",
68
+ "android.permission.WRITE_EXTERNAL_STORAGE"
69
+ ),
70
+ MEDIA_LIBRARY: p("ios.permission.MEDIA_LIBRARY", "android.permission.READ_MEDIA_AUDIO"),
71
+ BLUETOOTH: p("ios.permission.BLUETOOTH", "android.permission.BLUETOOTH_CONNECT"),
72
+ SPEECH_RECOGNITION: p("ios.permission.SPEECH_RECOGNITION", "android.permission.RECORD_AUDIO"),
73
+ MOTION: p("ios.permission.MOTION", "android.permission.ACTIVITY_RECOGNITION"),
74
+ NOTIFICATIONS: "notifications",
75
+ // iOS-only
76
+ IOS: {
77
+ APP_TRACKING_TRANSPARENCY: "ios.permission.APP_TRACKING_TRANSPARENCY",
78
+ FACE_ID: "ios.permission.FACE_ID",
79
+ REMINDERS: "ios.permission.REMINDERS",
80
+ SIRI: "ios.permission.SIRI",
81
+ STOREKIT: "ios.permission.STOREKIT"
82
+ },
83
+ // Android-only
84
+ ANDROID: {
85
+ ACCEPT_HANDOVER: "android.permission.ACCEPT_HANDOVER",
86
+ ACCESS_COARSE_LOCATION: "android.permission.ACCESS_COARSE_LOCATION",
87
+ ACCESS_MEDIA_LOCATION: "android.permission.ACCESS_MEDIA_LOCATION",
88
+ ADD_VOICEMAIL: "com.android.voicemail.permission.ADD_VOICEMAIL",
89
+ ANSWER_PHONE_CALLS: "android.permission.ANSWER_PHONE_CALLS",
90
+ BLUETOOTH_ADVERTISE: "android.permission.BLUETOOTH_ADVERTISE",
91
+ BLUETOOTH_SCAN: "android.permission.BLUETOOTH_SCAN",
92
+ BODY_SENSORS: "android.permission.BODY_SENSORS",
93
+ BODY_SENSORS_BACKGROUND: "android.permission.BODY_SENSORS_BACKGROUND",
94
+ CALL_PHONE: "android.permission.CALL_PHONE",
95
+ GET_ACCOUNTS: "android.permission.GET_ACCOUNTS",
96
+ NEARBY_WIFI_DEVICES: "android.permission.NEARBY_WIFI_DEVICES",
97
+ PROCESS_OUTGOING_CALLS: "android.permission.PROCESS_OUTGOING_CALLS",
98
+ READ_CALL_LOG: "android.permission.READ_CALL_LOG",
99
+ READ_EXTERNAL_STORAGE: "android.permission.READ_EXTERNAL_STORAGE",
100
+ READ_MEDIA_AUDIO: "android.permission.READ_MEDIA_AUDIO",
101
+ READ_MEDIA_IMAGES: "android.permission.READ_MEDIA_IMAGES",
102
+ READ_MEDIA_VIDEO: "android.permission.READ_MEDIA_VIDEO",
103
+ READ_MEDIA_VISUAL_USER_SELECTED: "android.permission.READ_MEDIA_VISUAL_USER_SELECTED",
104
+ READ_PHONE_NUMBERS: "android.permission.READ_PHONE_NUMBERS",
105
+ READ_PHONE_STATE: "android.permission.READ_PHONE_STATE",
106
+ READ_SMS: "android.permission.READ_SMS",
107
+ RECEIVE_MMS: "android.permission.RECEIVE_MMS",
108
+ RECEIVE_SMS: "android.permission.RECEIVE_SMS",
109
+ RECEIVE_WAP_PUSH: "android.permission.RECEIVE_WAP_PUSH",
110
+ SEND_SMS: "android.permission.SEND_SMS",
111
+ USE_SIP: "android.permission.USE_SIP",
112
+ UWB_RANGING: "android.permission.UWB_RANGING",
113
+ WRITE_CALL_LOG: "android.permission.WRITE_CALL_LOG",
114
+ WRITE_CONTACTS: "android.permission.WRITE_CONTACTS",
115
+ WRITE_EXTERNAL_STORAGE: "android.permission.WRITE_EXTERNAL_STORAGE"
116
+ }
117
+ };
118
+ }
119
+ });
120
+
121
+ export {
122
+ Permissions,
123
+ createRNPEngine,
124
+ rnp_exports,
125
+ init_rnp
126
+ };
127
+ //# sourceMappingURL=chunk-FJ23EV7L.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/engines/rnp.ts"],"sourcesContent":["import { Platform } from \"react-native\";\nimport {\n type Permission,\n check,\n checkNotifications,\n openSettings,\n request,\n requestNotifications,\n} from \"react-native-permissions\";\nimport type { PermissionEngine, PermissionStatus } from \"../types\";\n\nfunction p(ios: string, android: string): string {\n return Platform.select({ ios, android, default: ios }) ?? ios;\n}\n\n/**\n * Cross-platform permission constants that resolve to the correct\n * platform-specific string at runtime via Platform.select.\n */\nexport const Permissions = {\n // Cross-platform\n CAMERA: p(\"ios.permission.CAMERA\", \"android.permission.CAMERA\"),\n MICROPHONE: p(\"ios.permission.MICROPHONE\", \"android.permission.RECORD_AUDIO\"),\n CONTACTS: p(\"ios.permission.CONTACTS\", \"android.permission.READ_CONTACTS\"),\n CALENDARS: p(\"ios.permission.CALENDARS\", \"android.permission.READ_CALENDAR\"),\n CALENDARS_WRITE_ONLY: p(\n \"ios.permission.CALENDARS_WRITE_ONLY\",\n \"android.permission.WRITE_CALENDAR\",\n ),\n LOCATION_WHEN_IN_USE: p(\n \"ios.permission.LOCATION_WHEN_IN_USE\",\n \"android.permission.ACCESS_FINE_LOCATION\",\n ),\n LOCATION_ALWAYS: p(\n \"ios.permission.LOCATION_ALWAYS\",\n \"android.permission.ACCESS_BACKGROUND_LOCATION\",\n ),\n PHOTO_LIBRARY: p(\"ios.permission.PHOTO_LIBRARY\", \"android.permission.READ_MEDIA_IMAGES\"),\n PHOTO_LIBRARY_ADD_ONLY: p(\n \"ios.permission.PHOTO_LIBRARY_ADD_ONLY\",\n \"android.permission.WRITE_EXTERNAL_STORAGE\",\n ),\n MEDIA_LIBRARY: p(\"ios.permission.MEDIA_LIBRARY\", \"android.permission.READ_MEDIA_AUDIO\"),\n BLUETOOTH: p(\"ios.permission.BLUETOOTH\", \"android.permission.BLUETOOTH_CONNECT\"),\n SPEECH_RECOGNITION: p(\"ios.permission.SPEECH_RECOGNITION\", \"android.permission.RECORD_AUDIO\"),\n MOTION: p(\"ios.permission.MOTION\", \"android.permission.ACTIVITY_RECOGNITION\"),\n NOTIFICATIONS: \"notifications\",\n\n // iOS-only\n IOS: {\n APP_TRACKING_TRANSPARENCY: \"ios.permission.APP_TRACKING_TRANSPARENCY\",\n FACE_ID: \"ios.permission.FACE_ID\",\n REMINDERS: \"ios.permission.REMINDERS\",\n SIRI: \"ios.permission.SIRI\",\n STOREKIT: \"ios.permission.STOREKIT\",\n },\n\n // Android-only\n ANDROID: {\n ACCEPT_HANDOVER: \"android.permission.ACCEPT_HANDOVER\",\n ACCESS_COARSE_LOCATION: \"android.permission.ACCESS_COARSE_LOCATION\",\n ACCESS_MEDIA_LOCATION: \"android.permission.ACCESS_MEDIA_LOCATION\",\n ADD_VOICEMAIL: \"com.android.voicemail.permission.ADD_VOICEMAIL\",\n ANSWER_PHONE_CALLS: \"android.permission.ANSWER_PHONE_CALLS\",\n BLUETOOTH_ADVERTISE: \"android.permission.BLUETOOTH_ADVERTISE\",\n BLUETOOTH_SCAN: \"android.permission.BLUETOOTH_SCAN\",\n BODY_SENSORS: \"android.permission.BODY_SENSORS\",\n BODY_SENSORS_BACKGROUND: \"android.permission.BODY_SENSORS_BACKGROUND\",\n CALL_PHONE: \"android.permission.CALL_PHONE\",\n GET_ACCOUNTS: \"android.permission.GET_ACCOUNTS\",\n NEARBY_WIFI_DEVICES: \"android.permission.NEARBY_WIFI_DEVICES\",\n PROCESS_OUTGOING_CALLS: \"android.permission.PROCESS_OUTGOING_CALLS\",\n READ_CALL_LOG: \"android.permission.READ_CALL_LOG\",\n READ_EXTERNAL_STORAGE: \"android.permission.READ_EXTERNAL_STORAGE\",\n READ_MEDIA_AUDIO: \"android.permission.READ_MEDIA_AUDIO\",\n READ_MEDIA_IMAGES: \"android.permission.READ_MEDIA_IMAGES\",\n READ_MEDIA_VIDEO: \"android.permission.READ_MEDIA_VIDEO\",\n READ_MEDIA_VISUAL_USER_SELECTED: \"android.permission.READ_MEDIA_VISUAL_USER_SELECTED\",\n READ_PHONE_NUMBERS: \"android.permission.READ_PHONE_NUMBERS\",\n READ_PHONE_STATE: \"android.permission.READ_PHONE_STATE\",\n READ_SMS: \"android.permission.READ_SMS\",\n RECEIVE_MMS: \"android.permission.RECEIVE_MMS\",\n RECEIVE_SMS: \"android.permission.RECEIVE_SMS\",\n RECEIVE_WAP_PUSH: \"android.permission.RECEIVE_WAP_PUSH\",\n SEND_SMS: \"android.permission.SEND_SMS\",\n USE_SIP: \"android.permission.USE_SIP\",\n UWB_RANGING: \"android.permission.UWB_RANGING\",\n WRITE_CALL_LOG: \"android.permission.WRITE_CALL_LOG\",\n WRITE_CONTACTS: \"android.permission.WRITE_CONTACTS\",\n WRITE_EXTERNAL_STORAGE: \"android.permission.WRITE_EXTERNAL_STORAGE\",\n },\n} as const;\n\nexport function createRNPEngine(): PermissionEngine {\n return {\n async check(permission: string): Promise<PermissionStatus> {\n if (permission === \"notifications\") {\n const result = await checkNotifications();\n return result.status as PermissionStatus;\n }\n return (await check(permission as Permission)) as PermissionStatus;\n },\n\n async request(permission: string): Promise<PermissionStatus> {\n if (permission === \"notifications\") {\n const result = await requestNotifications([\"alert\", \"badge\", \"sound\"]);\n return result.status as PermissionStatus;\n }\n return (await request(permission as Permission)) as PermissionStatus;\n },\n\n async openSettings(): Promise<void> {\n await openSettings();\n },\n };\n}\n"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,gBAAgB;AACzB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,EAAE,KAAa,SAAyB;AAC/C,SAAO,SAAS,OAAO,EAAE,KAAK,SAAS,SAAS,IAAI,CAAC,KAAK;AAC5D;AAgFO,SAAS,kBAAoC;AAClD,SAAO;AAAA,IACL,MAAM,MAAM,YAA+C;AACzD,UAAI,eAAe,iBAAiB;AAClC,cAAM,SAAS,MAAM,mBAAmB;AACxC,eAAO,OAAO;AAAA,MAChB;AACA,aAAQ,MAAM,MAAM,UAAwB;AAAA,IAC9C;AAAA,IAEA,MAAM,QAAQ,YAA+C;AAC3D,UAAI,eAAe,iBAAiB;AAClC,cAAM,SAAS,MAAM,qBAAqB,CAAC,SAAS,SAAS,OAAO,CAAC;AACrE,eAAO,OAAO;AAAA,MAChB;AACA,aAAQ,MAAM,QAAQ,UAAwB;AAAA,IAChD;AAAA,IAEA,MAAM,eAA8B;AAClC,YAAM,aAAa;AAAA,IACrB;AAAA,EACF;AACF;AAnHA,IAmBa;AAnBb;AAAA;AAmBO,IAAM,cAAc;AAAA;AAAA,MAEzB,QAAQ,EAAE,yBAAyB,2BAA2B;AAAA,MAC9D,YAAY,EAAE,6BAA6B,iCAAiC;AAAA,MAC5E,UAAU,EAAE,2BAA2B,kCAAkC;AAAA,MACzE,WAAW,EAAE,4BAA4B,kCAAkC;AAAA,MAC3E,sBAAsB;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,MACA,sBAAsB;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAiB;AAAA,QACf;AAAA,QACA;AAAA,MACF;AAAA,MACA,eAAe,EAAE,gCAAgC,sCAAsC;AAAA,MACvF,wBAAwB;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,eAAe,EAAE,gCAAgC,qCAAqC;AAAA,MACtF,WAAW,EAAE,4BAA4B,sCAAsC;AAAA,MAC/E,oBAAoB,EAAE,qCAAqC,iCAAiC;AAAA,MAC5F,QAAQ,EAAE,yBAAyB,yCAAyC;AAAA,MAC5E,eAAe;AAAA;AAAA,MAGf,KAAK;AAAA,QACH,2BAA2B;AAAA,QAC3B,SAAS;AAAA,QACT,WAAW;AAAA,QACX,MAAM;AAAA,QACN,UAAU;AAAA,MACZ;AAAA;AAAA,MAGA,SAAS;AAAA,QACP,iBAAiB;AAAA,QACjB,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,eAAe;AAAA,QACf,oBAAoB;AAAA,QACpB,qBAAqB;AAAA,QACrB,gBAAgB;AAAA,QAChB,cAAc;AAAA,QACd,yBAAyB;AAAA,QACzB,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,qBAAqB;AAAA,QACrB,wBAAwB;AAAA,QACxB,eAAe;AAAA,QACf,uBAAuB;AAAA,QACvB,kBAAkB;AAAA,QAClB,mBAAmB;AAAA,QACnB,kBAAkB;AAAA,QAClB,iCAAiC;AAAA,QACjC,oBAAoB;AAAA,QACpB,kBAAkB;AAAA,QAClB,UAAU;AAAA,QACV,aAAa;AAAA,QACb,aAAa;AAAA,QACb,kBAAkB;AAAA,QAClB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,aAAa;AAAA,QACb,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,IACF;AAAA;AAAA;","names":[]}
@@ -1,18 +1,31 @@
1
- import { P as PermissionEngine } from '../types-QXyq8VnD.mjs';
1
+ import { P as PermissionEngine } from '../types-DwqbbLGD.mjs';
2
2
 
3
+ type ExpoPermissionResponse = {
4
+ status: string;
5
+ canAskAgain: boolean;
6
+ };
7
+ /**
8
+ * An Expo module with standard permission methods (getPermissionsAsync/requestPermissionsAsync).
9
+ * Works with: expo-media-library, expo-notifications, expo-contacts, expo-brightness,
10
+ * expo-screen-capture, expo-cellular, expo-av, expo-sensors, expo-maps.
11
+ */
3
12
  interface ExpoPermissionModule {
4
- getPermissionsAsync: () => Promise<{
5
- status: string;
6
- canAskAgain: boolean;
7
- }>;
8
- requestPermissionsAsync: () => Promise<{
9
- status: string;
10
- canAskAgain: boolean;
11
- }>;
13
+ getPermissionsAsync: () => Promise<ExpoPermissionResponse>;
14
+ requestPermissionsAsync: () => Promise<ExpoPermissionResponse>;
12
15
  }
16
+ /**
17
+ * Explicit get/request function pair for modules with non-standard method names.
18
+ * Use this for: expo-camera, expo-location, expo-calendar, expo-image-picker,
19
+ * expo-tracking-transparency, expo-audio.
20
+ */
21
+ interface ExpoPermissionFunctions {
22
+ get: () => Promise<ExpoPermissionResponse>;
23
+ request: () => Promise<ExpoPermissionResponse>;
24
+ }
25
+ type ExpoPermissionEntry = ExpoPermissionModule | ExpoPermissionFunctions;
13
26
  interface ExpoEngineConfig {
14
- permissions: Record<string, ExpoPermissionModule>;
27
+ permissions: Record<string, ExpoPermissionEntry>;
15
28
  }
16
29
  declare function createExpoEngine(config: ExpoEngineConfig): PermissionEngine;
17
30
 
18
- export { type ExpoEngineConfig, type ExpoPermissionModule, createExpoEngine };
31
+ export { type ExpoEngineConfig, type ExpoPermissionEntry, type ExpoPermissionFunctions, type ExpoPermissionModule, createExpoEngine };
@@ -1,18 +1,31 @@
1
- import { P as PermissionEngine } from '../types-QXyq8VnD.js';
1
+ import { P as PermissionEngine } from '../types-DwqbbLGD.js';
2
2
 
3
+ type ExpoPermissionResponse = {
4
+ status: string;
5
+ canAskAgain: boolean;
6
+ };
7
+ /**
8
+ * An Expo module with standard permission methods (getPermissionsAsync/requestPermissionsAsync).
9
+ * Works with: expo-media-library, expo-notifications, expo-contacts, expo-brightness,
10
+ * expo-screen-capture, expo-cellular, expo-av, expo-sensors, expo-maps.
11
+ */
3
12
  interface ExpoPermissionModule {
4
- getPermissionsAsync: () => Promise<{
5
- status: string;
6
- canAskAgain: boolean;
7
- }>;
8
- requestPermissionsAsync: () => Promise<{
9
- status: string;
10
- canAskAgain: boolean;
11
- }>;
13
+ getPermissionsAsync: () => Promise<ExpoPermissionResponse>;
14
+ requestPermissionsAsync: () => Promise<ExpoPermissionResponse>;
12
15
  }
16
+ /**
17
+ * Explicit get/request function pair for modules with non-standard method names.
18
+ * Use this for: expo-camera, expo-location, expo-calendar, expo-image-picker,
19
+ * expo-tracking-transparency, expo-audio.
20
+ */
21
+ interface ExpoPermissionFunctions {
22
+ get: () => Promise<ExpoPermissionResponse>;
23
+ request: () => Promise<ExpoPermissionResponse>;
24
+ }
25
+ type ExpoPermissionEntry = ExpoPermissionModule | ExpoPermissionFunctions;
13
26
  interface ExpoEngineConfig {
14
- permissions: Record<string, ExpoPermissionModule>;
27
+ permissions: Record<string, ExpoPermissionEntry>;
15
28
  }
16
29
  declare function createExpoEngine(config: ExpoEngineConfig): PermissionEngine;
17
30
 
18
- export { type ExpoEngineConfig, type ExpoPermissionModule, createExpoEngine };
31
+ export { type ExpoEngineConfig, type ExpoPermissionEntry, type ExpoPermissionFunctions, type ExpoPermissionModule, createExpoEngine };
@@ -24,6 +24,15 @@ __export(expo_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(expo_exports);
26
26
  var import_react_native = require("react-native");
27
+ function resolveEntry(entry) {
28
+ if ("get" in entry && "request" in entry) {
29
+ return entry;
30
+ }
31
+ return {
32
+ get: () => entry.getPermissionsAsync(),
33
+ request: () => entry.requestPermissionsAsync()
34
+ };
35
+ }
27
36
  function mapExpoStatus(result) {
28
37
  if (result.status === "granted") return "granted";
29
38
  if (result.status === "undetermined") return "denied";
@@ -35,16 +44,16 @@ function mapExpoStatus(result) {
35
44
  function createExpoEngine(config) {
36
45
  return {
37
46
  async check(permission) {
38
- const mod = config.permissions[permission];
39
- if (!mod) return "unavailable";
40
- const result = await mod.getPermissionsAsync();
41
- return mapExpoStatus(result);
47
+ const entry = config.permissions[permission];
48
+ if (!entry) return "unavailable";
49
+ const { get } = resolveEntry(entry);
50
+ return mapExpoStatus(await get());
42
51
  },
43
52
  async request(permission) {
44
- const mod = config.permissions[permission];
45
- if (!mod) return "unavailable";
46
- const result = await mod.requestPermissionsAsync();
47
- return mapExpoStatus(result);
53
+ const entry = config.permissions[permission];
54
+ if (!entry) return "unavailable";
55
+ const { request } = resolveEntry(entry);
56
+ return mapExpoStatus(await request());
48
57
  },
49
58
  async openSettings() {
50
59
  await import_react_native.Linking.openSettings();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/engines/expo.ts"],"sourcesContent":["import { Linking } from \"react-native\";\nimport type { PermissionEngine, PermissionStatus } from \"../types\";\n\nexport interface ExpoPermissionModule {\n getPermissionsAsync: () => Promise<{ status: string; canAskAgain: boolean }>;\n requestPermissionsAsync: () => Promise<{ status: string; canAskAgain: boolean }>;\n}\n\nexport interface ExpoEngineConfig {\n permissions: Record<string, ExpoPermissionModule>;\n}\n\nfunction mapExpoStatus(result: {\n status: string;\n canAskAgain: boolean;\n}): PermissionStatus {\n if (result.status === \"granted\") return \"granted\";\n if (result.status === \"undetermined\") return \"denied\";\n if (result.status === \"denied\") {\n return result.canAskAgain ? \"denied\" : \"blocked\";\n }\n return \"unavailable\";\n}\n\nexport function createExpoEngine(config: ExpoEngineConfig): PermissionEngine {\n return {\n async check(permission: string): Promise<PermissionStatus> {\n const mod = config.permissions[permission];\n if (!mod) return \"unavailable\";\n const result = await mod.getPermissionsAsync();\n return mapExpoStatus(result);\n },\n\n async request(permission: string): Promise<PermissionStatus> {\n const mod = config.permissions[permission];\n if (!mod) return \"unavailable\";\n const result = await mod.requestPermissionsAsync();\n return mapExpoStatus(result);\n },\n\n async openSettings(): Promise<void> {\n await Linking.openSettings();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAwB;AAYxB,SAAS,cAAc,QAGF;AACnB,MAAI,OAAO,WAAW,UAAW,QAAO;AACxC,MAAI,OAAO,WAAW,eAAgB,QAAO;AAC7C,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO,OAAO,cAAc,WAAW;AAAA,EACzC;AACA,SAAO;AACT;AAEO,SAAS,iBAAiB,QAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,MAAM,YAA+C;AACzD,YAAM,MAAM,OAAO,YAAY,UAAU;AACzC,UAAI,CAAC,IAAK,QAAO;AACjB,YAAM,SAAS,MAAM,IAAI,oBAAoB;AAC7C,aAAO,cAAc,MAAM;AAAA,IAC7B;AAAA,IAEA,MAAM,QAAQ,YAA+C;AAC3D,YAAM,MAAM,OAAO,YAAY,UAAU;AACzC,UAAI,CAAC,IAAK,QAAO;AACjB,YAAM,SAAS,MAAM,IAAI,wBAAwB;AACjD,aAAO,cAAc,MAAM;AAAA,IAC7B;AAAA,IAEA,MAAM,eAA8B;AAClC,YAAM,4BAAQ,aAAa;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/engines/expo.ts"],"sourcesContent":["import { Linking } from \"react-native\";\nimport type { PermissionEngine, PermissionStatus } from \"../types\";\n\ntype ExpoPermissionResponse = { status: string; canAskAgain: boolean };\n\n/**\n * An Expo module with standard permission methods (getPermissionsAsync/requestPermissionsAsync).\n * Works with: expo-media-library, expo-notifications, expo-contacts, expo-brightness,\n * expo-screen-capture, expo-cellular, expo-av, expo-sensors, expo-maps.\n */\nexport interface ExpoPermissionModule {\n getPermissionsAsync: () => Promise<ExpoPermissionResponse>;\n requestPermissionsAsync: () => Promise<ExpoPermissionResponse>;\n}\n\n/**\n * Explicit get/request function pair for modules with non-standard method names.\n * Use this for: expo-camera, expo-location, expo-calendar, expo-image-picker,\n * expo-tracking-transparency, expo-audio.\n */\nexport interface ExpoPermissionFunctions {\n get: () => Promise<ExpoPermissionResponse>;\n request: () => Promise<ExpoPermissionResponse>;\n}\n\nexport type ExpoPermissionEntry = ExpoPermissionModule | ExpoPermissionFunctions;\n\nexport interface ExpoEngineConfig {\n permissions: Record<string, ExpoPermissionEntry>;\n}\n\nfunction resolveEntry(entry: ExpoPermissionEntry): {\n get: () => Promise<ExpoPermissionResponse>;\n request: () => Promise<ExpoPermissionResponse>;\n} {\n if (\"get\" in entry && \"request\" in entry) {\n return entry;\n }\n return {\n get: () => entry.getPermissionsAsync(),\n request: () => entry.requestPermissionsAsync(),\n };\n}\n\nfunction mapExpoStatus(result: ExpoPermissionResponse): PermissionStatus {\n if (result.status === \"granted\") return \"granted\";\n if (result.status === \"undetermined\") return \"denied\";\n if (result.status === \"denied\") {\n return result.canAskAgain ? \"denied\" : \"blocked\";\n }\n return \"unavailable\";\n}\n\nexport function createExpoEngine(config: ExpoEngineConfig): PermissionEngine {\n return {\n async check(permission: string): Promise<PermissionStatus> {\n const entry = config.permissions[permission];\n if (!entry) return \"unavailable\";\n const { get } = resolveEntry(entry);\n return mapExpoStatus(await get());\n },\n\n async request(permission: string): Promise<PermissionStatus> {\n const entry = config.permissions[permission];\n if (!entry) return \"unavailable\";\n const { request } = resolveEntry(entry);\n return mapExpoStatus(await request());\n },\n\n async openSettings(): Promise<void> {\n await Linking.openSettings();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAwB;AA+BxB,SAAS,aAAa,OAGpB;AACA,MAAI,SAAS,SAAS,aAAa,OAAO;AACxC,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,KAAK,MAAM,MAAM,oBAAoB;AAAA,IACrC,SAAS,MAAM,MAAM,wBAAwB;AAAA,EAC/C;AACF;AAEA,SAAS,cAAc,QAAkD;AACvE,MAAI,OAAO,WAAW,UAAW,QAAO;AACxC,MAAI,OAAO,WAAW,eAAgB,QAAO;AAC7C,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO,OAAO,cAAc,WAAW;AAAA,EACzC;AACA,SAAO;AACT;AAEO,SAAS,iBAAiB,QAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,MAAM,YAA+C;AACzD,YAAM,QAAQ,OAAO,YAAY,UAAU;AAC3C,UAAI,CAAC,MAAO,QAAO;AACnB,YAAM,EAAE,IAAI,IAAI,aAAa,KAAK;AAClC,aAAO,cAAc,MAAM,IAAI,CAAC;AAAA,IAClC;AAAA,IAEA,MAAM,QAAQ,YAA+C;AAC3D,YAAM,QAAQ,OAAO,YAAY,UAAU;AAC3C,UAAI,CAAC,MAAO,QAAO;AACnB,YAAM,EAAE,QAAQ,IAAI,aAAa,KAAK;AACtC,aAAO,cAAc,MAAM,QAAQ,CAAC;AAAA,IACtC;AAAA,IAEA,MAAM,eAA8B;AAClC,YAAM,4BAAQ,aAAa;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
@@ -2,6 +2,15 @@ import "../chunk-NFEGQTCC.mjs";
2
2
 
3
3
  // src/engines/expo.ts
4
4
  import { Linking } from "react-native";
5
+ function resolveEntry(entry) {
6
+ if ("get" in entry && "request" in entry) {
7
+ return entry;
8
+ }
9
+ return {
10
+ get: () => entry.getPermissionsAsync(),
11
+ request: () => entry.requestPermissionsAsync()
12
+ };
13
+ }
5
14
  function mapExpoStatus(result) {
6
15
  if (result.status === "granted") return "granted";
7
16
  if (result.status === "undetermined") return "denied";
@@ -13,16 +22,16 @@ function mapExpoStatus(result) {
13
22
  function createExpoEngine(config) {
14
23
  return {
15
24
  async check(permission) {
16
- const mod = config.permissions[permission];
17
- if (!mod) return "unavailable";
18
- const result = await mod.getPermissionsAsync();
19
- return mapExpoStatus(result);
25
+ const entry = config.permissions[permission];
26
+ if (!entry) return "unavailable";
27
+ const { get } = resolveEntry(entry);
28
+ return mapExpoStatus(await get());
20
29
  },
21
30
  async request(permission) {
22
- const mod = config.permissions[permission];
23
- if (!mod) return "unavailable";
24
- const result = await mod.requestPermissionsAsync();
25
- return mapExpoStatus(result);
31
+ const entry = config.permissions[permission];
32
+ if (!entry) return "unavailable";
33
+ const { request } = resolveEntry(entry);
34
+ return mapExpoStatus(await request());
26
35
  },
27
36
  async openSettings() {
28
37
  await Linking.openSettings();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/engines/expo.ts"],"sourcesContent":["import { Linking } from \"react-native\";\nimport type { PermissionEngine, PermissionStatus } from \"../types\";\n\nexport interface ExpoPermissionModule {\n getPermissionsAsync: () => Promise<{ status: string; canAskAgain: boolean }>;\n requestPermissionsAsync: () => Promise<{ status: string; canAskAgain: boolean }>;\n}\n\nexport interface ExpoEngineConfig {\n permissions: Record<string, ExpoPermissionModule>;\n}\n\nfunction mapExpoStatus(result: {\n status: string;\n canAskAgain: boolean;\n}): PermissionStatus {\n if (result.status === \"granted\") return \"granted\";\n if (result.status === \"undetermined\") return \"denied\";\n if (result.status === \"denied\") {\n return result.canAskAgain ? \"denied\" : \"blocked\";\n }\n return \"unavailable\";\n}\n\nexport function createExpoEngine(config: ExpoEngineConfig): PermissionEngine {\n return {\n async check(permission: string): Promise<PermissionStatus> {\n const mod = config.permissions[permission];\n if (!mod) return \"unavailable\";\n const result = await mod.getPermissionsAsync();\n return mapExpoStatus(result);\n },\n\n async request(permission: string): Promise<PermissionStatus> {\n const mod = config.permissions[permission];\n if (!mod) return \"unavailable\";\n const result = await mod.requestPermissionsAsync();\n return mapExpoStatus(result);\n },\n\n async openSettings(): Promise<void> {\n await Linking.openSettings();\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;AAYxB,SAAS,cAAc,QAGF;AACnB,MAAI,OAAO,WAAW,UAAW,QAAO;AACxC,MAAI,OAAO,WAAW,eAAgB,QAAO;AAC7C,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO,OAAO,cAAc,WAAW;AAAA,EACzC;AACA,SAAO;AACT;AAEO,SAAS,iBAAiB,QAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,MAAM,YAA+C;AACzD,YAAM,MAAM,OAAO,YAAY,UAAU;AACzC,UAAI,CAAC,IAAK,QAAO;AACjB,YAAM,SAAS,MAAM,IAAI,oBAAoB;AAC7C,aAAO,cAAc,MAAM;AAAA,IAC7B;AAAA,IAEA,MAAM,QAAQ,YAA+C;AAC3D,YAAM,MAAM,OAAO,YAAY,UAAU;AACzC,UAAI,CAAC,IAAK,QAAO;AACjB,YAAM,SAAS,MAAM,IAAI,wBAAwB;AACjD,aAAO,cAAc,MAAM;AAAA,IAC7B;AAAA,IAEA,MAAM,eAA8B;AAClC,YAAM,QAAQ,aAAa;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/engines/expo.ts"],"sourcesContent":["import { Linking } from \"react-native\";\nimport type { PermissionEngine, PermissionStatus } from \"../types\";\n\ntype ExpoPermissionResponse = { status: string; canAskAgain: boolean };\n\n/**\n * An Expo module with standard permission methods (getPermissionsAsync/requestPermissionsAsync).\n * Works with: expo-media-library, expo-notifications, expo-contacts, expo-brightness,\n * expo-screen-capture, expo-cellular, expo-av, expo-sensors, expo-maps.\n */\nexport interface ExpoPermissionModule {\n getPermissionsAsync: () => Promise<ExpoPermissionResponse>;\n requestPermissionsAsync: () => Promise<ExpoPermissionResponse>;\n}\n\n/**\n * Explicit get/request function pair for modules with non-standard method names.\n * Use this for: expo-camera, expo-location, expo-calendar, expo-image-picker,\n * expo-tracking-transparency, expo-audio.\n */\nexport interface ExpoPermissionFunctions {\n get: () => Promise<ExpoPermissionResponse>;\n request: () => Promise<ExpoPermissionResponse>;\n}\n\nexport type ExpoPermissionEntry = ExpoPermissionModule | ExpoPermissionFunctions;\n\nexport interface ExpoEngineConfig {\n permissions: Record<string, ExpoPermissionEntry>;\n}\n\nfunction resolveEntry(entry: ExpoPermissionEntry): {\n get: () => Promise<ExpoPermissionResponse>;\n request: () => Promise<ExpoPermissionResponse>;\n} {\n if (\"get\" in entry && \"request\" in entry) {\n return entry;\n }\n return {\n get: () => entry.getPermissionsAsync(),\n request: () => entry.requestPermissionsAsync(),\n };\n}\n\nfunction mapExpoStatus(result: ExpoPermissionResponse): PermissionStatus {\n if (result.status === \"granted\") return \"granted\";\n if (result.status === \"undetermined\") return \"denied\";\n if (result.status === \"denied\") {\n return result.canAskAgain ? \"denied\" : \"blocked\";\n }\n return \"unavailable\";\n}\n\nexport function createExpoEngine(config: ExpoEngineConfig): PermissionEngine {\n return {\n async check(permission: string): Promise<PermissionStatus> {\n const entry = config.permissions[permission];\n if (!entry) return \"unavailable\";\n const { get } = resolveEntry(entry);\n return mapExpoStatus(await get());\n },\n\n async request(permission: string): Promise<PermissionStatus> {\n const entry = config.permissions[permission];\n if (!entry) return \"unavailable\";\n const { request } = resolveEntry(entry);\n return mapExpoStatus(await request());\n },\n\n async openSettings(): Promise<void> {\n await Linking.openSettings();\n },\n };\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;AA+BxB,SAAS,aAAa,OAGpB;AACA,MAAI,SAAS,SAAS,aAAa,OAAO;AACxC,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,KAAK,MAAM,MAAM,oBAAoB;AAAA,IACrC,SAAS,MAAM,MAAM,wBAAwB;AAAA,EAC/C;AACF;AAEA,SAAS,cAAc,QAAkD;AACvE,MAAI,OAAO,WAAW,UAAW,QAAO;AACxC,MAAI,OAAO,WAAW,eAAgB,QAAO;AAC7C,MAAI,OAAO,WAAW,UAAU;AAC9B,WAAO,OAAO,cAAc,WAAW;AAAA,EACzC;AACA,SAAO;AACT;AAEO,SAAS,iBAAiB,QAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,MAAM,YAA+C;AACzD,YAAM,QAAQ,OAAO,YAAY,UAAU;AAC3C,UAAI,CAAC,MAAO,QAAO;AACnB,YAAM,EAAE,IAAI,IAAI,aAAa,KAAK;AAClC,aAAO,cAAc,MAAM,IAAI,CAAC;AAAA,IAClC;AAAA,IAEA,MAAM,QAAQ,YAA+C;AAC3D,YAAM,QAAQ,OAAO,YAAY,UAAU;AAC3C,UAAI,CAAC,MAAO,QAAO;AACnB,YAAM,EAAE,QAAQ,IAAI,aAAa,KAAK;AACtC,aAAO,cAAc,MAAM,QAAQ,CAAC;AAAA,IACtC;AAAA,IAEA,MAAM,eAA8B;AAClC,YAAM,QAAQ,aAAa;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
@@ -1,8 +1,8 @@
1
- import { P as PermissionEngine } from '../types-QXyq8VnD.mjs';
1
+ import { P as PermissionEngine } from '../types-DwqbbLGD.mjs';
2
2
 
3
3
  /**
4
- * Cross-platform permission constants for use with the RNP engine.
5
- * Each resolves to the correct platform-specific string at runtime.
4
+ * Cross-platform permission constants that resolve to the correct
5
+ * platform-specific string at runtime via Platform.select.
6
6
  */
7
7
  declare const Permissions: {
8
8
  readonly CAMERA: string;
@@ -14,8 +14,51 @@ declare const Permissions: {
14
14
  readonly LOCATION_ALWAYS: string;
15
15
  readonly PHOTO_LIBRARY: string;
16
16
  readonly PHOTO_LIBRARY_ADD_ONLY: string;
17
+ readonly MEDIA_LIBRARY: string;
17
18
  readonly BLUETOOTH: string;
19
+ readonly SPEECH_RECOGNITION: string;
20
+ readonly MOTION: string;
18
21
  readonly NOTIFICATIONS: "notifications";
22
+ readonly IOS: {
23
+ readonly APP_TRACKING_TRANSPARENCY: "ios.permission.APP_TRACKING_TRANSPARENCY";
24
+ readonly FACE_ID: "ios.permission.FACE_ID";
25
+ readonly REMINDERS: "ios.permission.REMINDERS";
26
+ readonly SIRI: "ios.permission.SIRI";
27
+ readonly STOREKIT: "ios.permission.STOREKIT";
28
+ };
29
+ readonly ANDROID: {
30
+ readonly ACCEPT_HANDOVER: "android.permission.ACCEPT_HANDOVER";
31
+ readonly ACCESS_COARSE_LOCATION: "android.permission.ACCESS_COARSE_LOCATION";
32
+ readonly ACCESS_MEDIA_LOCATION: "android.permission.ACCESS_MEDIA_LOCATION";
33
+ readonly ADD_VOICEMAIL: "com.android.voicemail.permission.ADD_VOICEMAIL";
34
+ readonly ANSWER_PHONE_CALLS: "android.permission.ANSWER_PHONE_CALLS";
35
+ readonly BLUETOOTH_ADVERTISE: "android.permission.BLUETOOTH_ADVERTISE";
36
+ readonly BLUETOOTH_SCAN: "android.permission.BLUETOOTH_SCAN";
37
+ readonly BODY_SENSORS: "android.permission.BODY_SENSORS";
38
+ readonly BODY_SENSORS_BACKGROUND: "android.permission.BODY_SENSORS_BACKGROUND";
39
+ readonly CALL_PHONE: "android.permission.CALL_PHONE";
40
+ readonly GET_ACCOUNTS: "android.permission.GET_ACCOUNTS";
41
+ readonly NEARBY_WIFI_DEVICES: "android.permission.NEARBY_WIFI_DEVICES";
42
+ readonly PROCESS_OUTGOING_CALLS: "android.permission.PROCESS_OUTGOING_CALLS";
43
+ readonly READ_CALL_LOG: "android.permission.READ_CALL_LOG";
44
+ readonly READ_EXTERNAL_STORAGE: "android.permission.READ_EXTERNAL_STORAGE";
45
+ readonly READ_MEDIA_AUDIO: "android.permission.READ_MEDIA_AUDIO";
46
+ readonly READ_MEDIA_IMAGES: "android.permission.READ_MEDIA_IMAGES";
47
+ readonly READ_MEDIA_VIDEO: "android.permission.READ_MEDIA_VIDEO";
48
+ readonly READ_MEDIA_VISUAL_USER_SELECTED: "android.permission.READ_MEDIA_VISUAL_USER_SELECTED";
49
+ readonly READ_PHONE_NUMBERS: "android.permission.READ_PHONE_NUMBERS";
50
+ readonly READ_PHONE_STATE: "android.permission.READ_PHONE_STATE";
51
+ readonly READ_SMS: "android.permission.READ_SMS";
52
+ readonly RECEIVE_MMS: "android.permission.RECEIVE_MMS";
53
+ readonly RECEIVE_SMS: "android.permission.RECEIVE_SMS";
54
+ readonly RECEIVE_WAP_PUSH: "android.permission.RECEIVE_WAP_PUSH";
55
+ readonly SEND_SMS: "android.permission.SEND_SMS";
56
+ readonly USE_SIP: "android.permission.USE_SIP";
57
+ readonly UWB_RANGING: "android.permission.UWB_RANGING";
58
+ readonly WRITE_CALL_LOG: "android.permission.WRITE_CALL_LOG";
59
+ readonly WRITE_CONTACTS: "android.permission.WRITE_CONTACTS";
60
+ readonly WRITE_EXTERNAL_STORAGE: "android.permission.WRITE_EXTERNAL_STORAGE";
61
+ };
19
62
  };
20
63
  declare function createRNPEngine(): PermissionEngine;
21
64