mgtypes 1.0.57 → 1.0.58

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.57",
3
+ "version": "1.0.58",
4
4
  "description": "types for mg development",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,3 +1,5 @@
1
+ // TITLES /////////////////////////////////////////////
2
+
1
3
  export enum mgNativePermissionTitle {
2
4
  LOCATION_FOREGROUND = 'LOCATION_FOREGROUND',
3
5
  LOCATION_BACKGROUND = 'LOCATION_BACKGROUND',
@@ -38,33 +40,39 @@ export enum mgNotificationsPermissionTitle {
38
40
  RECEIVE_MARKETING_NOTIFICATIONS = 'RECEIVE_MARKETING_NOTIFICATIONS',
39
41
  }
40
42
 
43
+ // STATE //////////////////////////////////////////////
41
44
  export interface mgPermissionsState {
42
45
  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
- };
46
+ [permission: string]: mgNativePermission;
50
47
  };
51
48
  LOCATION: {
52
49
  [permission: string]: mgNonNativePermission;
53
50
  };
54
51
  }
55
52
 
53
+ export interface mgNativePermission {
54
+ status: 'granted' | 'undetermined' | 'denied';
55
+ canAskAgain: boolean;
56
+ // will display in info modal: these are non-native, non-toggleable, and true
57
+ defaultTruePermissions: mgNonNativePermissionTitle[]; // TODO:permissionsConfig
58
+ toggleablePermissions: mgNonNativePermissionTitle[]; // TODO:permissionsConfig
59
+ }
60
+
56
61
  export interface mgNonNativePermission {
57
62
  isGranted: boolean;
58
63
  disabled: boolean;
59
64
  ungrantedNativePermissions: mgNativePermissionTitle[];
60
65
  }
61
66
 
67
+ /**
68
+ * a non-native permission state in secure store
69
+ */
62
70
  export interface mgSecureStorePermission {
63
- disabled: boolean;
71
+ disabled: boolean; // disabled permisions won't be displayed in Settings page
64
72
  isGranted: boolean;
65
73
  }
66
74
 
67
- // ORDERS OF PERMISSIONS
75
+ // ORDERS OF PERMISSIONS //////////////////////////////////
68
76
 
69
77
  export const nativePermissionsOrder: mgNativePermissionTitle[] = [
70
78
  mgNativePermissionTitle.LOCATION_FOREGROUND,