/** * Configuration options for simulated network latency and jitter. */ export interface NetworkSimulationConfig { /** * Enables or disables network delay simulation. */ enabled: boolean; /** * Minimum one-way network delay in milliseconds. */ minLatencyMs: number; /** * Maximum additional random jitter in milliseconds added to `minLatencyMs`. */ jitterMs: number; /** * Optional deterministic seed for reproducible jitter generation. */ seed?: number; /** * Whether to also delay pure `jest.fn()` unit-test spy mocks. * Defaults to true when `configureNetworkSimulation` is called explicitly, * and false when only environment background noise (`DEM_NETWORK_NOISE=1`) is active. */ includeJestMocks?: boolean; } /** * Sets or updates the global network simulation configuration. * * @param options - Partial network simulation configuration to apply. * @returns The updated active network simulation configuration. */ export declare function configureNetworkSimulation(options: Partial): NetworkSimulationConfig; /** * Resets global network simulation configuration back to environment defaults. * * @returns The restored network simulation configuration. */ export declare function resetNetworkSimulation(): NetworkSimulationConfig; /** * Returns a copy of the current global network simulation configuration. * * @returns Active network simulation configuration. */ export declare function getNetworkSimulationConfig(): NetworkSimulationConfig; /** * Computes a single simulated one-way delay in milliseconds from the given or global config. * * @param config - Optional configuration override. * @returns Simulated delay in milliseconds. */ export declare function computeSimulatedDelayMs(config?: Partial): number; /** * Instruments a socket-like object so that acknowledgements and outbound emits * experience configurable network latency and jitter with strict FIFO stream ordering. * Preserves Jest mock metadata (`mock.calls`, `mockImplementation`, `mockClear`) when wrapping `jest.fn()`. * * @param socket - Socket or mock socket object to instrument. * @param configOverride - Optional per-socket simulation configuration override. * @returns The instrumented socket instance. */ export declare function applyNetworkSimulationToSocket(socket: T, configOverride?: Partial): T;