@magmamath/frontend-config 0.0.1-rc.8 → 1.0.0
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/commonjs/index.js +4 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/module/index.js +4 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/src/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/src/index.d.ts +1 -0
- package/dist/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +68 -28
- package/src/index.ts +1 -0
- package/dist/index.d.mts +0 -247
- package/dist/index.d.ts +0 -247
- package/dist/index.js +0 -1781
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1773
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["console","log"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAAA,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["console","log"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAAA,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,37 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/frontend-config",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
],
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"main": "./dist/commonjs/index.js",
|
|
11
10
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"dev": "tsup --watch",
|
|
14
|
-
"lint": "eslint src/**/*.ts",
|
|
15
|
-
"clean": "rimraf dist",
|
|
16
|
-
"test": "vitest run",
|
|
17
|
-
"prepublishOnly": "npm run build"
|
|
11
|
+
"prepare": "bob build"
|
|
18
12
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
13
|
+
"homepage": "https://github.com/matteappen/frontend-config#readme",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/matteappen/frontend-config.git"
|
|
21
17
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"chokidar": "^3.5.3"
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/matteappen/frontend-config/issues"
|
|
27
20
|
},
|
|
28
21
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"typescript": "^5.9.3"
|
|
36
|
-
|
|
22
|
+
"@eslint/js": "^9.39.0",
|
|
23
|
+
"eslint": "^9.39.0",
|
|
24
|
+
"eslint-config-prettier": "^10.1.8",
|
|
25
|
+
"globals": "^16.5.0",
|
|
26
|
+
"prettier": "3.6.2",
|
|
27
|
+
"react-native-builder-bob": "^0.40.14",
|
|
28
|
+
"typescript": "^5.9.3",
|
|
29
|
+
"typescript-eslint": "^8.46.2"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"source": "./src/index.ts",
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./dist/typescript/module/src/index.d.ts",
|
|
36
|
+
"default": "./dist/module/index.js"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./dist/typescript/commonjs/src/index.d.ts",
|
|
40
|
+
"default": "./dist/commonjs/index.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"./package.json": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
"module": "./dist/module/index.js",
|
|
46
|
+
"types": "./dist/typescript/commonjs/src/index.d.ts",
|
|
47
|
+
"files": [
|
|
48
|
+
"src",
|
|
49
|
+
"dist",
|
|
50
|
+
"!**/__tests__",
|
|
51
|
+
"!**/__fixtures__",
|
|
52
|
+
"!**/__mocks__"
|
|
53
|
+
],
|
|
54
|
+
"react-native-builder-bob": {
|
|
55
|
+
"source": "src",
|
|
56
|
+
"output": "dist",
|
|
57
|
+
"targets": [
|
|
58
|
+
[
|
|
59
|
+
"module",
|
|
60
|
+
{
|
|
61
|
+
"esm": true
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
[
|
|
65
|
+
"commonjs",
|
|
66
|
+
{
|
|
67
|
+
"esm": true
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"typescript"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"eslintIgnore": [
|
|
74
|
+
"node_modules/",
|
|
75
|
+
"dist/"
|
|
76
|
+
]
|
|
37
77
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('index2')
|
package/dist/index.d.mts
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import * as effector from 'effector';
|
|
2
|
-
|
|
3
|
-
declare const enum DateFormat {
|
|
4
|
-
FULL = "YYYY-MM-DD HH:mm",
|
|
5
|
-
FULL_US = "YYYY-MM-DD hh:mm A",
|
|
6
|
-
DAY_MONTH_YEAR = "DD-MM-YYYY",
|
|
7
|
-
DAY_MONTH_YEAR_US = "YYYY-MM-DD",
|
|
8
|
-
HOURS_MINUTES = "HH:mm",
|
|
9
|
-
HOURS_MINUTES_US = "hh:mm A",
|
|
10
|
-
DAY_MONTH = "DD MMM",
|
|
11
|
-
DAY_MONTH_US = "MMM DD",
|
|
12
|
-
YEAR_MONTH_DAY = "YYYY-MM-DD",
|
|
13
|
-
FULL_WITH_SECONDS = "DD MMM YYYY HH:mm:ss",
|
|
14
|
-
FULL_WITH_SECONDS_US = "DD MMM YYYY hh:mm:ss A"
|
|
15
|
-
}
|
|
16
|
-
declare const DateLocale: {
|
|
17
|
-
readonly US: "en";
|
|
18
|
-
readonly SV: "sv";
|
|
19
|
-
readonly 'en-SE': "en";
|
|
20
|
-
readonly 'sv-SE': "sv";
|
|
21
|
-
readonly GB: "en";
|
|
22
|
-
readonly 'en-GB': "en";
|
|
23
|
-
readonly CA: "en";
|
|
24
|
-
readonly 'en-CA': "en";
|
|
25
|
-
readonly SCT: "en";
|
|
26
|
-
readonly 'en-SCT': "en";
|
|
27
|
-
readonly DE: "de";
|
|
28
|
-
readonly 'de-DE': "de";
|
|
29
|
-
};
|
|
30
|
-
type DateLocale = (typeof DateLocale)[keyof typeof DateLocale];
|
|
31
|
-
|
|
32
|
-
declare enum Platform {
|
|
33
|
-
STUDENTS_WEB = "STUDENTS",
|
|
34
|
-
TEACHERS_WEB = "TEACHERS",
|
|
35
|
-
DISTRICT_DASHBOARD = "DISTRICT",
|
|
36
|
-
AUTH_WEB = "AUTH_WEB",
|
|
37
|
-
STUDENTS_APP = "STUDENTS_RN_APP",
|
|
38
|
-
TEACHERS_APP = "TEACHERS_RN_APP"
|
|
39
|
-
}
|
|
40
|
-
declare enum Locale {
|
|
41
|
-
US = "en-SE",
|
|
42
|
-
SE = "sv-SE",
|
|
43
|
-
GB = "en-GB",
|
|
44
|
-
CA = "en-CA",
|
|
45
|
-
SCT = "en-SCT",
|
|
46
|
-
DE = "de-DE"
|
|
47
|
-
}
|
|
48
|
-
declare enum Environment {
|
|
49
|
-
MARS = "MARS",
|
|
50
|
-
PROD = "PROD"
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
declare enum MatrixMode {
|
|
54
|
-
SKILL = "SKILL",
|
|
55
|
-
STANDARD = "STANDARD"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type RegionEnv = Readonly<{
|
|
59
|
-
API_URL: string;
|
|
60
|
-
AUTH_WEB_URL: string;
|
|
61
|
-
MYSCRIPT_HOST: string;
|
|
62
|
-
LOGGLY_TAG: string;
|
|
63
|
-
SKOLFED_AUTH: string;
|
|
64
|
-
SOCKET_URL: string;
|
|
65
|
-
STUDENTS_WEB_URL: string;
|
|
66
|
-
TEACHERS_WEB_URL: string;
|
|
67
|
-
CDN_HOST: string;
|
|
68
|
-
}>;
|
|
69
|
-
type CommonEnv = Readonly<{
|
|
70
|
-
GOOGLE_API_KEY: string;
|
|
71
|
-
DESMOS_API_KEY: string;
|
|
72
|
-
MYSCRIPT_APPLICATION_KEY: string;
|
|
73
|
-
MYSCRIPT_HMAC_KEY: string;
|
|
74
|
-
MYSCRIPT_SOCKET_KEY: string;
|
|
75
|
-
MYSCRIPT_REST_APP_KEY: string;
|
|
76
|
-
MYSCRIPT_REST_HMAC_KEY: string;
|
|
77
|
-
LOGGLY_CUSTOMER_TOKEN: string;
|
|
78
|
-
}>;
|
|
79
|
-
type EnvironmentVariables = RegionEnv & CommonEnv;
|
|
80
|
-
|
|
81
|
-
type StudentsLocaleConfig = CommonLocaleConfig & {
|
|
82
|
-
textFormatting: {
|
|
83
|
-
replaceCommaWithSpace: boolean;
|
|
84
|
-
};
|
|
85
|
-
symbols: {
|
|
86
|
-
numberDecimalSeparator: string;
|
|
87
|
-
};
|
|
88
|
-
practiceMode: {
|
|
89
|
-
languageCode: Locale;
|
|
90
|
-
defaultPracticeTreeId: string;
|
|
91
|
-
};
|
|
92
|
-
chatbot: {
|
|
93
|
-
languageName: string;
|
|
94
|
-
tts: {
|
|
95
|
-
languageCodeFallback: string;
|
|
96
|
-
voiceNameFallback: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
tts: {
|
|
100
|
-
replaceCommaWithSpace: boolean;
|
|
101
|
-
};
|
|
102
|
-
translate: {
|
|
103
|
-
languageCodeFallback: string;
|
|
104
|
-
};
|
|
105
|
-
problem: {
|
|
106
|
-
choiceInputSelector: {
|
|
107
|
-
useSmallText: boolean;
|
|
108
|
-
};
|
|
109
|
-
choiceAnswerFeedback: {
|
|
110
|
-
useSlimLayout: boolean;
|
|
111
|
-
};
|
|
112
|
-
answer: {
|
|
113
|
-
shortButton: boolean;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
exampleSolutions: {
|
|
117
|
-
languageName: string;
|
|
118
|
-
};
|
|
119
|
-
statsTab: {
|
|
120
|
-
buttonWithMinWidth: boolean;
|
|
121
|
-
};
|
|
122
|
-
smartEval: {
|
|
123
|
-
language: string;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
type TeachersLocaleConfig = CommonLocaleConfig & {
|
|
128
|
-
emails: {
|
|
129
|
-
studentsList: string;
|
|
130
|
-
};
|
|
131
|
-
symbols: {
|
|
132
|
-
decimalSeparator: string;
|
|
133
|
-
};
|
|
134
|
-
date: {
|
|
135
|
-
use24HourFormat: boolean;
|
|
136
|
-
locale: DateLocale;
|
|
137
|
-
formats: {
|
|
138
|
-
full: DateFormat;
|
|
139
|
-
dayMonth: DateFormat;
|
|
140
|
-
hoursMinutes: DateFormat;
|
|
141
|
-
fullWithSeconds: DateFormat;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
urls: {
|
|
145
|
-
specialBook: string;
|
|
146
|
-
helpCenter: string;
|
|
147
|
-
about: string;
|
|
148
|
-
};
|
|
149
|
-
bookshelf: {
|
|
150
|
-
limitSharedExercisesTooltipWidth: boolean;
|
|
151
|
-
};
|
|
152
|
-
problemsList: {
|
|
153
|
-
showProblemComplexity: boolean;
|
|
154
|
-
};
|
|
155
|
-
practiceMode: {
|
|
156
|
-
defaultTreeIdFallback: string;
|
|
157
|
-
};
|
|
158
|
-
matrix: {
|
|
159
|
-
forceShowRecommendations: boolean;
|
|
160
|
-
forceMatrixMode?: MatrixMode;
|
|
161
|
-
};
|
|
162
|
-
pieChart: {
|
|
163
|
-
showExtraTreeDataContent: boolean;
|
|
164
|
-
};
|
|
165
|
-
problem: {
|
|
166
|
-
allowCommaDecimal: boolean;
|
|
167
|
-
};
|
|
168
|
-
getStarted: {
|
|
169
|
-
showSentEmailInfo: boolean;
|
|
170
|
-
};
|
|
171
|
-
grades: {
|
|
172
|
-
showPrefix: boolean;
|
|
173
|
-
showOtherGrade: boolean;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
type DistrictLocaleConfig = CommonLocaleConfig & {
|
|
178
|
-
date: {
|
|
179
|
-
use24HourFormat: boolean;
|
|
180
|
-
locale: DateLocale;
|
|
181
|
-
formats: {
|
|
182
|
-
full: DateFormat;
|
|
183
|
-
dayMonthYear: DateFormat;
|
|
184
|
-
dayMonth: DateFormat;
|
|
185
|
-
hoursMinutes: DateFormat;
|
|
186
|
-
fullWithSeconds: DateFormat;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
type CommonLocaleConfig = Readonly<{
|
|
192
|
-
name: string;
|
|
193
|
-
languageName: string;
|
|
194
|
-
languageHeader: string;
|
|
195
|
-
contentLocale: Locale;
|
|
196
|
-
shortCode: string;
|
|
197
|
-
}>;
|
|
198
|
-
type LocalePreset = {
|
|
199
|
-
[Platform.STUDENTS_WEB]: {
|
|
200
|
-
[key in Locale]: StudentsLocaleConfig;
|
|
201
|
-
};
|
|
202
|
-
[Platform.TEACHERS_WEB]: {
|
|
203
|
-
[key in Locale]: TeachersLocaleConfig;
|
|
204
|
-
};
|
|
205
|
-
[Platform.DISTRICT_DASHBOARD]: {
|
|
206
|
-
[key in Locale]: DistrictLocaleConfig;
|
|
207
|
-
};
|
|
208
|
-
[Platform.AUTH_WEB]: {
|
|
209
|
-
[key in Locale]: unknown;
|
|
210
|
-
};
|
|
211
|
-
[Platform.STUDENTS_APP]: {
|
|
212
|
-
[key in Locale]: unknown;
|
|
213
|
-
};
|
|
214
|
-
[Platform.TEACHERS_APP]: {
|
|
215
|
-
[key in Locale]: unknown;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
type LocaleConfig<P extends Platform> = LocalePreset[P][Locale];
|
|
219
|
-
|
|
220
|
-
type ConfigOptions<P extends Platform> = {
|
|
221
|
-
platform: P;
|
|
222
|
-
environment: Environment;
|
|
223
|
-
};
|
|
224
|
-
type SetProps = {
|
|
225
|
-
locale?: Locale;
|
|
226
|
-
environment?: Environment;
|
|
227
|
-
};
|
|
228
|
-
declare class AppConfigManager<P extends Platform> {
|
|
229
|
-
private readonly platform;
|
|
230
|
-
environment: Environment;
|
|
231
|
-
locale: Locale;
|
|
232
|
-
private readonly setEnvs;
|
|
233
|
-
private readonly setLocaleConfig;
|
|
234
|
-
readonly $envs: effector.StoreWritable<EnvironmentVariables>;
|
|
235
|
-
readonly $localeConfig: effector.StoreWritable<LocaleConfig<P>>;
|
|
236
|
-
constructor(opts: ConfigOptions<P>);
|
|
237
|
-
private readonly syncConfigsStores;
|
|
238
|
-
readonly set: (props: SetProps) => void;
|
|
239
|
-
readonly onEnvsChange: (cb: (cfg: EnvironmentVariables) => void) => effector.Subscription;
|
|
240
|
-
readonly onLocaleChange: (cb: (cfg: LocaleConfig<P>) => void) => effector.Subscription;
|
|
241
|
-
readonly getConfig: () => {
|
|
242
|
-
envs: EnvironmentVariables;
|
|
243
|
-
localeConfig: LocaleConfig<P>;
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export { AppConfigManager, DateFormat, DateLocale, Environment, Locale, MatrixMode, Platform };
|
package/dist/index.d.ts
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import * as effector from 'effector';
|
|
2
|
-
|
|
3
|
-
declare const enum DateFormat {
|
|
4
|
-
FULL = "YYYY-MM-DD HH:mm",
|
|
5
|
-
FULL_US = "YYYY-MM-DD hh:mm A",
|
|
6
|
-
DAY_MONTH_YEAR = "DD-MM-YYYY",
|
|
7
|
-
DAY_MONTH_YEAR_US = "YYYY-MM-DD",
|
|
8
|
-
HOURS_MINUTES = "HH:mm",
|
|
9
|
-
HOURS_MINUTES_US = "hh:mm A",
|
|
10
|
-
DAY_MONTH = "DD MMM",
|
|
11
|
-
DAY_MONTH_US = "MMM DD",
|
|
12
|
-
YEAR_MONTH_DAY = "YYYY-MM-DD",
|
|
13
|
-
FULL_WITH_SECONDS = "DD MMM YYYY HH:mm:ss",
|
|
14
|
-
FULL_WITH_SECONDS_US = "DD MMM YYYY hh:mm:ss A"
|
|
15
|
-
}
|
|
16
|
-
declare const DateLocale: {
|
|
17
|
-
readonly US: "en";
|
|
18
|
-
readonly SV: "sv";
|
|
19
|
-
readonly 'en-SE': "en";
|
|
20
|
-
readonly 'sv-SE': "sv";
|
|
21
|
-
readonly GB: "en";
|
|
22
|
-
readonly 'en-GB': "en";
|
|
23
|
-
readonly CA: "en";
|
|
24
|
-
readonly 'en-CA': "en";
|
|
25
|
-
readonly SCT: "en";
|
|
26
|
-
readonly 'en-SCT': "en";
|
|
27
|
-
readonly DE: "de";
|
|
28
|
-
readonly 'de-DE': "de";
|
|
29
|
-
};
|
|
30
|
-
type DateLocale = (typeof DateLocale)[keyof typeof DateLocale];
|
|
31
|
-
|
|
32
|
-
declare enum Platform {
|
|
33
|
-
STUDENTS_WEB = "STUDENTS",
|
|
34
|
-
TEACHERS_WEB = "TEACHERS",
|
|
35
|
-
DISTRICT_DASHBOARD = "DISTRICT",
|
|
36
|
-
AUTH_WEB = "AUTH_WEB",
|
|
37
|
-
STUDENTS_APP = "STUDENTS_RN_APP",
|
|
38
|
-
TEACHERS_APP = "TEACHERS_RN_APP"
|
|
39
|
-
}
|
|
40
|
-
declare enum Locale {
|
|
41
|
-
US = "en-SE",
|
|
42
|
-
SE = "sv-SE",
|
|
43
|
-
GB = "en-GB",
|
|
44
|
-
CA = "en-CA",
|
|
45
|
-
SCT = "en-SCT",
|
|
46
|
-
DE = "de-DE"
|
|
47
|
-
}
|
|
48
|
-
declare enum Environment {
|
|
49
|
-
MARS = "MARS",
|
|
50
|
-
PROD = "PROD"
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
declare enum MatrixMode {
|
|
54
|
-
SKILL = "SKILL",
|
|
55
|
-
STANDARD = "STANDARD"
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type RegionEnv = Readonly<{
|
|
59
|
-
API_URL: string;
|
|
60
|
-
AUTH_WEB_URL: string;
|
|
61
|
-
MYSCRIPT_HOST: string;
|
|
62
|
-
LOGGLY_TAG: string;
|
|
63
|
-
SKOLFED_AUTH: string;
|
|
64
|
-
SOCKET_URL: string;
|
|
65
|
-
STUDENTS_WEB_URL: string;
|
|
66
|
-
TEACHERS_WEB_URL: string;
|
|
67
|
-
CDN_HOST: string;
|
|
68
|
-
}>;
|
|
69
|
-
type CommonEnv = Readonly<{
|
|
70
|
-
GOOGLE_API_KEY: string;
|
|
71
|
-
DESMOS_API_KEY: string;
|
|
72
|
-
MYSCRIPT_APPLICATION_KEY: string;
|
|
73
|
-
MYSCRIPT_HMAC_KEY: string;
|
|
74
|
-
MYSCRIPT_SOCKET_KEY: string;
|
|
75
|
-
MYSCRIPT_REST_APP_KEY: string;
|
|
76
|
-
MYSCRIPT_REST_HMAC_KEY: string;
|
|
77
|
-
LOGGLY_CUSTOMER_TOKEN: string;
|
|
78
|
-
}>;
|
|
79
|
-
type EnvironmentVariables = RegionEnv & CommonEnv;
|
|
80
|
-
|
|
81
|
-
type StudentsLocaleConfig = CommonLocaleConfig & {
|
|
82
|
-
textFormatting: {
|
|
83
|
-
replaceCommaWithSpace: boolean;
|
|
84
|
-
};
|
|
85
|
-
symbols: {
|
|
86
|
-
numberDecimalSeparator: string;
|
|
87
|
-
};
|
|
88
|
-
practiceMode: {
|
|
89
|
-
languageCode: Locale;
|
|
90
|
-
defaultPracticeTreeId: string;
|
|
91
|
-
};
|
|
92
|
-
chatbot: {
|
|
93
|
-
languageName: string;
|
|
94
|
-
tts: {
|
|
95
|
-
languageCodeFallback: string;
|
|
96
|
-
voiceNameFallback: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
tts: {
|
|
100
|
-
replaceCommaWithSpace: boolean;
|
|
101
|
-
};
|
|
102
|
-
translate: {
|
|
103
|
-
languageCodeFallback: string;
|
|
104
|
-
};
|
|
105
|
-
problem: {
|
|
106
|
-
choiceInputSelector: {
|
|
107
|
-
useSmallText: boolean;
|
|
108
|
-
};
|
|
109
|
-
choiceAnswerFeedback: {
|
|
110
|
-
useSlimLayout: boolean;
|
|
111
|
-
};
|
|
112
|
-
answer: {
|
|
113
|
-
shortButton: boolean;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
exampleSolutions: {
|
|
117
|
-
languageName: string;
|
|
118
|
-
};
|
|
119
|
-
statsTab: {
|
|
120
|
-
buttonWithMinWidth: boolean;
|
|
121
|
-
};
|
|
122
|
-
smartEval: {
|
|
123
|
-
language: string;
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
type TeachersLocaleConfig = CommonLocaleConfig & {
|
|
128
|
-
emails: {
|
|
129
|
-
studentsList: string;
|
|
130
|
-
};
|
|
131
|
-
symbols: {
|
|
132
|
-
decimalSeparator: string;
|
|
133
|
-
};
|
|
134
|
-
date: {
|
|
135
|
-
use24HourFormat: boolean;
|
|
136
|
-
locale: DateLocale;
|
|
137
|
-
formats: {
|
|
138
|
-
full: DateFormat;
|
|
139
|
-
dayMonth: DateFormat;
|
|
140
|
-
hoursMinutes: DateFormat;
|
|
141
|
-
fullWithSeconds: DateFormat;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
urls: {
|
|
145
|
-
specialBook: string;
|
|
146
|
-
helpCenter: string;
|
|
147
|
-
about: string;
|
|
148
|
-
};
|
|
149
|
-
bookshelf: {
|
|
150
|
-
limitSharedExercisesTooltipWidth: boolean;
|
|
151
|
-
};
|
|
152
|
-
problemsList: {
|
|
153
|
-
showProblemComplexity: boolean;
|
|
154
|
-
};
|
|
155
|
-
practiceMode: {
|
|
156
|
-
defaultTreeIdFallback: string;
|
|
157
|
-
};
|
|
158
|
-
matrix: {
|
|
159
|
-
forceShowRecommendations: boolean;
|
|
160
|
-
forceMatrixMode?: MatrixMode;
|
|
161
|
-
};
|
|
162
|
-
pieChart: {
|
|
163
|
-
showExtraTreeDataContent: boolean;
|
|
164
|
-
};
|
|
165
|
-
problem: {
|
|
166
|
-
allowCommaDecimal: boolean;
|
|
167
|
-
};
|
|
168
|
-
getStarted: {
|
|
169
|
-
showSentEmailInfo: boolean;
|
|
170
|
-
};
|
|
171
|
-
grades: {
|
|
172
|
-
showPrefix: boolean;
|
|
173
|
-
showOtherGrade: boolean;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
type DistrictLocaleConfig = CommonLocaleConfig & {
|
|
178
|
-
date: {
|
|
179
|
-
use24HourFormat: boolean;
|
|
180
|
-
locale: DateLocale;
|
|
181
|
-
formats: {
|
|
182
|
-
full: DateFormat;
|
|
183
|
-
dayMonthYear: DateFormat;
|
|
184
|
-
dayMonth: DateFormat;
|
|
185
|
-
hoursMinutes: DateFormat;
|
|
186
|
-
fullWithSeconds: DateFormat;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
type CommonLocaleConfig = Readonly<{
|
|
192
|
-
name: string;
|
|
193
|
-
languageName: string;
|
|
194
|
-
languageHeader: string;
|
|
195
|
-
contentLocale: Locale;
|
|
196
|
-
shortCode: string;
|
|
197
|
-
}>;
|
|
198
|
-
type LocalePreset = {
|
|
199
|
-
[Platform.STUDENTS_WEB]: {
|
|
200
|
-
[key in Locale]: StudentsLocaleConfig;
|
|
201
|
-
};
|
|
202
|
-
[Platform.TEACHERS_WEB]: {
|
|
203
|
-
[key in Locale]: TeachersLocaleConfig;
|
|
204
|
-
};
|
|
205
|
-
[Platform.DISTRICT_DASHBOARD]: {
|
|
206
|
-
[key in Locale]: DistrictLocaleConfig;
|
|
207
|
-
};
|
|
208
|
-
[Platform.AUTH_WEB]: {
|
|
209
|
-
[key in Locale]: unknown;
|
|
210
|
-
};
|
|
211
|
-
[Platform.STUDENTS_APP]: {
|
|
212
|
-
[key in Locale]: unknown;
|
|
213
|
-
};
|
|
214
|
-
[Platform.TEACHERS_APP]: {
|
|
215
|
-
[key in Locale]: unknown;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
type LocaleConfig<P extends Platform> = LocalePreset[P][Locale];
|
|
219
|
-
|
|
220
|
-
type ConfigOptions<P extends Platform> = {
|
|
221
|
-
platform: P;
|
|
222
|
-
environment: Environment;
|
|
223
|
-
};
|
|
224
|
-
type SetProps = {
|
|
225
|
-
locale?: Locale;
|
|
226
|
-
environment?: Environment;
|
|
227
|
-
};
|
|
228
|
-
declare class AppConfigManager<P extends Platform> {
|
|
229
|
-
private readonly platform;
|
|
230
|
-
environment: Environment;
|
|
231
|
-
locale: Locale;
|
|
232
|
-
private readonly setEnvs;
|
|
233
|
-
private readonly setLocaleConfig;
|
|
234
|
-
readonly $envs: effector.StoreWritable<EnvironmentVariables>;
|
|
235
|
-
readonly $localeConfig: effector.StoreWritable<LocaleConfig<P>>;
|
|
236
|
-
constructor(opts: ConfigOptions<P>);
|
|
237
|
-
private readonly syncConfigsStores;
|
|
238
|
-
readonly set: (props: SetProps) => void;
|
|
239
|
-
readonly onEnvsChange: (cb: (cfg: EnvironmentVariables) => void) => effector.Subscription;
|
|
240
|
-
readonly onLocaleChange: (cb: (cfg: LocaleConfig<P>) => void) => effector.Subscription;
|
|
241
|
-
readonly getConfig: () => {
|
|
242
|
-
envs: EnvironmentVariables;
|
|
243
|
-
localeConfig: LocaleConfig<P>;
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export { AppConfigManager, DateFormat, DateLocale, Environment, Locale, MatrixMode, Platform };
|