2023-02-16 00:04:40 +03:00
|
|
|
export class Settings {
|
|
|
|
static #props = {};
|
|
|
|
|
|
|
|
static get(property) {
|
|
|
|
return this.#props[property];
|
|
|
|
}
|
|
|
|
|
|
|
|
static add(property, value) {
|
|
|
|
if (!Object.getOwnPropertyDescriptors(this)[property]) {
|
|
|
|
Object.defineProperty(this, property, {
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
|
|
|
get: () => this.#props[property],
|
2023-04-06 18:03:40 +03:00
|
|
|
set: (setValue) => {
|
|
|
|
this.#props[property] = setValue;
|
|
|
|
},
|
2023-02-16 00:04:40 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
this.#props[property] = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static remove(property) {
|
|
|
|
delete this.#props[property];
|
|
|
|
}
|
|
|
|
}
|