/** * Wrapper over JS timers that allows re-scheduling them * to earlier time */ export declare class EarlyTimer { private _timeout?; private _timeoutTs?; private _handler; constructor(); /** * Emit the timer when the event loop is idle * (basically `queueMicrotask()`) */ emitWhenIdle(): void; /** * Emit the timer before the next given milliseconds * * Shorthand for `emitBefore(performance.now() + ms)` * * @param ms Milliseconds to schedule for */ emitBeforeNext(ms: number): void; /** * Emit the timer before the given time * * @param ts timestamp in ms relative to `performance.timeOrigin` */ emitBefore(ts: number): void; /** * Emit the timer right now */ emitNow(): void; /** * Cancel the timer */ reset(): void; /** * Set timeout handler */ onTimeout(handler: () => void): void; }