mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[expo] Update Permission typings to match SDK31 docs
This commit is contained in:
@@ -695,13 +695,12 @@ Permissions.CAMERA === 'camera';
|
||||
Permissions.CAMERA_ROLL === 'cameraRoll';
|
||||
Permissions.AUDIO_RECORDING === 'audioRecording';
|
||||
Permissions.CONTACTS === 'contacts';
|
||||
Permissions.NOTIFICATIONS === 'remoteNotifications';
|
||||
Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications';
|
||||
Permissions.NOTIFICATIONS === 'notifications';
|
||||
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
|
||||
Permissions.USER_FACING_NOTIFICATIONS === 'userFacingNotifications';
|
||||
Permissions.REMINDERS === 'reminders';
|
||||
async () => {
|
||||
const result = await Permissions.askAsync(Permissions.CAMERA);
|
||||
const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CONTACTS);
|
||||
|
||||
result.status === 'granted';
|
||||
result.status === 'denied';
|
||||
|
||||
Vendored
+13
-8
@@ -1905,7 +1905,7 @@ export namespace Pedometer {
|
||||
export namespace Permissions {
|
||||
type PermissionType = 'audioRecording' | 'calendar' |
|
||||
'cameraRoll' | 'camera' | 'contacts' | 'location' | 'reminders' |
|
||||
'remoteNotifications' | 'systemBrightness' | 'userFacingNotifications';
|
||||
'notifications' | 'systemBrightness' | 'userFacingNotifications';
|
||||
type PermissionStatus = 'undetermined' | 'granted' | 'denied';
|
||||
type PermissionExpires = 'never';
|
||||
|
||||
@@ -1917,17 +1917,23 @@ export namespace Permissions {
|
||||
scope: 'fine' | 'coarse' | 'none';
|
||||
}
|
||||
|
||||
interface PermissionResponse {
|
||||
interface SinglePermissionResponse {
|
||||
status: PermissionStatus;
|
||||
expires: PermissionExpires;
|
||||
ios?: PermissionDetailsLocationIOS;
|
||||
android?: PermissionDetailsLocationAndroid;
|
||||
}
|
||||
|
||||
function getAsync(type: PermissionType): Promise<PermissionResponse>;
|
||||
function askAsync(type: PermissionType): Promise<PermissionResponse>;
|
||||
interface PermissionResponse {
|
||||
status: PermissionStatus;
|
||||
expires: PermissionExpires;
|
||||
permissions: {
|
||||
[key in PermissionType]: SinglePermissionResponse
|
||||
};
|
||||
}
|
||||
|
||||
type RemoteNotificationPermission = 'remoteNotifications';
|
||||
function getAsync(...permissionTypes: PermissionType[]): Promise<PermissionResponse>;
|
||||
function askAsync(...permissionTypes: PermissionType[]): Promise<PermissionResponse>;
|
||||
|
||||
const AUDIO_RECORDING: 'audioRecording';
|
||||
const CALENDAR: 'calendar';
|
||||
@@ -1935,9 +1941,8 @@ export namespace Permissions {
|
||||
const CAMERA: 'camera';
|
||||
const CONTACTS: 'contacts';
|
||||
const LOCATION: 'location';
|
||||
const NOTIFICATIONS: RemoteNotificationPermission;
|
||||
const REMINDERS = 'reminders';
|
||||
const REMOTE_NOTIFICATIONS: RemoteNotificationPermission;
|
||||
const NOTIFICATIONS: 'notifications';
|
||||
const REMINDERS: 'reminders';
|
||||
const SYSTEM_BRIGHTNESS: 'systemBrightness';
|
||||
const USER_FACING_NOTIFICATIONS = 'userFacingNotifications';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user