aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language
diff options
context:
space:
mode:
authorCashew <52880648+Scrub1492@users.noreply.github.com>2023-12-25 17:13:34 +0900
committerGitHub <noreply@github.com>2023-12-25 08:13:34 +0000
commitbdaa77ff0d7c23f1594575ac22fb9693f1802b24 (patch)
tree87cef502658dfb1ba62434eef51f994a08ec5739 /ext/js/language
parent89994427c7dfb25e7879948061a531f34cb1e9ab (diff)
Narrow down enum types (#431)
* narrow down enum types * add enum types * change from default to case * add enum types * remove comments * remove comments * fix * Move getErrorLevelValue to Logger * Add enum type for LogErrorLevelValue * add eslint switch-exhaustiveness-check rule * Revert "add eslint switch-exhaustiveness-check" This reverts commit 49f9caabf0af900bc5ba2b80f5baff72c27e02cd. * move from labelled loop to helper functions * move helper functions downward
Diffstat (limited to 'ext/js/language')
-rw-r--r--ext/js/language/text-scanner.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js
index 800e3697..164e150e 100644
--- a/ext/js/language/text-scanner.js
+++ b/ext/js/language/text-scanner.js
@@ -137,8 +137,8 @@ export class TextScanner extends EventDispatcher {
this._preventNextClick = false;
/** @type {boolean} */
this._preventScroll = false;
- /** @type {0|1|2|3} */
- this._penPointerState = 0; // 0 = not active; 1 = hovering; 2 = touching; 3 = hovering after touching
+ /** @type {import('text-scanner').PenPointerState} */
+ this._penPointerState = 0;
/** @type {Map<number, string>} */
this._pointerIdTypeMap = new Map();
@@ -1382,13 +1382,13 @@ export class TextScanner extends EventDispatcher {
return input.scanOnPenRelease;
}
switch (this._penPointerState) {
- case 1: // hovering
+ case 1:
return input.scanOnPenHover;
- case 2: // touching
+ case 2:
return input.scanOnPenMove;
- case 3: // hovering after touching
+ case 3:
return input.scanOnPenReleaseHover;
- default: // not active
+ case 0:
return false;
}
}