import { type KeyValueStorage } from "./keyValueStore.js"; /** The structural storage backend a record book persists through — an alias of the shared {@link KeyValueStorage} seam (browser `localStorage`, a test stub, or `null`). */ export type RecordStorage = KeyValueStorage; export type RecordDirection = "lower" | "higher"; export interface RecordBookConfig { readonly key: string; readonly fields: Readonly>; readonly storage?: RecordStorage | null; } export interface RecordSubmission { readonly improved: readonly K[]; readonly best: Readonly>>; } export interface RecordBook { best(): Readonly>>; bestOf(field: K): number | null; submit(run: Readonly>>): RecordSubmission; clear(): void; } /** * A personal-best record book: named numeric fields each racing toward "lower" * (times) or "higher" (scores, streaks), persisted through a structural * key-value storage (pass `localStorage` in a browser, a stub in tests, or * `null` for in-memory only). Corrupt or unavailable storage degrades to an * empty book — a record write never throws into a game tick. * * @capability best-record persist personal-best times/scores with safe storage fallback */ export declare function createRecordBook(config: RecordBookConfig): RecordBook;