interface ConfigInterface { [id: string]: unknown; } class ConfigObject implements ConfigInterface { public decimalPlaces: number; public intConvertRoundMode: number; public default_lang: string; public enable_type_casting: boolean; public idle_input_interval: number; public suspend_threshold: number; public max_instruction_count: number; public activity_programming_type: Map; public activity_functions: Map; public activity_datatypes: Map; public activity_commands: Map; public activity_filter: Map; [id: string]: unknown; constructor () { this.decimalPlaces = 8; this.intConvertRoundMode = 2; this.default_lang = "pt"; this.enable_type_casting = true; this.idle_input_interval = 5000; this.suspend_threshold = 1000; // this.max_instruction_count = 350250; - automated evaluation limit this.max_instruction_count = Number.MAX_SAFE_INTEGER; this.activity_programming_type = new Map(); this.activity_functions = new Map(); this.activity_datatypes = new Map(); this.activity_commands = new Map(); this.activity_filter = new Map(); } setConfig (opts: object): void { const otherConfig = opts as ConfigInterface; for (const key in otherConfig) { if (Object.prototype.hasOwnProperty.call(this, key)) { this[key] = otherConfig[key]; } } } } const config = new ConfigObject(); export const Config = config;