mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-01 04:55:57 +08:00
Add back type check
This commit is contained in:
parent
48b1af0699
commit
9acadeb1f8
3 changed files with 8 additions and 8 deletions
|
|
@ -217,7 +217,7 @@ export const page = new Page({
|
|||
beforeShow: async (): Promise<void> => {
|
||||
Skeleton.append("pageLogin", "main");
|
||||
registerForm = {};
|
||||
qsa(".pageLogin input")?.setValue("");
|
||||
qsa<HTMLInputElement>(".pageLogin input")?.setValue("");
|
||||
qsa(".pageLogin .register .indicator")?.hide();
|
||||
enableInputs();
|
||||
disableSignUpButton();
|
||||
|
|
|
|||
|
|
@ -841,7 +841,7 @@ qs(
|
|||
const didConfigSave = setConfig(
|
||||
"keymapSize",
|
||||
parseFloat(
|
||||
qs(
|
||||
qs<HTMLInputElement>(
|
||||
".pageSettings .section[data-config-name='keymapSize'] .inputAndButton input",
|
||||
)?.getValue() as string,
|
||||
),
|
||||
|
|
@ -859,7 +859,7 @@ qs(
|
|||
const didConfigSave = setConfig(
|
||||
"keymapSize",
|
||||
parseFloat(
|
||||
qs(
|
||||
qs<HTMLInputElement>(
|
||||
".pageSettings .section[data-config-name='keymapSize'] .inputAndButton input",
|
||||
)?.getValue() as string,
|
||||
),
|
||||
|
|
@ -878,7 +878,7 @@ qs(
|
|||
const didConfigSave = setConfig(
|
||||
"keymapSize",
|
||||
parseFloat(
|
||||
qs(
|
||||
qs<HTMLInputElement>(
|
||||
".pageSettings .section[data-config-name='keymapSize'] .inputAndButton input",
|
||||
)?.getValue() as string,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ export class ElementWithUtils<T extends HTMLElement = HTMLElement> {
|
|||
/**
|
||||
* Set value of input or textarea to a string.
|
||||
*/
|
||||
setValue(value: string): this {
|
||||
setValue(this: ElementWithUtils<ElementWithValue>, value: string): this {
|
||||
if (this.hasValue()) {
|
||||
this.native.value = value;
|
||||
}
|
||||
|
|
@ -498,7 +498,7 @@ export class ElementWithUtils<T extends HTMLElement = HTMLElement> {
|
|||
* Get value of input or textarea
|
||||
* @returns The value of the element, or undefined if the element is not an input or textarea.
|
||||
*/
|
||||
getValue(): string | undefined {
|
||||
getValue(this: ElementWithUtils<ElementWithValue>): string | undefined {
|
||||
if (this.hasValue()) {
|
||||
return this.native.value;
|
||||
}
|
||||
|
|
@ -662,12 +662,12 @@ export class ElementsWithUtils<
|
|||
* Set value of all inputs or textareas in the array to a string.
|
||||
*/
|
||||
|
||||
setValue(value: string): this {
|
||||
setValue(this: ElementsWithUtils<ElementWithValue>, value: string): this {
|
||||
for (const item of this) {
|
||||
item.setValue(value);
|
||||
}
|
||||
|
||||
return this;
|
||||
return this as unknown as this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue