From 7418a1f4b2c1a6ba94f7e1e39d4fd4af2971e5ba Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Thu, 21 Sep 2023 03:38:53 +0900 Subject: [PATCH] feat: use TS private keyword instead of JS private identifier --- config/dynamic.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/dynamic.ts b/config/dynamic.ts index 6e93dd45..c05e49c4 100644 --- a/config/dynamic.ts +++ b/config/dynamic.ts @@ -97,7 +97,7 @@ export class PluginConfig { this.config = { ...pluginDefaultConfig, ...pluginConfig }; if (this.enableFront) { - this.#setupFront(); + this.setupFront(); } activePlugins[name] = this; @@ -109,8 +109,8 @@ export class PluginConfig { set(key: keyof ConfigType, value: ValueOf>) { this.config[key] = value; - this.#onChange(key); - this.#save(); + this.onChange(key); + this.save(); } getAll(): ConfigType { @@ -126,7 +126,7 @@ export class PluginConfig { for (const [key, value] of Object.entries(options) as Entries) { if (this.config[key] !== value) { if (value !== undefined) this.config[key] = value; - this.#onChange(key, false); + this.onChange(key, false); changed = true; } } @@ -137,7 +137,7 @@ export class PluginConfig { } } - this.#save(); + this.save(); } getDefaultConfig() { @@ -152,7 +152,7 @@ export class PluginConfig { setAndMaybeRestart(key: keyof ConfigType, value: ValueOf>) { this.config[key] = value; setMenuOptions(this.name, this.config); - this.#onChange(key); + this.onChange(key); } subscribe(valueName: keyof ConfigType, fn: (config: ConfigType) => void) { @@ -164,11 +164,11 @@ export class PluginConfig { } /** Called only from back */ - #save() { + private save() { setOptions(this.name, this.config); } - #onChange(valueName: keyof ConfigType, single: boolean = true) { + private onChange(valueName: keyof ConfigType, single: boolean = true) { this.subscribers[valueName]?.(this.config[valueName] as ConfigType); if (single) { for (const fn of this.allSubscribers) { @@ -177,7 +177,7 @@ export class PluginConfig { } } - #setupFront() { + private setupFront() { const ignoredMethods = ['subscribe', 'subscribeAll']; if (process.type === 'renderer') {