export type EngagementType = 'CONFUSION' | 'FRUSTRATION' | 'ENGAGEMENT'; export interface EngagementEventDetail { engagementType: EngagementType; eventType: string; message: string; timestamp: number; data: any; } export declare const EVENT_TYPE_MAPPING: Record; /** Interface for the engagement event bus public API */ export interface IEngagementEventBus { dispatch(detail: EngagementEventDetail, cooldownMs?: number): void; setGlobalCooldown(cooldownMs: number): void; clearCooldown(eventType: string): void; clearAllCooldowns(): void; setDedupWindow(windowMs: number): void; clearDedupCache(): void; getDedupWindow(): number; setEventTypeCooldown(eventType: string, cooldownMs: number): void; } /** Centralized event bus for managing engagement events with cooldowns */ declare class EngagementEventBus implements IEngagementEventBus { private lastEventTimes; private globalCooldownMs; private lastGlobalEventTime; private recentEvents; private dedupWindowMs; private eventTypeCooldowns; /** * Check if an event is a duplicate within the deduplication window * @param detail The engagement event details * @returns true if this is a duplicate event */ private isDuplicateEvent; /** * Dispatch an engagement event with cooldown management * @param detail The engagement event details * @param cooldownMs Optional per-event-type cooldown (overrides global cooldown) */ dispatch(detail: EngagementEventDetail, cooldownMs?: number): void; /** * Set the global cooldown time for all engagement events * @param cooldownMs Cooldown time in milliseconds */ setGlobalCooldown(cooldownMs: number): void; /** * Set a specific cooldown for an event type * @param eventType The event type to set cooldown for * @param cooldownMs Cooldown time in milliseconds */ setEventTypeCooldown(eventType: string, cooldownMs: number): void; /** * Clear the cooldown for a specific event type * @param eventType The event type to clear cooldown for */ clearCooldown(eventType: string): void; /** * Clear all cooldowns */ clearAllCooldowns(): void; /** * Set the deduplication window time * @param windowMs Deduplication window in milliseconds */ setDedupWindow(windowMs: number): void; /** * Clear the deduplication cache */ clearDedupCache(): void; /** * Get the current deduplication window time */ getDedupWindow(): number; } declare const eventBus: EngagementEventBus; /** Dispatches our standard engagement event with centralized cooldown management. */ export declare function dispatchEngagementEvent(detail: EngagementEventDetail, cooldownMs?: number): void; export { eventBus as EngagementEventBus }; export declare function throttle any>(func: T, delay: number): (...args: Parameters) => void;