diff --git a/src/scripts/shared.ts b/src/scripts/shared.ts index bdae569..2c5e343 100644 --- a/src/scripts/shared.ts +++ b/src/scripts/shared.ts @@ -13,6 +13,8 @@ import Session from "./classes/session.js"; // Types declaration export type DictType = { [n: number]: string; }; +type KeyPrefixesType = "engines" | "statuses" | "tags" | "others"; +type PrefixesType = { [key in KeyPrefixesType]: DictType } /** * Class containing variables shared between modules. @@ -26,7 +28,7 @@ export default abstract class Shared { /** * List of platform prefixes and tags. */ - static _prefixes: {[s: string]: DictType} = {} + static _prefixes: PrefixesType = {} as PrefixesType; /** * Logger object used to write to both file and console. */ @@ -71,7 +73,7 @@ export default abstract class Shared { //#endregion Getters //#region Setters - static setPrefixPair(key: string, val: DictType): void { + static setPrefixPair(key: KeyPrefixesType, val: DictType): void { this._prefixes[key] = val; }