import type { Clock } from '../services/ports/clock.js'; /** * TEST-ONLY. A `Clock` that does not wait: `sleep` moves the time forward at once * and remembers how long it was asked to wait. The intervals fire as the time * passes (during a `sleep` or an `advance`), in the order they are due, and * `advance` waits for the work they start, so a test controls the heartbeat. */ export declare class FakeClock implements Clock { private time; /** Every wait, in order. */ readonly sleeps: number[]; /** * When true, the work of an interval is started and not waited for, as a real * timer does, so that the code it interrupts goes on while the work is under * way. `settle` waits for it. */ detached: boolean; private readonly inFlight; private readonly intervals; constructor(time?: number); now(): number; sleep: (ms: number) => Promise; interval(ms: number, work: () => void | Promise): () => void; /** Moves the time forward, running every interval that falls due on the way. */ advance(ms: number): Promise; /** Waits for the work that a detached interval started. */ settle(): Promise; /** The number of intervals that are still running. */ get running(): number; }