1- import  { NativeModules }  from  'react-native ' ; 
1+ import  NativeModule  from  './NativeRNPermissions ' ; 
22import  type  { Contract }  from  './contract' ; 
3- import  type  { Permission ,  PermissionStatus }  from  './types' ; 
3+ import  type  { NotificationsResponse ,   Permission ,  PermissionStatus }  from  './types' ; 
44import  { 
55  canScheduleExactAlarms , 
66  checkLocationAccuracy , 
@@ -9,28 +9,23 @@ import {
99}  from  './unsupportedMethods' ; 
1010import  { uniq }  from  './utils' ; 
1111
12- const  NativeModule : { 
13-   Check : ( permission : Permission )  =>  Promise < PermissionStatus > ; 
14-   CheckNotifications : ( )  =>  Promise < PermissionStatus > ; 
15-   Request : ( permission : Permission )  =>  Promise < PermissionStatus > ; 
16-   OpenSettings : ( )  =>  Promise < void > ; 
17- }  =  NativeModules . RNPermissions ; 
18- 
1912const  openSettings : Contract [ 'openSettings' ]  =  async  ( )  =>  { 
20-   await  NativeModule . OpenSettings ( ) ; 
13+   await  NativeModule . openSettings ( "N/A" ) ; 
2114} ; 
2215
23- const  check : Contract [ 'check' ]  =  ( permission )  =>  { 
24-   return  NativeModule . Check ( permission ) ; 
16+ const  check : Contract [ 'check' ]  =  async  ( permission )  =>  { 
17+   const  response  =  ( await  NativeModule . check ( permission ) )  as  PermissionStatus ; 
18+   return  response ; 
2519} ; 
2620
27- const  request : Contract [ 'request' ]  =  ( permission )  =>  { 
28-   return  NativeModule . Request ( permission ) ; 
21+ const  request : Contract [ 'request' ]  =  async  ( permission )  =>  { 
22+   const  response  =  ( await  NativeModule . request ( permission ) )  as  PermissionStatus ; 
23+   return  response ; 
2924} ; 
3025
3126const  checkNotifications : Contract [ 'checkNotifications' ]  =  async  ( )  =>  { 
32-   const  status  =  await  NativeModule . CheckNotifications ( ) ; 
33-   return  { status ,   settings :  { } } ; 
27+   const  response  =  ( await  NativeModule . checkNotifications ( ) )   as   NotificationsResponse ; 
28+   return  response ; 
3429} ; 
3530
3631const  checkMultiple : Contract [ 'checkMultiple' ]  =  async  ( permissions )  =>  { 
0 commit comments