mgtypes 1.0.19 → 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.19",
3
+ "version": "1.0.21",
4
4
  "description": "types for mg development",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,39 +1,116 @@
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;
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 {
33
+ FEED_HEADER_IMAGE_NAMES: string[];
34
+ FEED_HEADER_CONFIG: {
35
+ position:
36
+ | 'upperLeft'
37
+ | 'upperRight'
38
+ | 'center'
39
+ | 'lowerLeft'
40
+ | 'lowerRight'
41
+ | null;
42
+ graphic: 'logo-large' | 'logo-small' | null;
43
+ fontFamily: string | null;
44
+ fontSize: 'small' | 'normal' | 'large' | null;
45
+ fontColor: 'primary' | 'light' | 'secondary';
46
+ dropShadow: boolean;
47
+ border: boolean;
48
+ iconOrientation: 'left' | 'right' | 'top' | 'bottom';
49
+ opacity: number;
50
+ };
51
+ }
52
+
53
+ /**
54
+ * Configs for event dates, locations, names, map details and feed header
55
+ */
56
+ export interface mgSpecs {
57
+ EVENT_NAME: string;
21
58
  EVENT_START_DATETIME: string;
59
+ EVENT_END_DATETIME: string;
22
60
  EVENT_LONGITUDE: string;
23
61
  EVENT_LATITUDE: string;
24
- EVENT_DEFAULT_MAP_BOUNDARIES: Position[];
25
- EVENT_NAME: string;
26
62
  APP_ALIAS: string;
27
- MAP_STYLE_URL: string;
28
- FEED_HEADER_IMAGE_NAMES: string[];
29
63
  }
30
64
 
31
- export interface EventColors {
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 {
32
110
  success: string;
33
111
  warning: string;
34
112
  warningUnselected: string;
35
113
  locationPuck: string;
36
-
37
114
  primary: string;
38
115
  onPrimary: string;
39
116
  primaryContainer: string;
@@ -77,7 +154,10 @@ export interface EventColors {
77
154
  backdrop: string;
78
155
  }
79
156
 
80
- interface MGFontTextStyle {
157
+ /**
158
+ * Configs for an individual font style
159
+ */
160
+ interface mgFontTextStyle {
81
161
  fontFamily?: string;
82
162
  fontWeight?: '200' | '300' | '400' | '500' | '700';
83
163
  letterSpacing?: number;
@@ -85,24 +165,30 @@ interface MGFontTextStyle {
85
165
  lineHeight?: number;
86
166
  }
87
167
 
88
- export interface EventFonts {
89
- labelLarge: MGFontTextStyle;
90
- labelMedium: MGFontTextStyle;
91
- labelSmall: MGFontTextStyle;
92
- bodyLarge: MGFontTextStyle;
93
- bodyMedium: MGFontTextStyle;
94
- displayMedium: MGFontTextStyle;
95
- displaySmall: MGFontTextStyle;
96
- headlineSmall: MGFontTextStyle;
97
- 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;
98
181
  }
99
182
 
100
- export interface EventStyles {
183
+ /**
184
+ * Configs for border and shadow styles
185
+ */
186
+ export interface mgStyles {
101
187
  containerBorderRadius: 'none' | 'small' | 'large' | 'full';
102
188
  containerBorderWidth: 'none' | 'thin' | 'normal' | 'thick';
103
189
  containerShadow: 'none' | 'small' | 'large';
104
190
  buttonBorderRadius: 'none' | 'small' | 'large' | 'full';
105
191
  buttonBorderWidth: 'none' | 'thin' | 'normal' | 'thick';
106
192
  buttonShadow: 'none' | 'small' | 'large';
107
- shadowRadius: 'small' | 'large' | 'none'
193
+ shadowRadius: 'small' | 'large' | 'none';
108
194
  }
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
  }