import { CapturedInteraction, HydrationBoundaryId, InteractionReplayConfig, ReplayableInteractionType } from './types'; /** * Manages interaction capture and replay for hydration boundaries. * * @example * ```typescript * const replayManager = new InteractionReplayManager(); * * // Start capturing for a boundary * replayManager.startCapture('boundary-1', containerElement); * * // ... user interacts with the component ... * * // After hydration, replay interactions * await replayManager.replayInteractions('boundary-1'); * ``` */ export declare class InteractionReplayManager { /** Configuration */ private readonly config; /** Buffers per boundary */ private readonly buffers; /** Active event listeners per boundary */ private readonly listeners; /** Container elements per boundary */ private readonly containers; /** Debug mode */ private readonly debug; /** * Creates a new InteractionReplayManager. * * @param config - Replay configuration * @param debug - Enable debug logging */ constructor(config?: Partial, debug?: boolean); /** * Starts capturing interactions for a hydration boundary. * * @param boundaryId - ID of the hydration boundary * @param container - Container element to capture events from */ startCapture(boundaryId: HydrationBoundaryId, container: HTMLElement): void; /** * Stops capturing interactions for a hydration boundary. * * @param boundaryId - ID of the hydration boundary */ stopCapture(boundaryId: HydrationBoundaryId): void; /** * Replays all captured interactions for a boundary. * * @param boundaryId - ID of the hydration boundary * @returns Number of interactions replayed */ replayInteractions(boundaryId: HydrationBoundaryId): Promise; /** * Returns the number of captured interactions for a boundary. * * @param boundaryId - ID of the hydration boundary * @returns Number of captured interactions */ getCapturedCount(boundaryId: HydrationBoundaryId): number; /** * Returns all captured interactions for a boundary without removing them. * * @param boundaryId - ID of the hydration boundary * @returns Array of captured interactions */ peekCaptured(boundaryId: HydrationBoundaryId): readonly CapturedInteraction[]; /** * Checks if a boundary has any captured interactions. * * @param boundaryId - ID of the hydration boundary * @returns true if there are captured interactions */ hasCaptured(boundaryId: HydrationBoundaryId): boolean; /** * Checks if a boundary is currently capturing interactions. * * @param boundaryId - ID of the hydration boundary * @returns true if capture is active */ isCapturing(boundaryId: HydrationBoundaryId): boolean; /** * Clears all captured interactions for a boundary without replaying. * * @param boundaryId - ID of the hydration boundary */ clearCaptured(boundaryId: HydrationBoundaryId): void; /** * Cleans up all resources. * Call this when unmounting the hydration system. */ dispose(): void; /** * Creates a capture listener for a specific event type. */ private createCaptureListener; /** * Captures details of an interaction. */ private captureInteraction; /** * Replays a single interaction. */ private replayInteraction; /** * Debug logging helper. */ private log; } /** * Gets or creates the global InteractionReplayManager instance. * * @param config - Replay configuration (only used if creating new instance) * @param debug - Enable debug logging * @returns The global InteractionReplayManager instance */ export declare function getInteractionReplayManager(config?: Partial, debug?: boolean): InteractionReplayManager; /** * Resets the global InteractionReplayManager instance. * Primarily useful for testing. */ export declare function resetInteractionReplayManager(): void; export type { CapturedInteraction, ReplayableInteractionType, InteractionReplayConfig, };