mgtypes 1.0.56 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgtypes",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "types for mg development",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes
@@ -393,14 +393,15 @@ export interface mgPermissionsProfile {
393
393
  // VERSION OF THE APP? IF SO, THEY APPEAR IN SETTINGS
394
394
  NATIVE_PERMISSIONS: {
395
395
  LOCATION_FOREGROUND: { isRequired: boolean; requestOnInit: boolean };
396
- LOCATION_BACKGROUND: { isRequired: boolean; requestOnInit: boolean };
397
- MEDIA_LIBRARY: { isRequired: boolean; requestOnInit: boolean };
398
- REMINDERS: { isRequired: boolean; requestOnInit: boolean };
399
- NOTIFICATIONS: { isRequired: boolean; requestOnInit: boolean };
400
- CAMERA: { isRequired: boolean; requestOnInit: boolean };
401
- MICROPHONE: { isRequired: boolean; requestOnInit: boolean };
402
- CONTACTS: { isRequired: boolean; requestOnInit: boolean };
403
- CALENDAR: { isRequired: boolean; requestOnInit: boolean };
396
+ // TODO:permissionsConfig
397
+ // LOCATION_BACKGROUND: { isRequired: boolean; requestOnInit: boolean };
398
+ // MEDIA_LIBRARY: { isRequired: boolean; requestOnInit: boolean };
399
+ // REMINDERS: { isRequired: boolean; requestOnInit: boolean };
400
+ // NOTIFICATIONS: { isRequired: boolean; requestOnInit: boolean };
401
+ // CAMERA: { isRequired: boolean; requestOnInit: boolean };
402
+ // MICROPHONE: { isRequired: boolean; requestOnInit: boolean };
403
+ // CONTACTS: { isRequired: boolean; requestOnInit: boolean };
404
+ // CALENDAR: { isRequired: boolean; requestOnInit: boolean };
404
405
  };
405
406
  FEATURES: {
406
407
  CAN_HAVE_FRIENDS: boolean;
@@ -433,35 +434,37 @@ export interface mgPermissionsProfile {
433
434
  SHARE_LOCATIONS_FOR_EMERGENCIES: { canToggle: boolean; default: boolean };
434
435
  };
435
436
 
436
- CALENDAR: {
437
- ENABLE_CREATE_EVENTS: {
438
- canToggle: boolean;
439
- default: boolean;
440
- };
441
- ENABLE_CREATE_REMINDERS: {
442
- canToggle: boolean;
443
- default: boolean;
444
- };
445
- ENABLE_ADD_ATTENDEES: {
446
- canToggle: boolean;
447
- default: boolean;
448
- };
449
- };
450
-
451
- NOTIFICATIONS: {
452
- RECEIVE_RSVP_NOTIFICATIONS: {
453
- canToggle: boolean;
454
- default: boolean;
455
- };
456
- RECEIVE_EVENT_NEWS_NOTIFICATIONS: {
457
- canToggle: boolean;
458
- default: boolean;
459
- };
460
- RECEIVE_MARKETING_NOTIFICATIONS: {
461
- canToggle: boolean;
462
- default: boolean;
463
- };
464
- };
437
+ // TODO:permissionsConfig
438
+ // CALENDAR: {
439
+ // ENABLE_CREATE_EVENTS: {
440
+ // canToggle: boolean;
441
+ // default: boolean;
442
+ // };
443
+ // ENABLE_CREATE_REMINDERS: {
444
+ // canToggle: boolean;
445
+ // default: boolean;
446
+ // };
447
+ // ENABLE_ADD_ATTENDEES: {
448
+ // canToggle: boolean;
449
+ // default: boolean;
450
+ // };
451
+ // };
452
+
453
+ // TODO:permissionsConfig
454
+ // NOTIFICATIONS: {
455
+ // RECEIVE_RSVP_NOTIFICATIONS: {
456
+ // canToggle: boolean;
457
+ // default: boolean;
458
+ // };
459
+ // RECEIVE_EVENT_NEWS_NOTIFICATIONS: {
460
+ // canToggle: boolean;
461
+ // default: boolean;
462
+ // };
463
+ // RECEIVE_MARKETING_NOTIFICATIONS: {
464
+ // canToggle: boolean;
465
+ // default: boolean;
466
+ // };
467
+ // };
465
468
  }
466
469
 
467
470
  /**
@@ -472,9 +475,6 @@ export interface mgPermissionsProfile {
472
475
  * @param pins one of this property's internal properties can be 'all', which will filter all pins
473
476
  * @param plans same as above
474
477
  */
475
-
476
- // TODO: create a data structure that encapsulates
477
- // how filters might effectively work
478
478
  export interface mgMapFiltersProfile {
479
479
  [filterName: string]: mgMapFilter;
480
480
  }
@@ -10,6 +10,11 @@ export enum mgNativePermissionTitle {
10
10
  NOTIFICATIONS = 'NOTIFICATIONS',
11
11
  }
12
12
 
13
+ // TODO:permissionsConfig add other permission titles
14
+ export enum mgNonNativePermissionTitle {
15
+ mgLocationPermissionTitle,
16
+ }
17
+
13
18
  export enum mgLocationPermissionTitle {
14
19
  SHOW_LOCATION = 'SHOW_LOCATION',
15
20
  SHOW_DISTANCE_TO_PINS = 'SHOW_DISTANCE_TO_PINS',
@@ -19,21 +24,48 @@ export enum mgLocationPermissionTitle {
19
24
  SHARE_LOCATION_FOR_EMERGENCIES = 'SHARE_LOCATION_FOR_EMERGENCIES',
20
25
  }
21
26
 
22
- // adding all of them distinctly to
23
- // educate users; they can all be default
24
- // and disabled true
27
+ // TODO:permissionsConfig -- Not being used at the moment
25
28
  export enum mgCalendarPermissionTitle {
26
29
  ENABLE_CREATE_EVENTS = 'ENABLE_CREATE_EVENTS',
27
30
  ENABLE_CREATE_REMINDERS = 'ENABLE_CREATE_REMINDERS',
28
31
  ENABLE_ADD_ATTENDEES = 'ENABLE_ADD_ATTENDEES',
29
32
  }
30
33
 
34
+ // TODO:permissionsConfig -- Not being used at the moment
31
35
  export enum mgNotificationsPermissionTitle {
32
36
  RECEIVE_RSVP_NOTIFICATIONS = 'RECEIVE_RSVP_NOTIFICATIONS',
33
37
  RECEIVE_EVENT_NEWS_NOTIFICATIONS = 'RECEIVE_EVENT_NEWS_NOTIFICATIONS',
34
38
  RECEIVE_MARKETING_NOTIFICATIONS = 'RECEIVE_MARKETING_NOTIFICATIONS',
35
39
  }
36
40
 
41
+ export interface mgPermissionsState {
42
+ NATIVE: {
43
+ [permission: string]: {
44
+ status: 'granted' | 'undetermined' | 'denied';
45
+ canAskAgain: boolean;
46
+ // will display in info modal: these are non-native, non-toggleable, and true
47
+ defaultTruePermissions: mgLocationPermissionTitle[]; // TODO:permissionsConfig
48
+ toggleablePermissions: mgLocationPermissionTitle[]; // TODO:permissionsConfig
49
+ };
50
+ };
51
+ LOCATION: {
52
+ [permission: string]: mgNonNativePermission;
53
+ };
54
+ }
55
+
56
+ export interface mgNonNativePermission {
57
+ isGranted: boolean;
58
+ disabled: boolean;
59
+ ungrantedNativePermissions: mgNativePermissionTitle[];
60
+ }
61
+
62
+ export interface mgSecureStorePermission {
63
+ disabled: boolean;
64
+ isGranted: boolean;
65
+ }
66
+
67
+ // ORDERS OF PERMISSIONS
68
+
37
69
  export const nativePermissionsOrder: mgNativePermissionTitle[] = [
38
70
  mgNativePermissionTitle.LOCATION_FOREGROUND,
39
71
  mgNativePermissionTitle.LOCATION_BACKGROUND,