1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export interface Rationale {
|
11 | title: string;
|
12 | message: string;
|
13 | buttonPositive: string;
|
14 | buttonNegative?: string | undefined;
|
15 | buttonNeutral?: string | undefined;
|
16 | }
|
17 |
|
18 | export type Permission =
|
19 | | 'android.permission.READ_CALENDAR'
|
20 | | 'android.permission.WRITE_CALENDAR'
|
21 | | 'android.permission.CAMERA'
|
22 | | 'android.permission.READ_CONTACTS'
|
23 | | 'android.permission.WRITE_CONTACTS'
|
24 | | 'android.permission.GET_ACCOUNTS'
|
25 | | 'android.permission.ACCESS_BACKGROUND_LOCATION'
|
26 | | 'android.permission.ACCESS_FINE_LOCATION'
|
27 | | 'android.permission.ACCESS_COARSE_LOCATION'
|
28 | | 'android.permission.RECORD_AUDIO'
|
29 | | 'android.permission.READ_PHONE_STATE'
|
30 | | 'android.permission.CALL_PHONE'
|
31 | | 'android.permission.READ_CALL_LOG'
|
32 | | 'android.permission.WRITE_CALL_LOG'
|
33 | | 'com.android.voicemail.permission.ADD_VOICEMAIL'
|
34 | | 'com.android.voicemail.permission.READ_VOICEMAIL'
|
35 | | 'com.android.voicemail.permission.WRITE_VOICEMAIL'
|
36 | | 'android.permission.USE_SIP'
|
37 | | 'android.permission.PROCESS_OUTGOING_CALLS'
|
38 | | 'android.permission.BODY_SENSORS'
|
39 | | 'android.permission.BODY_SENSORS_BACKGROUND'
|
40 | | 'android.permission.SEND_SMS'
|
41 | | 'android.permission.RECEIVE_SMS'
|
42 | | 'android.permission.READ_SMS'
|
43 | | 'android.permission.RECEIVE_WAP_PUSH'
|
44 | | 'android.permission.RECEIVE_MMS'
|
45 | | 'android.permission.READ_EXTERNAL_STORAGE'
|
46 | | 'android.permission.READ_MEDIA_IMAGES'
|
47 | | 'android.permission.READ_MEDIA_VIDEO'
|
48 | | 'android.permission.READ_MEDIA_AUDIO'
|
49 | | 'android.permission.READ_MEDIA_VISUAL_USER_SELECTED'
|
50 | | 'android.permission.WRITE_EXTERNAL_STORAGE'
|
51 | | 'android.permission.BLUETOOTH_CONNECT'
|
52 | | 'android.permission.BLUETOOTH_SCAN'
|
53 | | 'android.permission.BLUETOOTH_ADVERTISE'
|
54 | | 'android.permission.ACCESS_MEDIA_LOCATION'
|
55 | | 'android.permission.ACCEPT_HANDOVER'
|
56 | | 'android.permission.ACTIVITY_RECOGNITION'
|
57 | | 'android.permission.ANSWER_PHONE_CALLS'
|
58 | | 'android.permission.READ_PHONE_NUMBERS'
|
59 | | 'android.permission.UWB_RANGING'
|
60 | | 'android.permission.POST_NOTIFICATIONS'
|
61 | | 'android.permission.NEARBY_WIFI_DEVICES';
|
62 |
|
63 | export type PermissionStatus = 'granted' | 'denied' | 'never_ask_again';
|
64 |
|
65 | export interface PermissionsAndroidStatic {
|
66 | |
67 |
|
68 |
|
69 | RESULTS: {[key: string]: PermissionStatus};
|
70 | |
71 |
|
72 |
|
73 | PERMISSIONS: {[key: string]: Permission};
|
74 | new (): PermissionsAndroidStatic;
|
75 | |
76 |
|
77 |
|
78 | checkPermission(permission: Permission): Promise<boolean>;
|
79 | |
80 |
|
81 |
|
82 |
|
83 | check(permission: Permission): Promise<boolean>;
|
84 | |
85 |
|
86 |
|
87 | requestPermission(
|
88 | permission: Permission,
|
89 | rationale?: Rationale,
|
90 | ): Promise<boolean>;
|
91 | |
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | request(
|
102 | permission: Permission,
|
103 | rationale?: Rationale,
|
104 | ): Promise<PermissionStatus>;
|
105 | |
106 |
|
107 |
|
108 |
|
109 |
|
110 | requestMultiple(
|
111 | permissions: Array<Permission>,
|
112 | ): Promise<{[key in Permission]: PermissionStatus}>;
|
113 | }
|
114 |
|
115 | export const PermissionsAndroid: PermissionsAndroidStatic;
|
116 | export type PermissionsAndroid = PermissionsAndroidStatic;
|