mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
fix(settings): Ensure that InferSettings properly infers the combinations of values from an enum type. (#10346)
This commit is contained in:
@@ -1047,9 +1047,13 @@ export function getSettingsSchema(): SettingsSchemaType {
|
||||
type InferSettings<T extends SettingsSchema> = {
|
||||
-readonly [K in keyof T]?: T[K] extends { properties: SettingsSchema }
|
||||
? InferSettings<T[K]['properties']>
|
||||
: T[K]['default'] extends boolean
|
||||
? boolean
|
||||
: T[K]['default'];
|
||||
: T[K]['type'] extends 'enum'
|
||||
? T[K]['options'] extends readonly SettingEnumOption[]
|
||||
? T[K]['options'][number]['value']
|
||||
: T[K]['default']
|
||||
: T[K]['default'] extends boolean
|
||||
? boolean
|
||||
: T[K]['default'];
|
||||
};
|
||||
|
||||
export type Settings = InferSettings<SettingsSchemaType>;
|
||||
|
||||
Reference in New Issue
Block a user