Add types
parent
e1dbd2effb
commit
3c89da8ea5
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue