import type { Storage } from '../../storage/interface.ts'; import type { TimerEntry } from '../types.ts'; export type ScannedTimerEntry = { key: string; entry: TimerEntry; }; export type TimerSource = { iterator: AsyncIterator<[string, Uint8Array]>; next: ScannedTimerEntry | null; readNext: (iterator: AsyncIterator<[string, Uint8Array]>, storage: Storage) => Promise; }; export declare function compareScannedTimerEntries(left: ScannedTimerEntry, right: ScannedTimerEntry): number; export declare function readNextScannedTimerEntry(iterator: AsyncIterator<[string, Uint8Array]>, storage: Storage): Promise; export declare function readNextTerminalCleanupTimerEntry(iterator: AsyncIterator<[string, Uint8Array]>, storage: Storage): Promise; export declare function readNextTeardownTimerEntry(iterator: AsyncIterator<[string, Uint8Array]>, storage: Storage): Promise; export declare function advanceTimerSource(timerSource: TimerSource, storage: Storage): Promise; export declare function selectNextTimerSource(timerSources: TimerSource[]): TimerSource | undefined; /** * `true` for a timer kind whose `timer-idx:` reverse-index entry is safe to * delete unconditionally on fire, with no read-and-compare first. * `'terminal-cleanup'`/`'teardown'` get no reverse index at all (never * cancelled out-of-band). `'schedule'`/`'sleep'`/`'wait-condition'` are * EXCLUDED even though this function's signature still accepts them — * `scheduler-class.ts`'s `#buildTimerIndexDeleteOperation` checks those three * kinds and routes them through the lookup-and-compare path BEFORE ever * calling this function, because each can have its deterministic id re-armed * by a legitimate successor (schedule's own re-arm-on-every-tick; a * `start-new` replacement reusing a sleep/wait-condition id) while the * original fire is still being cleaned up. */ export declare function shouldDeleteTimerIndexWithoutLookup(entry: TimerEntry): boolean;