import type { IScheduler, ITask, ITime } from '../types.js'; /** * Node.js optimized scheduler implementation. * * Uses setImmediate for asap tasks. setImmediate fires in Node's "check" * phase, AFTER the "timers" phase — so a setTimeout(0) callback can fire * before a pending setImmediate. To preserve "asap before delay" ordering, * the timer callback first cancels and flushes any pending setImmediate. * * Implementation notes (metal): * - asapTasks array is recycled across flushes to avoid per-flush * allocation under high-frequency scheduling. * - All tasks within a single flush share one logical timestamp so that * "events scheduled in the same tick" agree on time(). */ export declare class NodeScheduler implements IScheduler { private asapTasks; private asapImmediate; private recycled; private readonly initialTime; private readonly initialWallClockTime; asap(task: ITask): Disposable; delay(task: ITask, delay: ITime): Disposable; flushAsapTasks: () => void; runDelayedTask: (task: ITask) => void; time(): ITime; dayTime(): ITime; } export declare function createNodeScheduler(): IScheduler;