/**
 * Job CRUD and execution-result logic.
 *
 * Pure functions that operate on CronJob objects — no I/O.
 */
import type { CronJob, CronJobCreate, CronJobPatch, CronRunStatus } from './types.js';
/** Clear runningAtMs markers older than this (stuck run detection). */
export declare const STUCK_RUN_MS: number;
export declare function createJob(input: CronJobCreate, nowMs: number): CronJob;
export declare function applyJobPatch(job: CronJob, patch: CronJobPatch, nowMs: number): void;
export declare function computeJobNextRun(job: CronJob, nowMs: number): number | undefined;
export declare function isJobDue(job: CronJob, nowMs: number, forced?: boolean): boolean;
export type JobRunResult = {
    status: CronRunStatus;
    error?: string;
    startedAt: number;
    endedAt: number;
};
/**
 * Apply an execution result to a job's state.
 * Returns true if the job should be deleted (one-shot success with deleteAfterRun).
 */
export declare function applyJobResult(job: CronJob, result: JobRunResult): boolean;
/**
 * Normalize tick state: clear stuck runningAtMs, repair missing nextRunAtMs.
 * Returns true if any field was changed.
 */
export declare function normalizeJobState(job: CronJob, nowMs: number): boolean;
/**
 * Record a schedule computation error. Auto-disables after MAX_SCHEDULE_ERRORS.
 */
export declare function recordScheduleError(job: CronJob, err: unknown): void;
//# sourceMappingURL=jobs.d.ts.map