/** * clock.ts, the real clock, and a deterministic one for tests. * * The two sources are kept separate on purpose. `now()` is the wall clock, * which is what a replay cursor has to be expressed in because that is what a * message provider understands. `monotonicNow()` is a monotonic source that * does not move while the host is suspended, which is what makes uptime * ranking honest and what lets a woken node discover it was asleep: the gap * between the two IS the sleep. */ import type { ClusterClock } from './types.js'; /** The clock a running daemon uses. */ export declare function createSystemClusterClock(): ClusterClock; /** * A clock that only moves when a test tells it to. * * `advance` fires due timers in time order and re-checks after each one, so a * timer that schedules another timer inside the same advance window still * runs. Wall and monotonic time advance together unless `advanceWallOnly` is * used, which is how a host suspend is simulated: the wall clock jumps, the * monotonic clock does not, and no timer fires during the gap. */ export declare class FakeClusterClock implements ClusterClock { private wall; private mono; private nextId; private tasks; constructor(startWallMs?: number, startMonotonicMs?: number); now(): number; monotonicNow(): number; setTimer(fn: () => void, ms: number): () => void; /** Move both clocks forward, running every timer that comes due. */ advance(ms: number): void; /** * Simulate a host suspend: wall time passes, monotonic time does not, and no * timer fires. The next `advance` is what delivers the late tick. */ advanceWallOnly(ms: number): void; /** Pending timer count, a test's check that nothing was left armed. */ get pendingTimers(): number; } //# sourceMappingURL=clock.d.ts.map