import type { RestartOutcomeFile, RestartScheduleFile } from "../contracts/core.js"; import type { Profile } from "../profiles/types.js"; import { type ConsumeOptions, type RestartExecution } from "./restart-consumer.js"; /** بين محاولتين بعد تأجيل. ربع ساعة: أقصر منها يزعج، وأطول منها يفوّت نافذة هدوء قصيرة. */ export declare const DEFER_RETRY_MS: number; /** أقصى ما نؤجّل قبل التخلّي عن الجولة. */ export declare const DEFER_CEILING_MS: number; /** * AR: موعد الجولة التالية بالمللي ثانية، أو ‎null‎ حين لا جدول. **دالّة خالصة**: الزمن يُمرَّر، * فتُختبَر سنةٌ من الجداول في مللي ثانية. * EN: When the next round is due in milliseconds, or `null` when nothing is scheduled. **A pure * function**: time is passed in, so a year of schedules is tested in a millisecond. */ export declare function dueAt(schedule: RestartScheduleFile, lastRestartAt: string | null, now: number): number | null; export interface ScheduleTimerOptions extends ConsumeOptions { /** يُحقَن في الاختبار. الافتراض: قراءة المرآة من مجلد الحالة. */ readSchedule?: () => RestartScheduleFile | null; readLastRestart?: () => RestartOutcomeFile | null; } /** * AR: يقرّر في كل جولة: أحان الموعد؟ وهل نؤجّل؟ وهل بلغنا السقف؟ لا مؤقّت داخله ولا ساعة: الزمن * يُمرَّر من الخارج، فهذه الحلقة كلّها قابلة للاختبار بلا انتظار ثانية واحدة. * EN: Decides on each round: is it due? should it defer? has it hit the ceiling? It holds no timer * and no clock: time comes in from outside, so this whole loop is testable without waiting a * single second. */ export declare class ScheduleTimer { private readonly profile; private readonly options; /** متى بدأ التأجيل الحالي، أو ‎null‎ حين لا تأجيل جارٍ. */ private deferringSince; private nextAttemptAt; constructor(profile: Profile, options?: ScheduleTimerOptions); round(now?: number): Promise; private readSchedule; private readLastRestart; } //# sourceMappingURL=schedule-timer.d.ts.map