diff options
| author | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2026-07-14 23:23:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-14 23:23:32 -0400 |
| commit | 85492d47cb79d3452e3b5d9113f34e364e081b0f (patch) | |
| tree | f0e19368c9e9fe761751ab6295079da54cf0302f /src/config | |
| parent | 6aa69db7a6895c89ffa99498beb017ad12d1b9ce (diff) | |
| parent | 0a9ed38d9e5e3f67efc0ecdc0d549d67ccb86fb8 (diff) | |
| download | decky-lsfg-vk-main.tar.gz decky-lsfg-vk-main.zip | |
Remove dead code across frontend and backend
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/configSchema.ts | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/src/config/configSchema.ts b/src/config/configSchema.ts index 6c6cf19..8b4fc1e 100644 --- a/src/config/configSchema.ts +++ b/src/config/configSchema.ts @@ -1,15 +1,3 @@ -/** - * Configuration schema and management for LSFG VK plugin - * - * This file re-exports auto-generated configuration constants from generatedConfigSchema.ts - * and provides the ConfigurationManager class for handling configuration operations. - */ - -import { callable } from "@decky/api"; -import type { ConfigurationData } from './generatedConfigSchema'; -import { getDefaults } from './generatedConfigSchema'; -import { updateLsfgConfig } from "../api/lsfgApi"; - export { ConfigFieldType, ConfigField, @@ -23,109 +11,3 @@ export { DISABLE_STEAMDECK_MODE, MANGOHUD_WORKAROUND, DISABLE_VKBASALT, FORCE_ENABLE_VKBASALT, ENABLE_WSI, ENABLE_ZINK } from './generatedConfigSchema'; - -/** - * Configuration management class - * Handles CRUD operations for plugin configuration - */ -export class ConfigurationManager { - private static instance: ConfigurationManager; - private _config: ConfigurationData | null = null; - - private getConfiguration = callable<[], { success: boolean; data?: ConfigurationData; error?: string }>("get_configuration"); - private resetConfiguration = callable<[], { success: boolean; data?: ConfigurationData; error?: string }>("reset_configuration"); - - private constructor() {} - - static getInstance(): ConfigurationManager { - if (!ConfigurationManager.instance) { - ConfigurationManager.instance = new ConfigurationManager(); - } - return ConfigurationManager.instance; - } - - /** - * Get default configuration values - */ - static getDefaults(): ConfigurationData { - return getDefaults(); - } - - /** - * Load configuration from backend - */ - async loadConfig(): Promise<ConfigurationData> { - try { - const result = await this.getConfiguration(); - if (result.success && result.data) { - this._config = result.data; - return this._config; - } else { - throw new Error(result.error || 'Failed to load configuration'); - } - } catch (error) { - console.error('Error loading configuration:', error); - throw error; - } - } - - /** - * Save configuration to backend - */ - async saveConfig(config: ConfigurationData): Promise<void> { - try { - const result = await updateLsfgConfig(config); - if (result.success) { - this._config = config; - } else { - throw new Error(result.error || 'Failed to save configuration'); - } - } catch (error) { - console.error('Error saving configuration:', error); - throw error; - } - } - - /** - * Update a single configuration field - */ - async updateField(fieldName: keyof ConfigurationData, value: any): Promise<void> { - if (!this._config) { - await this.loadConfig(); - } - - const updatedConfig = { - ...this._config!, - [fieldName]: value - }; - - await this.saveConfig(updatedConfig); - } - - /** - * Get current configuration (cached) - */ - getConfig(): ConfigurationData | null { - return this._config; - } - - /** - * Reset configuration to defaults - */ - async resetToDefaults(): Promise<ConfigurationData> { - try { - const result = await this.resetConfiguration(); - if (result.success && result.data) { - this._config = result.data; - return this._config; - } else { - throw new Error(result.error || 'Failed to reset configuration'); - } - } catch (error) { - console.error('Error resetting configuration:', error); - throw error; - } - } -} - -export const configManager = ConfigurationManager.getInstance(); |
