diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/api/index.ts | 2 | ||||
| -rw-r--r-- | src/types/index.ts | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/api/index.ts b/src/api/index.ts index 2e275d2..ea0d28c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -18,7 +18,7 @@ export const getGameConfig = callable<[string], GameConfigResponse>("get_game_co export const saveGameConfig = callable< [string, Record<string, string>, string | null, boolean, string | null], - ApiResponse + GameConfigResponse >("save_game_config"); export const logError = callable<[string], void>("log_error"); diff --git a/src/types/index.ts b/src/types/index.ts index 73e7947..e9424c1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -21,11 +21,40 @@ export interface GameConfigPaths { live_ini: string; } +export interface GameConfigOption { + value: string; + label: string; +} + +export interface GameConfigSettingSchema { + id: string; + section: string; + key: string; + label: string; + description: string; + default: string; + control: "dropdown" | "range" | "number" | "text"; + options: GameConfigOption[]; + rangeMin?: number | null; + rangeMax?: number | null; + step?: number; + numericType?: "int" | "float"; + isPath?: boolean; + isKeycode?: boolean; +} + +export interface GameConfigSectionSchema { + id: string; + label: string; + settings: GameConfigSettingSchema[]; +} + export interface GameConfigResponse extends ApiResponse { appid?: string; name?: string; proxy?: string; settings?: Record<string, string>; + schema?: GameConfigSectionSchema[]; raw_ini?: string; managed_exists?: boolean; live_available?: boolean; |
