import type { Kysely } from 'kysely'; import type { JobRegistry } from './registry.js'; /** * ScheduleManager polls the database for cron-scheduled jobs that are due, * enqueues them, and advances their next_run_at timestamps. */ export declare class ScheduleManager { private running; private pollTimer; private readonly pollInterval; private readonly db; private readonly registry; constructor(db: Kysely, registry: JobRegistry, pollInterval?: number); /** Upserts all registered scheduled jobs into the database. */ syncSchedules(): Promise; /** Starts the polling loop. */ start(): void; /** Stops the polling loop. */ stop(): Promise; isRunning(): boolean; /** * Parses a 5-field cron expression and returns the next matching minute * after `from`. Scans up to ~1 year of minutes before giving up. */ computeNextRun(cronExpr: string, from?: Date): Date; /** Arms the next poll timer. */ private schedulePoll; /** Runs one poll cycle, then re-arms the timer if still running. */ private poll; /** * Finds all schedules that are due and processes each one: * - Skips enqueuing if the job already has a pending/active instance. * - Otherwise enqueues a new job instance. * In both cases, advances the schedule's next_run_at. */ private checkSchedules; /** Inserts a new job instance into the jobs table. */ private enqueueJob; /** Updates a schedule's next_run_at and records last_run_at. */ private advanceSchedule; /** Returns true if a job with the given name is already created or active. */ private hasPendingJob; /** * Checks whether a single cron field expression matches the given value. * Supports: wildcard (*), lists (1,5,10), ranges (1-5), and steps (star/5, 1-10/2). */ private matchesCronField; /** Evaluates a single segment of a cron field (step, range, or literal). */ private segmentMatches; } //# sourceMappingURL=scheduler.d.ts.map