/**
 * ContextManager - Manages runtime context and notifies subscribers of changes.
 *
 * The ContextManager is responsible for:
 * - Collecting context from various sources (page, session, viewport)
 * - Notifying subscribers when context changes
 * - Providing the current context snapshot
 */
import type { NavigationMonitor } from '../navigation/NavigationMonitor';
import type { TelemetryClient } from '../telemetry/types';
import type { RoutesConfig } from '../types';
import type { AnchorState, ContextChangeCallback, PageHistoryEntry, RuntimeContext, Unsubscribe } from './types';
export interface ContextManagerOptions {
    /** Telemetry client for session ID */
    telemetry?: TelemetryClient;
    /** Routes config for route matching */
    routes?: RoutesConfig;
    /** Initial page history (optional) */
    initialPageHistory?: PageHistoryEntry[];
    /** Centralized navigation monitor (replaces direct History API patching) */
    navigation?: NavigationMonitor;
}
/**
 * ContextManager class for managing runtime context.
 */
export declare class ContextManager {
    private context;
    private previousContext;
    private listeners;
    private telemetry?;
    private routes?;
    private navigation?;
    private cleanupFns;
    constructor(options?: ContextManagerOptions);
    /**
     * Get the current runtime context.
     */
    get(): RuntimeContext;
    /**
     * Subscribe to context changes.
     * Returns an unsubscribe function.
     */
    subscribe(callback: ContextChangeCallback): Unsubscribe;
    /**
     * Update the routes config (e.g., when config is fetched).
     */
    setRoutes(routes: RoutesConfig): void;
    /**
     * Update anchor states.
     */
    setAnchors(anchors: AnchorState[]): void;
    /**
     * Manually update the session ID (e.g., when telemetry initializes).
     */
    setSessionId(sessionId: string): void;
    /**
     * Clean up event listeners and subscriptions.
     */
    destroy(): void;
    private setupBrowserListeners;
    private updateViewport;
    private updatePage;
    private addPageToHistory;
    private updateContext;
    private notifyListeners;
}
/**
 * Create a ContextManager instance.
 */
export declare function createContextManager(options?: ContextManagerOptions): ContextManager;
