mgtypes 1.0.20 → 1.0.21

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.20",
3
+ "version": "1.0.21",
4
4
  "description": "types for mg development",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,30 +1,35 @@
1
1
  import { Position } from 'geojson';
2
2
  import { MapSign } from './App';
3
3
 
4
+ /**
5
+ * Mother Config object
6
+ */
4
7
  export interface Configuration {
5
- eventSpecs: EventSpecs;
6
- eventColors: EventColors;
7
- eventFonts: EventFonts;
8
- eventStyles: EventStyles;
8
+ specs: mgSpecs;
9
+ colors: mgColors;
10
+ fonts: mgFonts;
11
+ styles: mgStyles;
12
+ features: mgFeatures;
13
+ map: mgMap;
14
+ feed: mgFeed;
9
15
  }
10
16
 
11
- export interface EventSpecs {
12
- EVENT_TAGS: string[];
13
- PIN_TYPES: { [key: string]: string[] };
14
- PLAN_TYPES: string[];
15
- USER_CREATABLE_CONTENT_TYPES: { [key: string]: { [key: string]: any } };
16
- USER_MAP_FILTER_OPTIONS: { [key: string]: any };
17
- SERVICE_TYPES: { [key: string]: any };
18
- EMERGENCY_TYPES: { [key: string]: any };
17
+
18
+ /**
19
+ * Configs for map
20
+ */
21
+ export interface mgMap {
19
22
  MAP_LABELS: { zoomThresholds: number[]; labels: MapSign[][] };
20
- EVENT_END_DATETIME: string;
21
- EVENT_START_DATETIME: string;
22
- EVENT_LONGITUDE: string;
23
- EVENT_LATITUDE: string;
24
- EVENT_DEFAULT_MAP_BOUNDARIES: Position[];
25
- EVENT_NAME: string;
26
- APP_ALIAS: string;
27
23
  MAP_STYLE_URL: string;
24
+ DEFAULT_MAP_BOUNDARIES: Position[];
25
+ MAP_FILTERS: { [key: string]: any };
26
+ }
27
+
28
+
29
+ /**
30
+ * Configs for feed
31
+ */
32
+ export interface mgFeed {
28
33
  FEED_HEADER_IMAGE_NAMES: string[];
29
34
  FEED_HEADER_CONFIG: {
30
35
  position:
@@ -45,12 +50,67 @@ export interface EventSpecs {
45
50
  };
46
51
  }
47
52
 
48
- export interface EventColors {
53
+ /**
54
+ * Configs for event dates, locations, names, map details and feed header
55
+ */
56
+ export interface mgSpecs {
57
+ EVENT_NAME: string;
58
+ EVENT_START_DATETIME: string;
59
+ EVENT_END_DATETIME: string;
60
+ EVENT_LONGITUDE: string;
61
+ EVENT_LATITUDE: string;
62
+ APP_ALIAS: string;
63
+ }
64
+
65
+ interface PERMISSION_PROFILE {
66
+ comment: boolean;
67
+ photo: boolean;
68
+ pin:
69
+ | {
70
+ [key: string]: any;
71
+ }
72
+ | false;
73
+ plan:
74
+ | {
75
+ [key: string]: any;
76
+ }
77
+ | false;
78
+ route: boolean;
79
+ }
80
+
81
+ /**
82
+ * Configs that dictate user interactivity and determine what the configured app "is all about", so to speak
83
+ * @param PERMISSION_PROFILES dictates what types of content users with various roles can add through the app. A configured object for each role (GUEST, USER, etc.) is a PERMISSION_PROFILE:
84
+ *
85
+ * {
86
+ * comment: true,
87
+ * photo: false,
88
+ * pin: { personal: ['car', 'bicycle', 'default'] },
89
+ * plan: { sport: ['soccer'] },
90
+ * route: false
91
+ },
92
+ */
93
+ export interface mgFeatures {
94
+ EVENT_TAGS: string[];
95
+ PIN_TYPES: { [key: string]: string[] };
96
+ PLAN_TYPES: { [key: string]: string[] };
97
+ SERVICE_TYPES: { [key: string]: any };
98
+ EMERGENCY_TYPES: { [key: string]: any };
99
+ USER_AUTH_SETTING: 'guest only' | 'account only' | 'guest or account';
100
+ PERMISSION_PROFILES: {
101
+ GUEST: PERMISSION_PROFILE;
102
+ USER: PERMISSION_PROFILE;
103
+ };
104
+ }
105
+
106
+ /**
107
+ * Configs based on React Native Paper color assignments w/ some extras
108
+ */
109
+ export interface mgColors {
49
110
  success: string;
50
111
  warning: string;
51
112
  warningUnselected: string;
52
113
  locationPuck: string;
53
-
54
114
  primary: string;
55
115
  onPrimary: string;
56
116
  primaryContainer: string;
@@ -94,7 +154,10 @@ export interface EventColors {
94
154
  backdrop: string;
95
155
  }
96
156
 
97
- interface MGFontTextStyle {
157
+ /**
158
+ * Configs for an individual font style
159
+ */
160
+ interface mgFontTextStyle {
98
161
  fontFamily?: string;
99
162
  fontWeight?: '200' | '300' | '400' | '500' | '700';
100
163
  letterSpacing?: number;
@@ -102,19 +165,25 @@ interface MGFontTextStyle {
102
165
  lineHeight?: number;
103
166
  }
104
167
 
105
- export interface EventFonts {
106
- labelLarge: MGFontTextStyle;
107
- labelMedium: MGFontTextStyle;
108
- labelSmall: MGFontTextStyle;
109
- bodyLarge: MGFontTextStyle;
110
- bodyMedium: MGFontTextStyle;
111
- displayMedium: MGFontTextStyle;
112
- displaySmall: MGFontTextStyle;
113
- headlineSmall: MGFontTextStyle;
114
- default: MGFontTextStyle;
168
+ /**
169
+ * Configs for all the app's font styles
170
+ */
171
+ export interface mgFonts {
172
+ labelLarge: mgFontTextStyle;
173
+ labelMedium: mgFontTextStyle;
174
+ labelSmall: mgFontTextStyle;
175
+ bodyLarge: mgFontTextStyle;
176
+ bodyMedium: mgFontTextStyle;
177
+ displayMedium: mgFontTextStyle;
178
+ displaySmall: mgFontTextStyle;
179
+ headlineSmall: mgFontTextStyle;
180
+ default: mgFontTextStyle;
115
181
  }
116
182
 
117
- export interface EventStyles {
183
+ /**
184
+ * Configs for border and shadow styles
185
+ */
186
+ export interface mgStyles {
118
187
  containerBorderRadius: 'none' | 'small' | 'large' | 'full';
119
188
  containerBorderWidth: 'none' | 'thin' | 'normal' | 'thick';
120
189
  containerShadow: 'none' | 'small' | 'large';
package/types/User.ts CHANGED
@@ -22,7 +22,7 @@ export interface UserRole {
22
22
  id: number | null;
23
23
  createdAt: string | null;
24
24
  updatedAt: string | null;
25
- role: 'user' | 'admin' | 'medical' | 'fire' | 'security' | 'advertiser' |'mental-health'|'vendor'; // TODO: make this configurable
25
+ role: 'user' | 'admin' | 'medical' | 'fire' | 'security' | 'advertiser' |'mental_health'|'vendor';
26
26
  userId: number | null;
27
27
  isActiveRole: boolean;
28
28
  }