/** One completed sale recorded into a {@link PriceHistory}. */ export interface SaleRecord { readonly itemId: string; readonly count: number; readonly unitPrice: number; readonly currency: string; readonly at: number; } /** * Tunables for {@link createPriceHistory} — the per-item sample cap bounds memory; the optional * window drops samples older than `windowSeconds` whenever the history is written or read with a * newer timestamp. */ export interface PriceHistoryConfig { maxSamplesPerItem: number; windowSeconds?: number; } /** Aggregated market stats for one item over the retained samples. */ export interface PriceStats { readonly sampleCount: number; readonly volume: number; readonly minUnitPrice: number; readonly maxUnitPrice: number; readonly averageUnitPrice: number; readonly latestUnitPrice: number; } /** A bounded rolling record of completed sales per item. See {@link createPriceHistory}. */ export interface PriceHistory { record(sale: SaleRecord): void; statsOf(itemId: string, now?: number): PriceStats | null; samplesOf(itemId: string, now?: number): readonly SaleRecord[]; itemIds(): readonly string[]; clear(itemId?: string): void; } /** * The "market price" readout behind every auction house: a bounded rolling record of completed * sales per item, aggregated into min/max/volume-weighted-average/latest unit-price stats so games * can show current value and recent trends. Memory is bounded by `maxSamplesPerItem` (oldest * samples drop first) and optionally by a sliding time window; timestamps are injected by the * caller so the history stays deterministic. * * @capability price-history rolling per-item sale records aggregated into market price stats */ export declare function createPriceHistory(config: PriceHistoryConfig): PriceHistory;