@testgorilla/tgo-typing-test 1.0.0 → 2.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/.eslintrc.json +46 -0
- package/jest.config.ts +21 -0
- package/ng-package.json +15 -0
- package/package.json +7 -22
- package/project.json +36 -0
- package/src/lib/components/tgo-typing-replay-input/tgo-typing-replay-input.component.html +30 -0
- package/src/lib/components/tgo-typing-replay-input/tgo-typing-replay-input.component.spec.ts +250 -0
- package/src/lib/components/tgo-typing-replay-input/tgo-typing-replay-input.component.ts +47 -0
- package/src/lib/components/tgo-typing-test/tgo-typing-test.component.html +72 -0
- package/src/lib/components/tgo-typing-test/tgo-typing-test.component.spec.ts +699 -0
- package/src/lib/components/tgo-typing-test/tgo-typing-test.component.ts +287 -0
- package/src/lib/helpers/config.ts +28 -0
- package/src/lib/helpers/constants/default-config.ts +103 -0
- package/src/lib/helpers/controllers/input-controller.ts +710 -0
- package/src/lib/helpers/controllers/quotes-controller.ts +183 -0
- package/src/lib/helpers/observables/banner-event.ts +18 -0
- package/src/lib/helpers/observables/config-event.ts +31 -0
- package/src/lib/helpers/observables/timer-event.ts +18 -0
- package/src/lib/helpers/states/active-page.ts +9 -0
- package/src/lib/helpers/states/composition.ts +29 -0
- package/src/lib/helpers/states/page-transition.ts +9 -0
- package/src/lib/helpers/states/slow-timer.ts +16 -0
- package/src/lib/helpers/states/test-active.ts +9 -0
- package/src/lib/helpers/states/time.ts +13 -0
- package/src/lib/helpers/test/caps-warning.ts +50 -0
- package/src/lib/helpers/test/caret.ts +92 -0
- package/src/lib/helpers/test/custom-text.ts +73 -0
- package/src/lib/helpers/test/english-punctuation.ts +38 -0
- package/src/lib/helpers/test/focus.ts +39 -0
- package/src/lib/helpers/test/manual-restart-tracker.ts +13 -0
- package/src/lib/helpers/test/out-of-focus.ts +19 -0
- package/src/lib/helpers/test/replay.ts +265 -0
- package/src/lib/helpers/test/test-input.ts +320 -0
- package/src/lib/helpers/test/test-logic.ts +1039 -0
- package/src/lib/helpers/test/test-state.ts +17 -0
- package/src/lib/helpers/test/test-stats.ts +442 -0
- package/src/lib/helpers/test/test-timer.ts +209 -0
- package/src/lib/helpers/test/test-ui.ts +370 -0
- package/src/lib/helpers/test/test-words.ts +72 -0
- package/src/lib/helpers/test/timer-progress.ts +16 -0
- package/src/lib/helpers/test/tts.ts +42 -0
- package/src/lib/helpers/test/weak-spot.ts +74 -0
- package/src/lib/helpers/test/wordset.ts +109 -0
- package/src/lib/styles/animations.scss +101 -0
- package/src/lib/styles/caret.scss +108 -0
- package/src/lib/styles/core.scss +498 -0
- package/src/lib/styles/index.scss +19 -0
- package/src/lib/styles/inputs.scss +290 -0
- package/src/lib/styles/popups.scss +1311 -0
- package/src/lib/styles/test.scss +1008 -0
- package/src/lib/styles/z_media-queries.scss +848 -0
- package/src/lib/types/types.d.ts +731 -0
- package/src/lib/utils/misc.ts +776 -0
- package/src/test-setup.ts +20 -0
- package/tsconfig.json +16 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +11 -0
- package/esm2022/index.mjs +0 -3
- package/esm2022/lib/components/tgo-typing-replay-input/tgo-typing-replay-input.component.mjs +0 -45
- package/esm2022/lib/components/tgo-typing-test/tgo-typing-test.component.mjs +0 -299
- package/esm2022/lib/helpers/config.mjs +0 -24
- package/esm2022/lib/helpers/constants/default-config.mjs +0 -103
- package/esm2022/lib/helpers/controllers/input-controller.mjs +0 -586
- package/esm2022/lib/helpers/controllers/quotes-controller.mjs +0 -118
- package/esm2022/lib/helpers/observables/config-event.mjs +0 -16
- package/esm2022/lib/helpers/observables/timer-event.mjs +0 -16
- package/esm2022/lib/helpers/states/active-page.mjs +0 -8
- package/esm2022/lib/helpers/states/composition.mjs +0 -20
- package/esm2022/lib/helpers/states/page-transition.mjs +0 -8
- package/esm2022/lib/helpers/states/slow-timer.mjs +0 -15
- package/esm2022/lib/helpers/states/test-active.mjs +0 -8
- package/esm2022/lib/helpers/states/time.mjs +0 -11
- package/esm2022/lib/helpers/test/caps-warning.mjs +0 -50
- package/esm2022/lib/helpers/test/caret.mjs +0 -80
- package/esm2022/lib/helpers/test/custom-text.mjs +0 -59
- package/esm2022/lib/helpers/test/english-punctuation.mjs +0 -29
- package/esm2022/lib/helpers/test/focus.mjs +0 -35
- package/esm2022/lib/helpers/test/manual-restart-tracker.mjs +0 -11
- package/esm2022/lib/helpers/test/out-of-focus.mjs +0 -14
- package/esm2022/lib/helpers/test/replay.mjs +0 -217
- package/esm2022/lib/helpers/test/test-input.mjs +0 -264
- package/esm2022/lib/helpers/test/test-logic.mjs +0 -927
- package/esm2022/lib/helpers/test/test-state.mjs +0 -13
- package/esm2022/lib/helpers/test/test-stats.mjs +0 -342
- package/esm2022/lib/helpers/test/test-timer.mjs +0 -207
- package/esm2022/lib/helpers/test/test-ui.mjs +0 -341
- package/esm2022/lib/helpers/test/test-words.mjs +0 -69
- package/esm2022/lib/helpers/test/timer-progress.mjs +0 -15
- package/esm2022/lib/helpers/test/weak-spot.mjs +0 -65
- package/esm2022/lib/helpers/test/wordset.mjs +0 -100
- package/esm2022/lib/utils/misc.mjs +0 -673
- package/esm2022/testgorilla-tgo-typing-test.mjs +0 -5
- package/fesm2022/testgorilla-tgo-typing-test.mjs +0 -4707
- package/fesm2022/testgorilla-tgo-typing-test.mjs.map +0 -1
- package/lib/components/tgo-typing-replay-input/tgo-typing-replay-input.component.d.ts +0 -14
- package/lib/components/tgo-typing-test/tgo-typing-test.component.d.ts +0 -54
- package/lib/helpers/config.d.ts +0 -98
- package/lib/helpers/constants/default-config.d.ts +0 -3
- package/lib/helpers/controllers/input-controller.d.ts +0 -16
- package/lib/helpers/controllers/quotes-controller.d.ts +0 -20
- package/lib/helpers/observables/config-event.d.ts +0 -5
- package/lib/helpers/observables/timer-event.d.ts +0 -4
- package/lib/helpers/states/active-page.d.ts +0 -2
- package/lib/helpers/states/composition.d.ts +0 -10
- package/lib/helpers/states/page-transition.d.ts +0 -2
- package/lib/helpers/states/slow-timer.d.ts +0 -3
- package/lib/helpers/states/test-active.d.ts +0 -2
- package/lib/helpers/states/time.d.ts +0 -3
- package/lib/helpers/test/caps-warning.d.ts +0 -5
- package/lib/helpers/test/caret.d.ts +0 -11
- package/lib/helpers/test/custom-text.d.ts +0 -16
- package/lib/helpers/test/english-punctuation.d.ts +0 -3
- package/lib/helpers/test/focus.d.ts +0 -7
- package/lib/helpers/test/manual-restart-tracker.d.ts +0 -3
- package/lib/helpers/test/out-of-focus.d.ts +0 -4
- package/lib/helpers/test/replay.d.ts +0 -20
- package/lib/helpers/test/test-input.d.ts +0 -86
- package/lib/helpers/test/test-logic.d.ts +0 -25
- package/lib/helpers/test/test-state.d.ts +0 -7
- package/lib/helpers/test/test-stats.d.ts +0 -92
- package/lib/helpers/test/test-timer.d.ts +0 -6
- package/lib/helpers/test/test-ui.d.ts +0 -27
- package/lib/helpers/test/test-words.d.ts +0 -23
- package/lib/helpers/test/timer-progress.d.ts +0 -3
- package/lib/helpers/test/weak-spot.d.ts +0 -3
- package/lib/helpers/test/wordset.d.ts +0 -7
- package/lib/utils/misc.d.ts +0 -81
- /package/{assets → src/assets}/typing-test-languages/english.json +0 -0
- /package/{assets → src/assets}/typing-test-languages/english_punctuation.json +0 -0
- /package/{assets → src/assets}/typing-test-languages/quotes/english_version_1.json +0 -0
- /package/{assets → src/assets}/typing-test-languages/quotes/english_version_2.json +0 -0
- /package/{assets → src/assets}/typing-test-languages/quotes/filtered_sources.json +0 -0
- /package/{index.d.ts → src/index.ts} +0 -0
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
export namespace MonkeyTypes {
|
|
2
|
+
type Difficulty = 'normal' | 'expert' | 'master';
|
|
3
|
+
|
|
4
|
+
type CustomModes = 'custom';
|
|
5
|
+
|
|
6
|
+
type Mode = 'time' | 'words' | 'quote' | 'zen' | CustomModes;
|
|
7
|
+
|
|
8
|
+
type Mode2<M extends Mode> = keyof PersonalBests[M];
|
|
9
|
+
|
|
10
|
+
type Mode2Custom<M extends Mode> = Mode2<M> | 'custom';
|
|
11
|
+
|
|
12
|
+
interface LanguageGroup {
|
|
13
|
+
name: string;
|
|
14
|
+
languages: string[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type Accents = [string, string][];
|
|
18
|
+
|
|
19
|
+
interface LanguageObject {
|
|
20
|
+
name: string;
|
|
21
|
+
leftToRight: boolean;
|
|
22
|
+
noLazyMode?: boolean;
|
|
23
|
+
ligatures?: boolean;
|
|
24
|
+
words: string[];
|
|
25
|
+
accents: Accents;
|
|
26
|
+
bcp47?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type WordsModes = number;
|
|
30
|
+
|
|
31
|
+
type TimeModes = number;
|
|
32
|
+
|
|
33
|
+
type DefaultWordsModes = 10 | 25 | 50 | 100;
|
|
34
|
+
|
|
35
|
+
type DefaultTimeModes = 15 | 30 | 60 | 120;
|
|
36
|
+
|
|
37
|
+
type QuoteModes = 'short' | 'medium' | 'long' | 'thicc';
|
|
38
|
+
|
|
39
|
+
type QuoteLength = -3 | -2 | -1 | 0 | 1 | 2 | 3;
|
|
40
|
+
|
|
41
|
+
type FontSize = '1' | '125' | '15' | '2' | '3' | '4';
|
|
42
|
+
|
|
43
|
+
type CaretStyle = 'off' | 'default' | 'block' | 'outline' | 'underline' | 'carrot' | 'banana';
|
|
44
|
+
|
|
45
|
+
type ConfidenceMode = 'off' | 'on' | 'max';
|
|
46
|
+
|
|
47
|
+
type TimerStyle = 'bar' | 'text' | 'mini';
|
|
48
|
+
|
|
49
|
+
type RandomTheme = 'off' | 'on' | 'fav' | 'light' | 'dark' | 'custom';
|
|
50
|
+
|
|
51
|
+
type TimerColor = 'black' | 'sub' | 'text' | 'main';
|
|
52
|
+
|
|
53
|
+
type TimerOpacity = '0.25' | '0.5' | '0.75' | '1';
|
|
54
|
+
|
|
55
|
+
type StopOnError = 'off' | 'word' | 'letter';
|
|
56
|
+
|
|
57
|
+
type KeymapMode = 'off' | 'static' | 'react' | 'next';
|
|
58
|
+
|
|
59
|
+
type KeymapStyle = 'staggered' | 'alice' | 'matrix' | 'split' | 'split_matrix';
|
|
60
|
+
|
|
61
|
+
type KeymapLegendStyle = 'lowercase' | 'uppercase' | 'blank' | 'dynamic';
|
|
62
|
+
|
|
63
|
+
type KeymapShowTopRow = 'always' | 'layout' | 'never';
|
|
64
|
+
|
|
65
|
+
type ShowAverage = 'off' | 'wpm' | 'acc' | 'both';
|
|
66
|
+
|
|
67
|
+
type TapeMode = 'off' | 'letter' | 'word';
|
|
68
|
+
|
|
69
|
+
type SingleListCommandLine = 'manual' | 'on';
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
off = off
|
|
73
|
+
1 = click
|
|
74
|
+
2 = beep
|
|
75
|
+
3 = pop
|
|
76
|
+
4 = nk creams
|
|
77
|
+
5 = typewriter
|
|
78
|
+
6 = osu
|
|
79
|
+
7 = hitmarker
|
|
80
|
+
*/
|
|
81
|
+
type PlaySoundOnClick = 'off' | '1' | '2' | '3' | '4' | '5' | '6' | '7';
|
|
82
|
+
|
|
83
|
+
type SoundVolume = '0.1' | '0.5' | '1.0';
|
|
84
|
+
|
|
85
|
+
type PaceCaret = 'off' | 'average' | 'pb' | 'last' | 'custom';
|
|
86
|
+
|
|
87
|
+
type PageWidth = '100' | '125' | '150' | '200' | 'max';
|
|
88
|
+
|
|
89
|
+
type ChartStyle = 'line' | 'scatter';
|
|
90
|
+
|
|
91
|
+
type MinimumWordsPerMinute = 'off' | 'custom';
|
|
92
|
+
|
|
93
|
+
type HighlightMode = 'off' | 'letter' | 'word';
|
|
94
|
+
|
|
95
|
+
type Ads = 'off' | 'result' | 'on' | 'sellout';
|
|
96
|
+
|
|
97
|
+
type MinimumAccuracy = 'off' | 'custom';
|
|
98
|
+
|
|
99
|
+
type RepeatQuotes = 'off' | 'typing';
|
|
100
|
+
|
|
101
|
+
type OppositeShiftMode = 'off' | 'on' | 'keymap';
|
|
102
|
+
|
|
103
|
+
type CustomBackgroundSize = 'cover' | 'contain' | 'max';
|
|
104
|
+
|
|
105
|
+
type CustomBackgroundFilter = [number, number, number, number, number];
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
off = off
|
|
109
|
+
1 = mellow
|
|
110
|
+
2 = high
|
|
111
|
+
3 = ultra
|
|
112
|
+
4 = over 9000
|
|
113
|
+
*/
|
|
114
|
+
type MonkeyPowerLevel = 'off' | '1' | '2' | '3' | '4';
|
|
115
|
+
|
|
116
|
+
type MinimumBurst = 'off' | 'fixed' | 'flex';
|
|
117
|
+
|
|
118
|
+
type FunboxObjectType = 'script' | 'style';
|
|
119
|
+
|
|
120
|
+
type IndicateTypos = 'off' | 'below' | 'replace';
|
|
121
|
+
|
|
122
|
+
type CustomLayoutFluid = `${string}#${string}#${string}`;
|
|
123
|
+
|
|
124
|
+
type CustomLayoutFluidSpaces = CustomLayoutFluid | `${string} ${string} ${string}`;
|
|
125
|
+
|
|
126
|
+
interface HistoryChartData {
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
wpm: number;
|
|
130
|
+
acc: number;
|
|
131
|
+
mode: string;
|
|
132
|
+
mode2: string | number;
|
|
133
|
+
punctuation: boolean;
|
|
134
|
+
language: string;
|
|
135
|
+
timestamp: number;
|
|
136
|
+
difficulty: string;
|
|
137
|
+
raw: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface AccChartData {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
errorRate: number;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface ActivityChartDataPoint {
|
|
147
|
+
x: number;
|
|
148
|
+
y: number;
|
|
149
|
+
amount?: number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface FunboxObject {
|
|
153
|
+
name: string;
|
|
154
|
+
type: FunboxObjectType;
|
|
155
|
+
info: string;
|
|
156
|
+
alias?: string;
|
|
157
|
+
affectsWordGeneration?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface CustomText {
|
|
161
|
+
text: string[];
|
|
162
|
+
isWordRandom: boolean;
|
|
163
|
+
isTimeRandom: boolean;
|
|
164
|
+
word: number;
|
|
165
|
+
time: number;
|
|
166
|
+
delimiter: string;
|
|
167
|
+
textLen?: number;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface PresetConfig extends MonkeyTypes.Config {
|
|
171
|
+
tags: string[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface Preset {
|
|
175
|
+
_id: string;
|
|
176
|
+
name: string;
|
|
177
|
+
display: string;
|
|
178
|
+
config: ConfigChanges;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
interface PersonalBest {
|
|
182
|
+
acc: number;
|
|
183
|
+
consistency: number;
|
|
184
|
+
difficulty: Difficulty;
|
|
185
|
+
lazyMode: boolean;
|
|
186
|
+
language: string;
|
|
187
|
+
punctuation: boolean;
|
|
188
|
+
raw: number;
|
|
189
|
+
wpm: number;
|
|
190
|
+
timestamp: number;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
interface PersonalBests {
|
|
194
|
+
time: {
|
|
195
|
+
[key: number]: PersonalBest[];
|
|
196
|
+
};
|
|
197
|
+
words: {
|
|
198
|
+
[key: number]: PersonalBest[];
|
|
199
|
+
};
|
|
200
|
+
quote: { [quote: string]: PersonalBest[] };
|
|
201
|
+
custom: { custom: PersonalBest[] };
|
|
202
|
+
zen: {
|
|
203
|
+
zen: PersonalBest[];
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface Tag {
|
|
208
|
+
_id: string;
|
|
209
|
+
name: string;
|
|
210
|
+
display: string;
|
|
211
|
+
personalBests?: PersonalBests;
|
|
212
|
+
active?: boolean;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
interface RawCustomTheme {
|
|
216
|
+
name: string;
|
|
217
|
+
colors: string[];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface CustomTheme extends RawCustomTheme {
|
|
221
|
+
_id: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface TypingStats {
|
|
225
|
+
timeTyping: number;
|
|
226
|
+
startedTests: number;
|
|
227
|
+
completedTests: number;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface ChartData {
|
|
231
|
+
wpm: number[];
|
|
232
|
+
raw: number[];
|
|
233
|
+
err: number[];
|
|
234
|
+
unsmoothedRaw?: number[];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface KeyStats {
|
|
238
|
+
average: number;
|
|
239
|
+
sd: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface Result<M extends Mode> {
|
|
243
|
+
_id: string;
|
|
244
|
+
wpm: number;
|
|
245
|
+
rawWpm: number;
|
|
246
|
+
kph: number;
|
|
247
|
+
charStats: number[];
|
|
248
|
+
correctChars?: number; // --------------
|
|
249
|
+
incorrectChars?: number; // legacy results
|
|
250
|
+
acc: number;
|
|
251
|
+
mode: M;
|
|
252
|
+
mode2: Mode2<M>;
|
|
253
|
+
quoteLength: number;
|
|
254
|
+
timestamp: number;
|
|
255
|
+
restartCount: number;
|
|
256
|
+
incompleteTestSeconds: number;
|
|
257
|
+
testDuration: number;
|
|
258
|
+
afkDuration: number;
|
|
259
|
+
tags: string[];
|
|
260
|
+
consistency: number;
|
|
261
|
+
keyConsistency: number;
|
|
262
|
+
chartData: ChartData | 'toolong';
|
|
263
|
+
uid: string;
|
|
264
|
+
keySpacingStats: KeyStats;
|
|
265
|
+
keyDurationStats: KeyStats;
|
|
266
|
+
isPb?: boolean;
|
|
267
|
+
bailedOut?: boolean;
|
|
268
|
+
blindMode?: boolean;
|
|
269
|
+
lazyMode?: boolean;
|
|
270
|
+
difficulty: Difficulty;
|
|
271
|
+
funbox?: string;
|
|
272
|
+
language: string;
|
|
273
|
+
numbers?: boolean;
|
|
274
|
+
punctuation?: boolean;
|
|
275
|
+
hash?: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
interface ApeKey {
|
|
279
|
+
name: string;
|
|
280
|
+
enabled: boolean;
|
|
281
|
+
createdOn: number;
|
|
282
|
+
modifiedOn: number;
|
|
283
|
+
lastUsedOn: number;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface ApeKeys {
|
|
287
|
+
[key: string]: ApeKey;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
interface Config {
|
|
291
|
+
theme: string;
|
|
292
|
+
themeLight: string;
|
|
293
|
+
themeDark: string;
|
|
294
|
+
autoSwitchTheme: boolean;
|
|
295
|
+
customTheme: boolean;
|
|
296
|
+
customThemeColors: string[];
|
|
297
|
+
favThemes: string[];
|
|
298
|
+
showKeyTips: boolean;
|
|
299
|
+
showLiveWpm: boolean;
|
|
300
|
+
showTimerProgress: boolean;
|
|
301
|
+
smoothCaret: boolean;
|
|
302
|
+
quickRestart: 'off' | 'esc' | 'tab';
|
|
303
|
+
punctuation: boolean;
|
|
304
|
+
numbers: boolean;
|
|
305
|
+
words: WordsModes;
|
|
306
|
+
time: TimeModes;
|
|
307
|
+
mode: Mode;
|
|
308
|
+
quoteLength: QuoteLength[];
|
|
309
|
+
language: string;
|
|
310
|
+
fontSize: FontSize;
|
|
311
|
+
freedomMode: boolean;
|
|
312
|
+
resultFilters?: ResultFilters | null;
|
|
313
|
+
difficulty: Difficulty;
|
|
314
|
+
blindMode: boolean;
|
|
315
|
+
quickEnd: boolean;
|
|
316
|
+
caretStyle: CaretStyle;
|
|
317
|
+
paceCaretStyle: CaretStyle;
|
|
318
|
+
flipTestColors: boolean;
|
|
319
|
+
layout: string;
|
|
320
|
+
funbox: string;
|
|
321
|
+
confidenceMode: ConfidenceMode;
|
|
322
|
+
indicateTypos: IndicateTypos;
|
|
323
|
+
timerStyle: TimerStyle;
|
|
324
|
+
colorfulMode: boolean;
|
|
325
|
+
randomTheme: RandomTheme;
|
|
326
|
+
timerColor: TimerColor;
|
|
327
|
+
timerOpacity: TimerOpacity;
|
|
328
|
+
stopOnError: StopOnError;
|
|
329
|
+
showAllLines: boolean;
|
|
330
|
+
keymapMode: KeymapMode;
|
|
331
|
+
keymapStyle: KeymapStyle;
|
|
332
|
+
keymapLegendStyle: KeymapLegendStyle;
|
|
333
|
+
keymapLayout: string;
|
|
334
|
+
keymapShowTopRow: KeymapShowTopRow;
|
|
335
|
+
fontFamily: string;
|
|
336
|
+
smoothLineScroll: boolean;
|
|
337
|
+
alwaysShowDecimalPlaces: boolean;
|
|
338
|
+
alwaysShowWordsHistory: boolean;
|
|
339
|
+
singleListCommandLine: SingleListCommandLine;
|
|
340
|
+
capsLockWarning: boolean;
|
|
341
|
+
playSoundOnError: boolean;
|
|
342
|
+
playSoundOnClick: PlaySoundOnClick;
|
|
343
|
+
soundVolume: SoundVolume;
|
|
344
|
+
startGraphsAtZero: boolean;
|
|
345
|
+
showOutOfFocusWarning: boolean;
|
|
346
|
+
paceCaret: PaceCaret;
|
|
347
|
+
paceCaretCustomSpeed: number;
|
|
348
|
+
repeatedPace: boolean;
|
|
349
|
+
pageWidth: PageWidth;
|
|
350
|
+
chartAccuracy: boolean;
|
|
351
|
+
chartStyle: ChartStyle;
|
|
352
|
+
minWpm: MinimumWordsPerMinute;
|
|
353
|
+
minWpmCustomSpeed: number;
|
|
354
|
+
highlightMode: HighlightMode;
|
|
355
|
+
alwaysShowCPM: boolean;
|
|
356
|
+
ads: Ads;
|
|
357
|
+
hideExtraLetters: boolean;
|
|
358
|
+
strictSpace: boolean;
|
|
359
|
+
minAcc: MinimumAccuracy;
|
|
360
|
+
minAccCustom: number;
|
|
361
|
+
showLiveAcc: boolean;
|
|
362
|
+
showLiveBurst: boolean;
|
|
363
|
+
monkey: boolean;
|
|
364
|
+
repeatQuotes: RepeatQuotes;
|
|
365
|
+
oppositeShiftMode: OppositeShiftMode;
|
|
366
|
+
customBackground: string;
|
|
367
|
+
customBackgroundSize: CustomBackgroundSize;
|
|
368
|
+
customBackgroundFilter: CustomBackgroundFilter;
|
|
369
|
+
customLayoutfluid: CustomLayoutFluid;
|
|
370
|
+
monkeyPowerLevel: MonkeyPowerLevel;
|
|
371
|
+
minBurst: MinimumBurst;
|
|
372
|
+
minBurstCustomSpeed: number;
|
|
373
|
+
burstHeatmap: boolean;
|
|
374
|
+
britishEnglish: boolean;
|
|
375
|
+
lazyMode: boolean;
|
|
376
|
+
showAverage: ShowAverage;
|
|
377
|
+
tapeMode: TapeMode;
|
|
378
|
+
customTGQuotes: boolean;
|
|
379
|
+
testVersion: number;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
type ConfigValues =
|
|
383
|
+
| string
|
|
384
|
+
| number
|
|
385
|
+
| boolean
|
|
386
|
+
| string[]
|
|
387
|
+
| MonkeyTypes.QuoteLength[]
|
|
388
|
+
| MonkeyTypes.ResultFilters
|
|
389
|
+
| MonkeyTypes.CustomBackgroundFilter
|
|
390
|
+
| null
|
|
391
|
+
| undefined;
|
|
392
|
+
|
|
393
|
+
interface ConfigChanges extends Partial<MonkeyTypes.Config> {
|
|
394
|
+
tags?: string[];
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
interface DefaultConfig extends Config {
|
|
398
|
+
wordCount: WordsModes;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// interface LeaderboardMemory {
|
|
402
|
+
// time: {
|
|
403
|
+
// [key in 15 | 60]: {
|
|
404
|
+
// [language: string]: number;
|
|
405
|
+
// };
|
|
406
|
+
// };
|
|
407
|
+
// }
|
|
408
|
+
|
|
409
|
+
// interface Leaderboards {
|
|
410
|
+
// time: {
|
|
411
|
+
// [key in 15 | 60]: LeaderboardEntry[];
|
|
412
|
+
// };
|
|
413
|
+
// }
|
|
414
|
+
|
|
415
|
+
// interface LeaderboardEntry {
|
|
416
|
+
// uid: string;
|
|
417
|
+
// difficulty: string;
|
|
418
|
+
// timestamp: number;
|
|
419
|
+
// language: string;
|
|
420
|
+
// wpm: number;
|
|
421
|
+
// consistency: number | "-";
|
|
422
|
+
// punctuation: boolean;
|
|
423
|
+
// acc: number;
|
|
424
|
+
// raw: number;
|
|
425
|
+
// uid?: string;
|
|
426
|
+
// name: string;
|
|
427
|
+
// discordId?: string;
|
|
428
|
+
// discordAvatar?: string;
|
|
429
|
+
// badgeId?: number;
|
|
430
|
+
// rank: number;
|
|
431
|
+
// count?: number;
|
|
432
|
+
// hidden?: boolean;
|
|
433
|
+
// }
|
|
434
|
+
|
|
435
|
+
interface QuoteRatings {
|
|
436
|
+
[language: string]: {
|
|
437
|
+
[id: number]: number;
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
interface Snapshot {
|
|
442
|
+
banned?: boolean;
|
|
443
|
+
emailVerified?: boolean;
|
|
444
|
+
quoteRatings?: QuoteRatings;
|
|
445
|
+
results?: Result<Mode>[];
|
|
446
|
+
verified?: boolean;
|
|
447
|
+
personalBests?: PersonalBests;
|
|
448
|
+
name: string;
|
|
449
|
+
customThemes: CustomTheme[];
|
|
450
|
+
presets?: Preset[];
|
|
451
|
+
tags: Tag[];
|
|
452
|
+
favouriteThemes?: string[];
|
|
453
|
+
// lbMemory?: LeaderboardMemory;
|
|
454
|
+
typingStats?: TypingStats;
|
|
455
|
+
quoteMod?: boolean;
|
|
456
|
+
discordId?: string;
|
|
457
|
+
config?: Config;
|
|
458
|
+
favoriteQuotes: FavoriteQuotes;
|
|
459
|
+
needsToChangeName?: boolean;
|
|
460
|
+
discordAvatar?: string;
|
|
461
|
+
details?: UserDetails;
|
|
462
|
+
inventory?: UserInventory;
|
|
463
|
+
addedAt: number;
|
|
464
|
+
filterPresets: ResultFilters[];
|
|
465
|
+
xp: number;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
interface UserDetails {
|
|
469
|
+
bio?: string;
|
|
470
|
+
keyboard?: string;
|
|
471
|
+
socialProfiles: {
|
|
472
|
+
twitter?: string;
|
|
473
|
+
github?: string;
|
|
474
|
+
website?: string;
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
interface UserInventory {
|
|
479
|
+
badges: Badge[];
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
interface Badge {
|
|
483
|
+
id: number;
|
|
484
|
+
selected?: boolean;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
type FavoriteQuotes = Record<string, string[]>;
|
|
488
|
+
|
|
489
|
+
// Converting this to an interface causes a TS error
|
|
490
|
+
type PartialRecord<K extends keyof any, T> = {
|
|
491
|
+
[P in K]?: T;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
interface ResultFilters {
|
|
495
|
+
_id: string;
|
|
496
|
+
name: string;
|
|
497
|
+
difficulty: {
|
|
498
|
+
normal: boolean;
|
|
499
|
+
expert: boolean;
|
|
500
|
+
master: boolean;
|
|
501
|
+
};
|
|
502
|
+
mode: {
|
|
503
|
+
words: boolean;
|
|
504
|
+
time: boolean;
|
|
505
|
+
quote: boolean;
|
|
506
|
+
zen: boolean;
|
|
507
|
+
custom: boolean;
|
|
508
|
+
};
|
|
509
|
+
words: {
|
|
510
|
+
10: boolean;
|
|
511
|
+
25: boolean;
|
|
512
|
+
50: boolean;
|
|
513
|
+
100: boolean;
|
|
514
|
+
custom: boolean;
|
|
515
|
+
};
|
|
516
|
+
time: {
|
|
517
|
+
15: boolean;
|
|
518
|
+
30: boolean;
|
|
519
|
+
60: boolean;
|
|
520
|
+
120: boolean;
|
|
521
|
+
custom: boolean;
|
|
522
|
+
};
|
|
523
|
+
quoteLength: {
|
|
524
|
+
short: boolean;
|
|
525
|
+
medium: boolean;
|
|
526
|
+
long: boolean;
|
|
527
|
+
thicc: boolean;
|
|
528
|
+
};
|
|
529
|
+
punctuation: {
|
|
530
|
+
on: boolean;
|
|
531
|
+
off: boolean;
|
|
532
|
+
};
|
|
533
|
+
numbers: {
|
|
534
|
+
on: boolean;
|
|
535
|
+
off: boolean;
|
|
536
|
+
};
|
|
537
|
+
date: {
|
|
538
|
+
last_day: boolean;
|
|
539
|
+
last_week: boolean;
|
|
540
|
+
last_month: boolean;
|
|
541
|
+
last_3months: boolean;
|
|
542
|
+
all: boolean;
|
|
543
|
+
};
|
|
544
|
+
tags: {
|
|
545
|
+
[tagId: string]: boolean;
|
|
546
|
+
};
|
|
547
|
+
language: {
|
|
548
|
+
[language: string]: boolean;
|
|
549
|
+
};
|
|
550
|
+
// funbox: {
|
|
551
|
+
// none?: boolean;
|
|
552
|
+
// [funbox: string]: boolean;
|
|
553
|
+
// };
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
type Group = keyof ResultFilters;
|
|
557
|
+
|
|
558
|
+
type Filter<G extends Group> = keyof ResultFilters[G];
|
|
559
|
+
|
|
560
|
+
interface TimerStats {
|
|
561
|
+
dateNow: number;
|
|
562
|
+
now: number;
|
|
563
|
+
expected: number;
|
|
564
|
+
nextDelay: number;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
interface Global {
|
|
568
|
+
snapshot(): Snapshot;
|
|
569
|
+
config: Config;
|
|
570
|
+
toggleFilterDebug(): void;
|
|
571
|
+
glarsesMode(): void;
|
|
572
|
+
stats(): void;
|
|
573
|
+
replay(): string;
|
|
574
|
+
enableTimerDebug(): void;
|
|
575
|
+
getTimerStats(): TimerStats[];
|
|
576
|
+
toggleUnsmoothedRaw(): void;
|
|
577
|
+
enableSpacingDebug(): void;
|
|
578
|
+
noGoogleNoMo(): void;
|
|
579
|
+
egVideoListener(options: Record<string, string>): void;
|
|
580
|
+
wpmCalculationDebug(): void;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
interface GithubRelease {
|
|
584
|
+
url: string;
|
|
585
|
+
assets_url: string;
|
|
586
|
+
upload_url: string;
|
|
587
|
+
html_url: string;
|
|
588
|
+
id: number;
|
|
589
|
+
author: {
|
|
590
|
+
login: string;
|
|
591
|
+
id: number;
|
|
592
|
+
node_id: string;
|
|
593
|
+
avatar_url: string;
|
|
594
|
+
gravatar_id: string;
|
|
595
|
+
url: string;
|
|
596
|
+
html_url: string;
|
|
597
|
+
followers_url: string;
|
|
598
|
+
following_url: string;
|
|
599
|
+
gists_url: string;
|
|
600
|
+
starred_url: string;
|
|
601
|
+
subscriptions_url: string;
|
|
602
|
+
organizations_url: string;
|
|
603
|
+
repos_url: string;
|
|
604
|
+
events_url: string;
|
|
605
|
+
received_events_url: string;
|
|
606
|
+
type: string;
|
|
607
|
+
site_admin: boolean;
|
|
608
|
+
};
|
|
609
|
+
node_id: string;
|
|
610
|
+
tag_name: string;
|
|
611
|
+
target_commitish: string;
|
|
612
|
+
name: string;
|
|
613
|
+
draft: boolean;
|
|
614
|
+
prerelease: boolean;
|
|
615
|
+
created_at: string;
|
|
616
|
+
published_at: string;
|
|
617
|
+
assets: any[];
|
|
618
|
+
tarball_url: string;
|
|
619
|
+
zipball_url: string;
|
|
620
|
+
body: string;
|
|
621
|
+
reactions: {
|
|
622
|
+
url: string;
|
|
623
|
+
total_count: number;
|
|
624
|
+
[reaction: string]: number | string;
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
interface Command {
|
|
629
|
+
id: string;
|
|
630
|
+
display: string;
|
|
631
|
+
subgroup?: CommandsGroup | boolean;
|
|
632
|
+
found?: boolean;
|
|
633
|
+
icon?: string;
|
|
634
|
+
noIcon?: boolean;
|
|
635
|
+
sticky?: boolean;
|
|
636
|
+
alias?: string;
|
|
637
|
+
input?: boolean;
|
|
638
|
+
visible?: boolean;
|
|
639
|
+
defaultValue?: string;
|
|
640
|
+
configValue?: string | number | boolean | number[];
|
|
641
|
+
configValueMode?: string;
|
|
642
|
+
exec?: (input?: string) => void;
|
|
643
|
+
hover?: () => void;
|
|
644
|
+
available?: () => void;
|
|
645
|
+
beforeSubgroup?: () => void;
|
|
646
|
+
shouldFocusTestUI?: boolean;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
interface CommandsGroup {
|
|
650
|
+
title: string;
|
|
651
|
+
configKey?: keyof Config;
|
|
652
|
+
list: Command[];
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
interface Quote {
|
|
656
|
+
text: string;
|
|
657
|
+
source: string;
|
|
658
|
+
length: number;
|
|
659
|
+
id: number;
|
|
660
|
+
group: number;
|
|
661
|
+
language: string;
|
|
662
|
+
textSplit?: string[];
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
interface PSA {
|
|
666
|
+
sticky?: boolean;
|
|
667
|
+
message: string;
|
|
668
|
+
_id: string;
|
|
669
|
+
level?: number;
|
|
670
|
+
date?: number;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
interface ThemeColors {
|
|
674
|
+
bg: string;
|
|
675
|
+
main: string;
|
|
676
|
+
caret: string;
|
|
677
|
+
sub: string;
|
|
678
|
+
subAlt: string;
|
|
679
|
+
text: string;
|
|
680
|
+
error: string;
|
|
681
|
+
errorExtra: string;
|
|
682
|
+
colorfulError: string;
|
|
683
|
+
colorfulErrorExtra: string;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
interface Layout {
|
|
687
|
+
keymapShowTopRow: boolean;
|
|
688
|
+
type: 'iso' | 'ansi' | 'ortho' | 'matrix';
|
|
689
|
+
keys: Keys;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
interface Layouts {
|
|
693
|
+
[layout: string]: Layout;
|
|
694
|
+
}
|
|
695
|
+
interface Keys {
|
|
696
|
+
row1: string[];
|
|
697
|
+
row2: string[];
|
|
698
|
+
row3: string[];
|
|
699
|
+
row4: string[];
|
|
700
|
+
row5: string[];
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
interface WordsPerMinuteAndRaw {
|
|
704
|
+
wpm: number;
|
|
705
|
+
raw: number;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
interface Challenge {
|
|
709
|
+
name: string;
|
|
710
|
+
display: string;
|
|
711
|
+
autoRole: boolean;
|
|
712
|
+
type: string;
|
|
713
|
+
parameters: (string | number | boolean)[];
|
|
714
|
+
message: string;
|
|
715
|
+
requirements: {
|
|
716
|
+
[requirement: string]: {
|
|
717
|
+
[parameter: string]: string | number | boolean;
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
interface UserBadge {
|
|
723
|
+
id: number;
|
|
724
|
+
name: string;
|
|
725
|
+
description: string;
|
|
726
|
+
icon?: string;
|
|
727
|
+
background?: string;
|
|
728
|
+
color?: string;
|
|
729
|
+
customStyle?: string;
|
|
730
|
+
}
|
|
731
|
+
}
|