import { z } from 'zod'; import { LANGUAGE_CHOICES } from '../languages.ts'; const LanguageChoiceSchema = z.enum(LANGUAGE_CHOICES); /** The launcher's own settings (not the game's, not the local service's tuning). */ export const SettingsSchema = z.object({ language: LanguageChoiceSchema.default('system'), }); export type Settings = z.output; /** A change to some settings; the merged result is validated again before it is saved. */ export const SettingsPatchSchema = z.object({ language: LanguageChoiceSchema.optional(), }); export type SettingsPatch = z.output; export function defaultSettings(): Settings { return SettingsSchema.parse({}); }