/**
 * EventBus - Normalized event stream for the runtime.
 *
 * The EventBus provides:
 * - Publish/subscribe for normalized events
 * - Event history for recent event lookups
 * - Filtering by name, pattern, or source
 */
import type { EventCallback, EventFilter, EventUnsubscribe, NormalizedEvent } from './types';
export interface EventBusOptions {
    /** Maximum number of events to keep in history */
    maxHistorySize?: number;
}
/**
 * EventBus class for managing normalized events.
 */
export declare class EventBus {
    private subscriptions;
    private history;
    private maxHistorySize;
    constructor(options?: EventBusOptions);
    /**
     * Subscribe to events matching an optional filter.
     * Returns an unsubscribe function.
     */
    subscribe(filterOrCallback: EventFilter | EventCallback, maybeCallback?: EventCallback): EventUnsubscribe;
    /**
     * Publish an event to all matching subscribers.
     */
    publish(name: string, props?: Record<string, unknown>, source?: NormalizedEvent['source']): void;
    /**
     * Publish a pre-constructed NormalizedEvent.
     */
    publishEvent(event: NormalizedEvent): void;
    /**
     * Get recent events matching an optional filter.
     */
    getRecent(filter?: EventFilter, limit?: number): NormalizedEvent[];
    /**
     * Check if an event with a specific name occurred within a time window.
     */
    hasRecentEvent(eventName: string, withinMs: number, source?: NormalizedEvent['source']): boolean;
    /**
     * Count events matching a filter within a time window.
     */
    countRecentEvents(filter: EventFilter, withinMs?: number): number;
    /**
     * Clear all event history.
     */
    clearHistory(): void;
    /**
     * Get the number of current subscribers.
     */
    getSubscriberCount(): number;
}
/**
 * Create an EventBus instance.
 */
export declare function createEventBus(options?: EventBusOptions): EventBus;
