diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-13 00:04:54 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-07-13 00:04:54 -0400 |
| commit | 77494457e2a4f5c80c3a2f7acb054b12d918d8ad (patch) | |
| tree | fad4c4dd2ce69a850b56078444427866dedce9fa /src/api/lsfgApi.ts | |
| parent | 6cfcaa6c169cb8c898775eee276ff2497ab8f45c (diff) | |
| download | decky-lsfg-vk-77494457e2a4f5c80c3a2f7acb054b12d918d8ad.tar.gz decky-lsfg-vk-77494457e2a4f5c80c3a2f7acb054b12d918d8ad.zip | |
restructure for maintainability
Diffstat (limited to 'src/api/lsfgApi.ts')
| -rw-r--r-- | src/api/lsfgApi.ts | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/api/lsfgApi.ts b/src/api/lsfgApi.ts new file mode 100644 index 0000000..a35f274 --- /dev/null +++ b/src/api/lsfgApi.ts @@ -0,0 +1,60 @@ +import { callable } from "@decky/api"; + +// Type definitions for API responses +export interface InstallationResult { + success: boolean; + error?: string; + message?: string; + removed_files?: string[]; +} + +export interface InstallationStatus { + installed: boolean; + lib_exists: boolean; + json_exists: boolean; + script_exists: boolean; + lib_path: string; + json_path: string; + script_path: string; + error?: string; +} + +export interface DllDetectionResult { + detected: boolean; + path?: string; + source?: string; + message?: string; + error?: string; +} + +export interface LsfgConfig { + enable_lsfg: boolean; + multiplier: number; + flow_scale: number; + hdr: boolean; + perf_mode: boolean; + immediate_mode: boolean; +} + +export interface ConfigResult { + success: boolean; + config?: LsfgConfig; + error?: string; +} + +export interface ConfigUpdateResult { + success: boolean; + message?: string; + error?: string; +} + +// API functions +export const installLsfgVk = callable<[], InstallationResult>("install_lsfg_vk"); +export const uninstallLsfgVk = callable<[], InstallationResult>("uninstall_lsfg_vk"); +export const checkLsfgVkInstalled = callable<[], InstallationStatus>("check_lsfg_vk_installed"); +export const checkLosslessScalingDll = callable<[], DllDetectionResult>("check_lossless_scaling_dll"); +export const getLsfgConfig = callable<[], ConfigResult>("get_lsfg_config"); +export const updateLsfgConfig = callable< + [boolean, number, number, boolean, boolean, boolean], + ConfigUpdateResult +>("update_lsfg_config"); |
