types.ts 750B

123456789101112131415161718192021222324252627282930313233
  1. import {ANDROID, IOS, RESULTS} from './constants';
  2. type Values<T extends object> = T[keyof T];
  3. export type AndroidPermission = Values<typeof ANDROID>;
  4. export type IOSPermission = Values<typeof IOS>;
  5. export type Permission = AndroidPermission | IOSPermission;
  6. export type PermissionStatus = Values<typeof RESULTS>;
  7. export type NotificationOption =
  8. | 'alert'
  9. | 'badge'
  10. | 'sound'
  11. | 'carPlay'
  12. | 'criticalAlert'
  13. | 'provisional';
  14. export interface NotificationSettings {
  15. alert?: boolean;
  16. badge?: boolean;
  17. sound?: boolean;
  18. carPlay?: boolean;
  19. criticalAlert?: boolean;
  20. lockScreen?: boolean;
  21. notificationCenter?: boolean;
  22. }
  23. export interface NotificationsResponse {
  24. status: PermissionStatus;
  25. settings: NotificationSettings;
  26. }