@magmamath/frontend-config 1.0.16 → 1.0.17

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/dist/index.d.mts CHANGED
@@ -34,7 +34,8 @@ declare enum Platform {
34
34
  STUDENTS_WEB = "STUDENTS",
35
35
  TEACHERS_WEB = "TEACHERS",
36
36
  DISTRICT_DASHBOARD = "DISTRICT",
37
- AUTH_WEB = "AUTH_WEB"
37
+ AUTH_WEB = "AUTH_WEB",
38
+ MOBILE = "MOBILE"
38
39
  }
39
40
  declare enum Environment {
40
41
  MARS = "MARS",
@@ -131,6 +132,14 @@ type SSO_DE = {
131
132
  MICROSOFT_AUTH: string;
132
133
  };
133
134
  type SSOVariant = SSO_US | SSO_DE | SSO_UK | SSO_SE;
135
+ type SSOByLocale = {
136
+ [Locale.US]: SSO_US;
137
+ [Locale.CA]: SSO_US;
138
+ [Locale.GB]: SSO_UK;
139
+ [Locale.SCT]: SSO_UK;
140
+ [Locale.SE]: SSO_SE;
141
+ [Locale.DE]: SSO_DE;
142
+ };
134
143
 
135
144
  type Prettify<T> = T extends Function ? T : {
136
145
  [K in keyof T]: T[K];
@@ -147,6 +156,43 @@ type RegionSpecificVars = {
147
156
  STUDENTS_WEB_URL: string;
148
157
  TEACHERS_WEB_URL: string;
149
158
  };
159
+
160
+ type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
161
+ type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
162
+ TOS_URL: string;
163
+ CLARITY_PROJECT_ID: string;
164
+ INTERCOM_APP_ID: string;
165
+ };
166
+ type AuthWebVarsPreset = {
167
+ [Locale.CA]: {
168
+ [key in Environment]: AuthWebVars<SSO_US>;
169
+ };
170
+ [Locale.DE]: {
171
+ [key in Environment]: AuthWebVars<SSO_DE>;
172
+ };
173
+ [Locale.GB]: {
174
+ [key in Environment]: AuthWebVars<SSO_UK>;
175
+ };
176
+ [Locale.SCT]: {
177
+ [key in Environment]: AuthWebVars<SSO_UK>;
178
+ };
179
+ [Locale.SE]: {
180
+ [key in Environment]: AuthWebVars<SSO_SE>;
181
+ };
182
+ [Locale.US]: {
183
+ [key in Environment]: AuthWebVars<SSO_US>;
184
+ };
185
+ };
186
+
187
+ type SSOConfig<T extends SSOVariant> = Readonly<{
188
+ name: string;
189
+ icon: ComponentType<IconProps>;
190
+ type: SSO;
191
+ loginSource: LoginSource;
192
+ getUrl: (envs: AuthWebVars<T>) => string;
193
+ ownUrl?: boolean;
194
+ }>;
195
+
150
196
  type StudentsWebCommon = {
151
197
  GOOGLE_API_KEY: string;
152
198
  DESMOS_API_KEY: string;
@@ -158,6 +204,13 @@ type StudentsWebCommon = {
158
204
  MYSCRIPT_REST_APP_KEY: string;
159
205
  MYSCRIPT_REST_HMAC_KEY: string;
160
206
  };
207
+ type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
208
+ type StudentsWebVarsPreset = {
209
+ [key in Locale]: {
210
+ [key in Environment]: StudentsWebVars;
211
+ };
212
+ };
213
+
161
214
  type TeachersWebCommon = {
162
215
  MYSCRIPT_HOST: string;
163
216
  MYSCRIPT_REST_APP_KEY: string;
@@ -167,67 +220,73 @@ type TeachersWebCommon = {
167
220
  CLARITY_PROJECT_ID: string;
168
221
  LOGGLY_CUSTOMER_TOKEN: string;
169
222
  };
223
+ type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
224
+ type TeachersWebVarsPreset = {
225
+ [key in Locale]: {
226
+ [key in Environment]: TeachersWebVars;
227
+ };
228
+ };
229
+
170
230
  type DistrictCommon = {
171
231
  INTERCOM_APP_ID: string;
172
232
  CLARITY_PROJECT_ID: string;
173
233
  PROBLEM_IMAGE_SIZE_LIMIT: number;
174
234
  };
175
- type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
176
- type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
177
235
  type DistrictDashboardVars = Omit<RegionSpecificVars, 'SOCKET_URL'> & DistrictCommon;
178
- type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
179
- TOS_URL: string;
180
- CLARITY_PROJECT_ID: string;
181
- INTERCOM_APP_ID: string;
236
+ type DistrictWebVarsPreset = {
237
+ [key in Locale]: {
238
+ [key in Environment]: DistrictDashboardVars;
239
+ };
182
240
  };
183
- type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
184
- type EnvPreset = Readonly<{
185
- [Platform.STUDENTS_WEB]: {
186
- [key in Locale]: {
187
- [key in Environment]: StudentsWebVars;
188
- };
241
+
242
+ type MobileCommon = {
243
+ DESMOS_API_KEY: string;
244
+ USER_AGENT: string;
245
+ LOGGLY_CUSTOMER_TOKEN: string;
246
+ MYSCRIPT_HOST: string;
247
+ MYSCRIPT_APPLICATION_KEY: string;
248
+ MYSCRIPT_HMAC_KEY: string;
249
+ MYSCRIPT_SOCKET_KEY: string;
250
+ MYSCRIPT_REST_APP_KEY: string;
251
+ MYSCRIPT_REST_HMAC_KEY: string;
252
+ };
253
+ type MobileBaseVars = {
254
+ TEACHERS_WEB_URL: string;
255
+ API_URL: string;
256
+ CDN_HOST: string;
257
+ SOCKET_URL: string;
258
+ LOGGLY_TAG: string;
259
+ } & MobileCommon;
260
+ type MobileVars<T extends SSOVariant> = Prettify<MobileBaseVars & T>;
261
+ type MobileVarsPreset = {
262
+ [Locale.CA]: {
263
+ [key in Environment]: MobileVars<SSO_US>;
189
264
  };
190
- [Platform.TEACHERS_WEB]: {
191
- [key in Locale]: {
192
- [key in Environment]: TeachersWebVars;
193
- };
265
+ [Locale.DE]: {
266
+ [key in Environment]: MobileVars<SSO_DE>;
194
267
  };
195
- [Platform.DISTRICT_DASHBOARD]: {
196
- [key in Locale]: {
197
- [key in Environment]: DistrictDashboardVars;
198
- };
268
+ [Locale.GB]: {
269
+ [key in Environment]: MobileVars<SSO_UK>;
199
270
  };
200
- [Platform.AUTH_WEB]: {
201
- [Locale.CA]: {
202
- [key in Environment]: AuthWebVars<SSO_US>;
203
- };
204
- [Locale.DE]: {
205
- [key in Environment]: AuthWebVars<SSO_DE>;
206
- };
207
- [Locale.GB]: {
208
- [key in Environment]: AuthWebVars<SSO_UK>;
209
- };
210
- [Locale.SCT]: {
211
- [key in Environment]: AuthWebVars<SSO_UK>;
212
- };
213
- [Locale.SE]: {
214
- [key in Environment]: AuthWebVars<SSO_SE>;
215
- };
216
- [Locale.US]: {
217
- [key in Environment]: AuthWebVars<SSO_US>;
218
- };
271
+ [Locale.SCT]: {
272
+ [key in Environment]: MobileVars<SSO_UK>;
219
273
  };
220
- }>;
221
- type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
274
+ [Locale.SE]: {
275
+ [key in Environment]: MobileVars<SSO_SE>;
276
+ };
277
+ [Locale.US]: {
278
+ [key in Environment]: MobileVars<SSO_US>;
279
+ };
280
+ };
222
281
 
223
- type SSOConfig<T extends SSOVariant> = Readonly<{
224
- name: string;
225
- icon: ComponentType<IconProps>;
226
- type: SSO;
227
- loginSource: LoginSource;
228
- getUrl: (envs: AuthWebVars<T>) => string;
229
- ownUrl?: boolean;
282
+ type EnvPreset = Readonly<{
283
+ [Platform.STUDENTS_WEB]: StudentsWebVarsPreset;
284
+ [Platform.TEACHERS_WEB]: TeachersWebVarsPreset;
285
+ [Platform.DISTRICT_DASHBOARD]: DistrictWebVarsPreset;
286
+ [Platform.AUTH_WEB]: AuthWebVarsPreset;
287
+ [Platform.MOBILE]: MobileVarsPreset;
230
288
  }>;
289
+ type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
231
290
 
232
291
  declare function buildTargetToEnvironment(buildTarget: PlatformBuildTarget): Environment;
233
292
 
@@ -383,10 +442,13 @@ type LocalePreset = {
383
442
  [key in Locale]: DistrictLocaleConfig;
384
443
  };
385
444
  [Platform.AUTH_WEB]: {
386
- [key in Locale]: AuthWebLocaleConfig<SSOVariant>;
445
+ [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
446
+ };
447
+ [Platform.MOBILE]: {
448
+ [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
387
449
  };
388
450
  };
389
- type LocaleConfig<P extends Platform> = LocalePreset[P][Locale];
451
+ type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
390
452
 
391
453
  type DevOverrides<P extends Platform> = {
392
454
  [K in Locale]?: Partial<EnvironmentVars<P>>;
@@ -396,46 +458,40 @@ type ConfigOptions<P extends Platform> = {
396
458
  environment: Environment;
397
459
  _DEV_OVERRIDES_?: DevOverrides<P>;
398
460
  };
399
- type SetProps = {
400
- locale?: Locale;
401
- envsRegion?: Locale;
461
+ type SetProps<L extends Locale> = {
462
+ locale?: L;
463
+ envsRegion?: L;
402
464
  environment?: Environment;
403
465
  };
404
- declare class AppConfigManager<P extends Platform> {
466
+ declare class AppConfigManager<P extends Platform, L extends Locale> {
405
467
  private readonly _DEV_OVERRIDES_?;
406
468
  private readonly platform;
407
469
  environment: Environment;
408
- locale: Locale;
409
- envsRegion: Locale;
470
+ locale: L;
471
+ envsRegion: L;
410
472
  private readonly setEnvs;
411
473
  private readonly setLocaleConfig;
412
474
  readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
413
- readonly $localeConfig: effector.StoreWritable<LocaleConfig<P>>;
475
+ readonly $localeConfig: effector.StoreWritable<LocaleConfig<P, L>>;
414
476
  constructor(opts: ConfigOptions<P>);
415
477
  private readonly syncConfigsStores;
416
- readonly set: (props: SetProps) => void;
478
+ readonly set: (props: SetProps<L>) => void;
417
479
  getEnvs: () => EnvironmentVars<P>;
418
- getLocaleConfig: () => LocaleConfig<P> & {
419
- locale: Locale;
480
+ getLocaleConfig: () => LocaleConfig<P, L> & {
481
+ locale: L;
420
482
  };
421
483
  readonly onEnvsChange: (cb: (cfg: EnvironmentVars<P>) => void) => effector.Subscription;
422
- readonly onLocaleChange: (cb: (cfg: LocaleConfig<P>) => void) => effector.Subscription;
484
+ readonly onLocaleChange: (cb: (cfg: LocaleConfig<P, L>) => void) => effector.Subscription;
423
485
  readonly getPresets: () => {
424
486
  envPreset: Readonly<{
425
- STUDENTS: { [key in Locale]: { [key_1 in Environment]: StudentsWebVars; }; };
426
- TEACHERS: { [key in Locale]: { [key_1 in Environment]: TeachersWebVars; }; };
427
- DISTRICT: { [key in Locale]: { [key_1 in Environment]: DistrictDashboardVars; }; };
428
- AUTH_WEB: {
429
- [Locale.CA]: { [key in Environment]: AuthWebVars<SSO_US>; };
430
- [Locale.DE]: { [key in Environment]: AuthWebVars<SSO_DE>; };
431
- [Locale.GB]: { [key in Environment]: AuthWebVars<SSO_UK>; };
432
- [Locale.SCT]: { [key in Environment]: AuthWebVars<SSO_UK>; };
433
- [Locale.SE]: { [key in Environment]: AuthWebVars<SSO_SE>; };
434
- [Locale.US]: { [key in Environment]: AuthWebVars<SSO_US>; };
435
- };
487
+ STUDENTS: StudentsWebVarsPreset;
488
+ TEACHERS: TeachersWebVarsPreset;
489
+ DISTRICT: DistrictWebVarsPreset;
490
+ AUTH_WEB: AuthWebVarsPreset;
491
+ MOBILE: MobileVarsPreset;
436
492
  }>;
437
493
  localePreset: LocalePreset;
438
494
  };
439
495
  }
440
496
 
441
- export { AppConfigManager, type AuthWebVars, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, Platform, PlatformBuildTarget, type RegionSpecificVars, SSO, type SSOConfig, Source, type StudentsWebCommon, type StudentsWebVars, type TeachersWebCommon, type TeachersWebVars, buildTargetToEnvironment };
497
+ export { AppConfigManager, DateFormat, DateLocale, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, Platform, PlatformBuildTarget, SSO, type SSOConfig, Source, buildTargetToEnvironment };
package/dist/index.d.ts CHANGED
@@ -34,7 +34,8 @@ declare enum Platform {
34
34
  STUDENTS_WEB = "STUDENTS",
35
35
  TEACHERS_WEB = "TEACHERS",
36
36
  DISTRICT_DASHBOARD = "DISTRICT",
37
- AUTH_WEB = "AUTH_WEB"
37
+ AUTH_WEB = "AUTH_WEB",
38
+ MOBILE = "MOBILE"
38
39
  }
39
40
  declare enum Environment {
40
41
  MARS = "MARS",
@@ -131,6 +132,14 @@ type SSO_DE = {
131
132
  MICROSOFT_AUTH: string;
132
133
  };
133
134
  type SSOVariant = SSO_US | SSO_DE | SSO_UK | SSO_SE;
135
+ type SSOByLocale = {
136
+ [Locale.US]: SSO_US;
137
+ [Locale.CA]: SSO_US;
138
+ [Locale.GB]: SSO_UK;
139
+ [Locale.SCT]: SSO_UK;
140
+ [Locale.SE]: SSO_SE;
141
+ [Locale.DE]: SSO_DE;
142
+ };
134
143
 
135
144
  type Prettify<T> = T extends Function ? T : {
136
145
  [K in keyof T]: T[K];
@@ -147,6 +156,43 @@ type RegionSpecificVars = {
147
156
  STUDENTS_WEB_URL: string;
148
157
  TEACHERS_WEB_URL: string;
149
158
  };
159
+
160
+ type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
161
+ type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
162
+ TOS_URL: string;
163
+ CLARITY_PROJECT_ID: string;
164
+ INTERCOM_APP_ID: string;
165
+ };
166
+ type AuthWebVarsPreset = {
167
+ [Locale.CA]: {
168
+ [key in Environment]: AuthWebVars<SSO_US>;
169
+ };
170
+ [Locale.DE]: {
171
+ [key in Environment]: AuthWebVars<SSO_DE>;
172
+ };
173
+ [Locale.GB]: {
174
+ [key in Environment]: AuthWebVars<SSO_UK>;
175
+ };
176
+ [Locale.SCT]: {
177
+ [key in Environment]: AuthWebVars<SSO_UK>;
178
+ };
179
+ [Locale.SE]: {
180
+ [key in Environment]: AuthWebVars<SSO_SE>;
181
+ };
182
+ [Locale.US]: {
183
+ [key in Environment]: AuthWebVars<SSO_US>;
184
+ };
185
+ };
186
+
187
+ type SSOConfig<T extends SSOVariant> = Readonly<{
188
+ name: string;
189
+ icon: ComponentType<IconProps>;
190
+ type: SSO;
191
+ loginSource: LoginSource;
192
+ getUrl: (envs: AuthWebVars<T>) => string;
193
+ ownUrl?: boolean;
194
+ }>;
195
+
150
196
  type StudentsWebCommon = {
151
197
  GOOGLE_API_KEY: string;
152
198
  DESMOS_API_KEY: string;
@@ -158,6 +204,13 @@ type StudentsWebCommon = {
158
204
  MYSCRIPT_REST_APP_KEY: string;
159
205
  MYSCRIPT_REST_HMAC_KEY: string;
160
206
  };
207
+ type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
208
+ type StudentsWebVarsPreset = {
209
+ [key in Locale]: {
210
+ [key in Environment]: StudentsWebVars;
211
+ };
212
+ };
213
+
161
214
  type TeachersWebCommon = {
162
215
  MYSCRIPT_HOST: string;
163
216
  MYSCRIPT_REST_APP_KEY: string;
@@ -167,67 +220,73 @@ type TeachersWebCommon = {
167
220
  CLARITY_PROJECT_ID: string;
168
221
  LOGGLY_CUSTOMER_TOKEN: string;
169
222
  };
223
+ type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
224
+ type TeachersWebVarsPreset = {
225
+ [key in Locale]: {
226
+ [key in Environment]: TeachersWebVars;
227
+ };
228
+ };
229
+
170
230
  type DistrictCommon = {
171
231
  INTERCOM_APP_ID: string;
172
232
  CLARITY_PROJECT_ID: string;
173
233
  PROBLEM_IMAGE_SIZE_LIMIT: number;
174
234
  };
175
- type StudentsWebVars = RegionSpecificVars & StudentsWebCommon;
176
- type TeachersWebVars = RegionSpecificVars & TeachersWebCommon;
177
235
  type DistrictDashboardVars = Omit<RegionSpecificVars, 'SOCKET_URL'> & DistrictCommon;
178
- type AuthWebBaseVars = Omit<RegionSpecificVars, 'CDN_HOST' | 'LOGGLY_TAG' | 'SOCKET_URL'> & {
179
- TOS_URL: string;
180
- CLARITY_PROJECT_ID: string;
181
- INTERCOM_APP_ID: string;
236
+ type DistrictWebVarsPreset = {
237
+ [key in Locale]: {
238
+ [key in Environment]: DistrictDashboardVars;
239
+ };
182
240
  };
183
- type AuthWebVars<T extends SSOVariant> = Prettify<AuthWebBaseVars & T>;
184
- type EnvPreset = Readonly<{
185
- [Platform.STUDENTS_WEB]: {
186
- [key in Locale]: {
187
- [key in Environment]: StudentsWebVars;
188
- };
241
+
242
+ type MobileCommon = {
243
+ DESMOS_API_KEY: string;
244
+ USER_AGENT: string;
245
+ LOGGLY_CUSTOMER_TOKEN: string;
246
+ MYSCRIPT_HOST: string;
247
+ MYSCRIPT_APPLICATION_KEY: string;
248
+ MYSCRIPT_HMAC_KEY: string;
249
+ MYSCRIPT_SOCKET_KEY: string;
250
+ MYSCRIPT_REST_APP_KEY: string;
251
+ MYSCRIPT_REST_HMAC_KEY: string;
252
+ };
253
+ type MobileBaseVars = {
254
+ TEACHERS_WEB_URL: string;
255
+ API_URL: string;
256
+ CDN_HOST: string;
257
+ SOCKET_URL: string;
258
+ LOGGLY_TAG: string;
259
+ } & MobileCommon;
260
+ type MobileVars<T extends SSOVariant> = Prettify<MobileBaseVars & T>;
261
+ type MobileVarsPreset = {
262
+ [Locale.CA]: {
263
+ [key in Environment]: MobileVars<SSO_US>;
189
264
  };
190
- [Platform.TEACHERS_WEB]: {
191
- [key in Locale]: {
192
- [key in Environment]: TeachersWebVars;
193
- };
265
+ [Locale.DE]: {
266
+ [key in Environment]: MobileVars<SSO_DE>;
194
267
  };
195
- [Platform.DISTRICT_DASHBOARD]: {
196
- [key in Locale]: {
197
- [key in Environment]: DistrictDashboardVars;
198
- };
268
+ [Locale.GB]: {
269
+ [key in Environment]: MobileVars<SSO_UK>;
199
270
  };
200
- [Platform.AUTH_WEB]: {
201
- [Locale.CA]: {
202
- [key in Environment]: AuthWebVars<SSO_US>;
203
- };
204
- [Locale.DE]: {
205
- [key in Environment]: AuthWebVars<SSO_DE>;
206
- };
207
- [Locale.GB]: {
208
- [key in Environment]: AuthWebVars<SSO_UK>;
209
- };
210
- [Locale.SCT]: {
211
- [key in Environment]: AuthWebVars<SSO_UK>;
212
- };
213
- [Locale.SE]: {
214
- [key in Environment]: AuthWebVars<SSO_SE>;
215
- };
216
- [Locale.US]: {
217
- [key in Environment]: AuthWebVars<SSO_US>;
218
- };
271
+ [Locale.SCT]: {
272
+ [key in Environment]: MobileVars<SSO_UK>;
219
273
  };
220
- }>;
221
- type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
274
+ [Locale.SE]: {
275
+ [key in Environment]: MobileVars<SSO_SE>;
276
+ };
277
+ [Locale.US]: {
278
+ [key in Environment]: MobileVars<SSO_US>;
279
+ };
280
+ };
222
281
 
223
- type SSOConfig<T extends SSOVariant> = Readonly<{
224
- name: string;
225
- icon: ComponentType<IconProps>;
226
- type: SSO;
227
- loginSource: LoginSource;
228
- getUrl: (envs: AuthWebVars<T>) => string;
229
- ownUrl?: boolean;
282
+ type EnvPreset = Readonly<{
283
+ [Platform.STUDENTS_WEB]: StudentsWebVarsPreset;
284
+ [Platform.TEACHERS_WEB]: TeachersWebVarsPreset;
285
+ [Platform.DISTRICT_DASHBOARD]: DistrictWebVarsPreset;
286
+ [Platform.AUTH_WEB]: AuthWebVarsPreset;
287
+ [Platform.MOBILE]: MobileVarsPreset;
230
288
  }>;
289
+ type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
231
290
 
232
291
  declare function buildTargetToEnvironment(buildTarget: PlatformBuildTarget): Environment;
233
292
 
@@ -383,10 +442,13 @@ type LocalePreset = {
383
442
  [key in Locale]: DistrictLocaleConfig;
384
443
  };
385
444
  [Platform.AUTH_WEB]: {
386
- [key in Locale]: AuthWebLocaleConfig<SSOVariant>;
445
+ [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
446
+ };
447
+ [Platform.MOBILE]: {
448
+ [key in Locale]: AuthWebLocaleConfig<SSOByLocale[key]>;
387
449
  };
388
450
  };
389
- type LocaleConfig<P extends Platform> = LocalePreset[P][Locale];
451
+ type LocaleConfig<P extends Platform, L extends Locale> = LocalePreset[P][L];
390
452
 
391
453
  type DevOverrides<P extends Platform> = {
392
454
  [K in Locale]?: Partial<EnvironmentVars<P>>;
@@ -396,46 +458,40 @@ type ConfigOptions<P extends Platform> = {
396
458
  environment: Environment;
397
459
  _DEV_OVERRIDES_?: DevOverrides<P>;
398
460
  };
399
- type SetProps = {
400
- locale?: Locale;
401
- envsRegion?: Locale;
461
+ type SetProps<L extends Locale> = {
462
+ locale?: L;
463
+ envsRegion?: L;
402
464
  environment?: Environment;
403
465
  };
404
- declare class AppConfigManager<P extends Platform> {
466
+ declare class AppConfigManager<P extends Platform, L extends Locale> {
405
467
  private readonly _DEV_OVERRIDES_?;
406
468
  private readonly platform;
407
469
  environment: Environment;
408
- locale: Locale;
409
- envsRegion: Locale;
470
+ locale: L;
471
+ envsRegion: L;
410
472
  private readonly setEnvs;
411
473
  private readonly setLocaleConfig;
412
474
  readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
413
- readonly $localeConfig: effector.StoreWritable<LocaleConfig<P>>;
475
+ readonly $localeConfig: effector.StoreWritable<LocaleConfig<P, L>>;
414
476
  constructor(opts: ConfigOptions<P>);
415
477
  private readonly syncConfigsStores;
416
- readonly set: (props: SetProps) => void;
478
+ readonly set: (props: SetProps<L>) => void;
417
479
  getEnvs: () => EnvironmentVars<P>;
418
- getLocaleConfig: () => LocaleConfig<P> & {
419
- locale: Locale;
480
+ getLocaleConfig: () => LocaleConfig<P, L> & {
481
+ locale: L;
420
482
  };
421
483
  readonly onEnvsChange: (cb: (cfg: EnvironmentVars<P>) => void) => effector.Subscription;
422
- readonly onLocaleChange: (cb: (cfg: LocaleConfig<P>) => void) => effector.Subscription;
484
+ readonly onLocaleChange: (cb: (cfg: LocaleConfig<P, L>) => void) => effector.Subscription;
423
485
  readonly getPresets: () => {
424
486
  envPreset: Readonly<{
425
- STUDENTS: { [key in Locale]: { [key_1 in Environment]: StudentsWebVars; }; };
426
- TEACHERS: { [key in Locale]: { [key_1 in Environment]: TeachersWebVars; }; };
427
- DISTRICT: { [key in Locale]: { [key_1 in Environment]: DistrictDashboardVars; }; };
428
- AUTH_WEB: {
429
- [Locale.CA]: { [key in Environment]: AuthWebVars<SSO_US>; };
430
- [Locale.DE]: { [key in Environment]: AuthWebVars<SSO_DE>; };
431
- [Locale.GB]: { [key in Environment]: AuthWebVars<SSO_UK>; };
432
- [Locale.SCT]: { [key in Environment]: AuthWebVars<SSO_UK>; };
433
- [Locale.SE]: { [key in Environment]: AuthWebVars<SSO_SE>; };
434
- [Locale.US]: { [key in Environment]: AuthWebVars<SSO_US>; };
435
- };
487
+ STUDENTS: StudentsWebVarsPreset;
488
+ TEACHERS: TeachersWebVarsPreset;
489
+ DISTRICT: DistrictWebVarsPreset;
490
+ AUTH_WEB: AuthWebVarsPreset;
491
+ MOBILE: MobileVarsPreset;
436
492
  }>;
437
493
  localePreset: LocalePreset;
438
494
  };
439
495
  }
440
496
 
441
- export { AppConfigManager, type AuthWebVars, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, Platform, PlatformBuildTarget, type RegionSpecificVars, SSO, type SSOConfig, Source, type StudentsWebCommon, type StudentsWebVars, type TeachersWebCommon, type TeachersWebVars, buildTargetToEnvironment };
497
+ export { AppConfigManager, DateFormat, DateLocale, type EnvPreset, Environment, type EnvironmentVars, Locale, LoginSource, MatrixMode, Platform, PlatformBuildTarget, SSO, type SSOConfig, Source, buildTargetToEnvironment };