1export enum PermissionStatus {
2  /**
3   * User has granted the permission.
4   */
5  GRANTED = 'granted',
6  /**
7   * User hasn't granted or denied the permission yet.
8   */
9  UNDETERMINED = 'undetermined',
10  /**
11   * User has denied the permission.
12   */
13  DENIED = 'denied',
14}
15
16/**
17 * Permission expiration time. Currently, all permissions are granted permanently.
18 */
19export type PermissionExpiration = 'never' | number;
20
21/**
22 * An object obtained by permissions get and request functions.
23 */
24export interface PermissionResponse {
25  /**
26   * Determines the status of the permission.
27   */
28  status: PermissionStatus;
29  /**
30   * Determines time when the permission expires.
31   */
32  expires: PermissionExpiration;
33  /**
34   * A convenience boolean that indicates if the permission is granted.
35   */
36  granted: boolean;
37  /**
38   * Indicates if user can be asked again for specific permission.
39   * If not, one should be directed to the Settings app
40   * in order to enable/disable the permission.
41   */
42  canAskAgain: boolean;
43}
44