import type { LivePrice, PriceFeedInfo, PriceFeedStatus, PricePoint } from "./types.js"; /** Tail-wide price-feed health. */ export interface PriceFeedGlobalStatus { /** Any watched asset's subscription socket is currently delivering. */ wsConnected: boolean; /** Number of assets with an active watch. */ watchCount: number; } export declare class PriceStore { private readonly assets; status: PriceFeedGlobalStatus; private version; private readonly listeners; private readonly cache; getVersion(): number; subscribe: (listener: () => void) => (() => void); /** Bump version and notify subscribers. Call once per applied batch/status change. */ commit(): void; /** Memoized derived snapshot — stable reference while version is unchanged. */ select(key: string, compute: () => T): T; private state; setStatus(asset: string, status: PriceFeedStatus): void; setLatest(asset: string, latest: LivePrice): void; setInfo(asset: string, info: PriceFeedInfo): void; mergeTicks(asset: string, points: PricePoint[]): void; setGlobalStatus(patch: Partial): void; /** Drop one asset's cached rows (its watch was released). */ purgeAsset(asset: string): void; getLatest(asset: string): LivePrice | null; getInfo(asset: string): PriceFeedInfo | null; getStatus(asset: string): PriceFeedStatus; /** Recent ticks for an asset, newest first (up to `limit`). */ getTicks(asset: string, limit: number): PricePoint[]; getGlobalStatus(): PriceFeedGlobalStatus; }