mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-10 05:35:05 +08:00
removed some 'any' types
This commit is contained in:
parent
0390fa8319
commit
0c85df8791
1 changed files with 19 additions and 8 deletions
|
@ -1,18 +1,29 @@
|
|||
import Config from "../config";
|
||||
|
||||
type ConfigValues =
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| string[]
|
||||
| MonkeyTypes.QuoteLengthArray
|
||||
| MonkeyTypes.ResultFilters
|
||||
| MonkeyTypes.CustomBackgroundFilter
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
export default class SettingsGroup {
|
||||
public configName: string;
|
||||
public configValue: any;
|
||||
public configFunction: (value: any, params?: any[]) => any;
|
||||
public configValue: ConfigValues;
|
||||
public configFunction: (...params: any[]) => boolean;
|
||||
public mode: string;
|
||||
public setCallback?: () => any;
|
||||
public updateCallback?: () => any;
|
||||
public setCallback?: () => void;
|
||||
public updateCallback?: () => void;
|
||||
constructor(
|
||||
configName: string,
|
||||
configFunction: (...values: any[]) => any,
|
||||
configFunction: (...params: any[]) => boolean,
|
||||
mode: string,
|
||||
setCallback?: () => any,
|
||||
updateCallback?: () => any
|
||||
setCallback?: () => void,
|
||||
updateCallback?: () => void
|
||||
) {
|
||||
this.configName = configName;
|
||||
this.configValue = Config[configName as keyof typeof Config];
|
||||
|
@ -70,7 +81,7 @@ export default class SettingsGroup {
|
|||
);
|
||||
if (this.mode === "select") {
|
||||
$(`.pageSettings .section.${this.configName} select`)
|
||||
.val(this.configValue)
|
||||
.val(this.configValue as string)
|
||||
.trigger("change.select2");
|
||||
} else if (this.mode === "button") {
|
||||
$(
|
||||
|
|
Loading…
Reference in a new issue