import type { GameEventMap, GameEvents } from "./events.js"; export interface FeedEntry { at: number; data: T; } /** Any feed entry carrying a game-time (or wall-clock) `at` stamp for age-based pruning. */ export interface TimedFeedEntry { at: number; } /** Bounds for {@link appendFeed} / {@link pruneFeed}: newest-`limit` cap and/or `ttl` age window. */ export interface FeedWindow { /** Keep only the newest `limit` entries. Omit for no count cap. */ limit?: number; /** Drop entries older than `ttl` game-seconds before the newest `at`. Omit for no age cap. */ ttl?: number; } export interface GameFeedOptions { limit?: number; } /** * Append `entry` to a flat, serializable feed list, then bound it by age (`ttl`, relative to the * appended entry's `at`) and/or count (`limit`, newest kept). Works on the game's own flat entry * shape — anything with an `at` stamp — so `{ id, text, tone, at }`-style notice lists and event * logs drop into serialized state with no `{ at, data }` envelope. Returns a new array. * * @capability notice-feed serializable tone-tagged notice/event feed bounded by count and age (toasts, life events, killfeed) */ export declare function appendFeed(list: readonly T[], entry: T, options?: FeedWindow): T[]; /** * Drop feed entries older than `ttl` game-seconds before `now`. Returns the same array reference * when nothing expired, so equality checks skip a redundant state write. The tick-time counterpart * to {@link appendFeed}'s age bound. * * @capability notice-feed serializable tone-tagged notice/event feed bounded by count and age (toasts, life events, killfeed) */ export declare function pruneFeed(list: readonly T[], now: number, ttl: number): T[]; export declare function appendFeedEntry(buffer: readonly FeedEntry[], entry: FeedEntry, limit: number): FeedEntry[]; export declare function recentFeedEntries(buffer: readonly FeedEntry[], limit?: number): FeedEntry[]; export interface GameFeed { bind(action: TName, events: GameEvents): () => void; push(action: string, entry: unknown): void; recent(action: string, options?: { limit?: number; }): FeedEntry[]; subscribe(action: string, listener: (entry: FeedEntry) => void): () => void; snapshot(): Record; hydrate(data: Record): void; } /** * A rolling per-action feed of recent gameplay events, bindable to the event bus — the HUD ticker and killfeed history. * * @capability event-feed a rolling feed of recent gameplay events for a HUD ticker or killfeed */ export declare function createGameFeed(options?: GameFeedOptions): GameFeed;