removed some 'any' types

This commit is contained in:
Miodec 2022-02-26 23:09:36 +01:00
parent 0390fa8319
commit 0c85df8791

View file

@ -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") {
$(