import type { AccessibilityState, ColorblindMode } from "../ui/accessibility.js"; import type { GameSettingDef, SettingOption, SettingValue, SettingsStore } from "./settingsModel.js"; /** * A "hold or toggle" preference for actions that can be either (aim, sprint, crouch, block). Shared * because players expect one setting to cover them all, rather than each game inventing a flag. */ export type HoldVsToggle = "hold" | "toggle"; /** The persisted settings ids behind the accessibility section. */ export declare const ACCESSIBILITY_SETTING_IDS: { readonly textScale: "accessibility.textScale"; readonly colorblind: "accessibility.colorblind"; readonly reducedMotion: "accessibility.reducedMotion"; readonly highContrast: "accessibility.highContrast"; readonly captions: "accessibility.captions"; readonly holdVsToggle: "controls.holdVsToggle"; }; /** Text-scale choices, as numeric strings the settings store persists. */ export declare const TEXT_SCALE_OPTIONS: readonly SettingOption[]; /** Colorblind palette choices. `none` keeps the game's own colours. */ export declare const COLORBLIND_OPTIONS: readonly SettingOption[]; /** Hold-versus-toggle choices for actions that support both. */ export declare const HOLD_VS_TOGGLE_OPTIONS: readonly SettingOption[]; /** Read a stored text scale, clamped to the supported range. */ export declare function readTextScale(store: SettingsStore): number; /** Read a stored colorblind mode, falling back to `none` for an unknown value. */ export declare function readColorblind(store: SettingsStore): ColorblindMode; /** Read the hold-or-toggle preference, falling back to `hold`. */ export declare function readHoldVsToggle(store: SettingsStore): HoldVsToggle; /** * Read the whole accessibility state the presentation needs (reduced motion, high contrast, text * scale, colorblind mode, captions) plus the hold/toggle preference, from the shared settings store. * * @capability accessibility-settings read accessibility preferences and the hold-vs-toggle choice from the shared settings store */ export declare function readAccessibilitySettings(store: SettingsStore): { state: AccessibilityState; holdVsToggle: HoldVsToggle; }; /** One accessibility setting as the shared settings menu renders it. */ export interface AccessibilitySettingRow { id: string; label: string; kind: "slider" | "toggle" | "select"; value: SettingValue; min?: number; max?: number; step?: number; options?: readonly SettingOption[]; format?: (value: number) => string; set: (value: SettingValue) => void; /** When this row drives presentation, the accessibility state key it maps to. */ affects?: keyof AccessibilityState; } /** * The accessibility rows, wired to the settings store: text scale, colorblind palette, reduced * motion, high contrast, captions and hold-vs-toggle. The shell adds them as its `accessibility` * category and any game can render them inside its own settings layout. * * @capability accessibility-settings-rows accessibility setting rows (text scale, colorblind, reduced motion, high contrast, captions, hold-vs-toggle) backed by the shared settings store */ export declare function accessibilitySettingRows(store: SettingsStore): AccessibilitySettingRow[]; /** * Declarative form of the accessibility rows for `defineGame({ settings })`, for a game that wants * them inside its own setting categories rather than the built-in `accessibility` one. */ export declare function accessibilitySettingDefs(category?: string): GameSettingDef[]; /** One frame of an action's raw input. */ export interface HoldToggleInput { /** The action's key/button went down this frame (the edge). */ pressed: boolean; /** The action's key/button is down. */ held: boolean; } /** * The action's active state for one frame under a {@link HoldVsToggle} preference: `hold` follows the * button, `toggle` latches on each press edge. Call with the previous result so toggle mode can flip * without the caller keeping a second flag. * * @capability hold-vs-toggle resolve one action frame under a hold-or-toggle preference */ export declare function holdToggleActive(previous: boolean, input: HoldToggleInput, mode: HoldVsToggle): boolean;