export interface StatModifier { add?: number; multiply?: number; } export type StatModifierSet = Partial>; export interface CreateStatsOptions { now?: () => number; } /** One serializable modifier source in a {@link StatsSnapshot}. */ interface StatModifierSourceSnapshot { id: string; modifiers: StatModifierSet; expiresAtMs?: number; } /** Complete plain-data state for a {@link Stats} runtime. */ export interface StatsSnapshot { base: Record; sources: StatModifierSourceSnapshot[]; } export interface Stats { setBase(stat: TStat, value: number): void; getBase(stat: TStat): number; addSource(sourceId: string, modifiers: StatModifierSet, options?: { expiresAtMs?: number; }): void; removeSource(sourceId: string): void; hasSource(sourceId: string, nowMs?: number): boolean; get(stat: TStat, nowMs?: number): number; pruneExpired(nowMs: number): string[]; sources(): string[]; /** Return a detached JSON-serializable copy of base values and modifier sources. */ snapshot(): StatsSnapshot; /** Replace all runtime state from caller-owned decoded snapshot data. */ restore(snapshot: StatsSnapshot): void; } /** * A stat block whose base values take stacking, timed buffs and debuffs, resolving the modified value on read. * * @capability stat-block base stats with stacking, expiring buffs and debuffs applied on read */ export declare function createStats(base: Record, options?: CreateStatsOptions): Stats; export {};