mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
removed unnecessary type definition
changed to unknown and added tsignores because this is just debug code
This commit is contained in:
parent
93c169a465
commit
73f4050392
1 changed files with 5 additions and 47 deletions
|
|
@ -16,51 +16,6 @@ interface CharCount {
|
|||
correctSpaces: number;
|
||||
}
|
||||
|
||||
interface Keypress {
|
||||
count: number;
|
||||
errors: number;
|
||||
words: number[];
|
||||
afk: boolean;
|
||||
}
|
||||
|
||||
interface KeypressTimings {
|
||||
spacing: {
|
||||
last: number;
|
||||
array: number[] | "toolong";
|
||||
};
|
||||
duration: {
|
||||
array: number[] | "toolong";
|
||||
};
|
||||
}
|
||||
|
||||
interface DebugStats {
|
||||
lastResult?: MonkeyTypes.Result<MonkeyTypes.Mode>;
|
||||
start: number;
|
||||
end: number;
|
||||
wpmHistory: number[];
|
||||
rawHistory: number[];
|
||||
burstHistory: number[];
|
||||
keypressPerSecond: Keypress[];
|
||||
currentBurstStart: number;
|
||||
lastSecondNotRound: boolean;
|
||||
missedWords: {
|
||||
[word: string]: number;
|
||||
};
|
||||
accuracy: {
|
||||
correct: number;
|
||||
incorrect: number;
|
||||
};
|
||||
keypressTimings: KeypressTimings;
|
||||
keySpacingStats?: {
|
||||
average: number;
|
||||
sd: number;
|
||||
};
|
||||
keyDurationStats?: {
|
||||
average: number;
|
||||
sd: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface Stats {
|
||||
wpm: number;
|
||||
wpmRaw: number;
|
||||
|
|
@ -100,8 +55,8 @@ export function wpmCalculationDebug(): void {
|
|||
wpmCalcDebug = true;
|
||||
}
|
||||
|
||||
export function getStats(): DebugStats {
|
||||
const ret: DebugStats = {
|
||||
export function getStats(): unknown {
|
||||
const ret = {
|
||||
lastResult,
|
||||
start,
|
||||
end,
|
||||
|
|
@ -114,9 +69,11 @@ export function getStats(): DebugStats {
|
|||
missedWords: TestInput.missedWords,
|
||||
accuracy: TestInput.accuracy,
|
||||
keypressTimings: TestInput.keypressTimings,
|
||||
keyOverlap: TestInput.keyOverlap,
|
||||
};
|
||||
|
||||
try {
|
||||
// @ts-ignore
|
||||
ret.keySpacingStats = {
|
||||
average:
|
||||
(TestInput.keypressTimings.spacing.array as number[]).reduce(
|
||||
|
|
@ -128,6 +85,7 @@ export function getStats(): DebugStats {
|
|||
//
|
||||
}
|
||||
try {
|
||||
// @ts-ignore
|
||||
ret.keyDurationStats = {
|
||||
average:
|
||||
(TestInput.keypressTimings.duration.array as number[]).reduce(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue