interface Logger { info(message: string): void; warn(message: string): void; error(message: string | Error, err?: Error): void; debug(message: string | Error, err?: Error): void; } declare function setLogger(logger: Logger): void; interface RunCoordinator { shouldRun(key: string, ttlMs: number): boolean | Promise; onComplete?(key: string): void | Promise; } type SkipReason = 'not-elected' | 'coordinator-error'; declare function setRunCoordinator(coordinator: RunCoordinator | undefined): void; type TaskContext = { date: Date; dateLocalIso: string; task?: ScheduledTask; execution?: Execution; triggeredAt: Date; reason?: SkipReason; }; type TaskEvent = 'task:started' | 'task:stopped' | 'task:destroyed' | 'execution:started' | 'execution:finished' | 'execution:failed' | 'execution:missed' | 'execution:overlap' | 'execution:maxReached' | 'execution:skipped'; type TaskOptions = { timezone?: string; name?: string; noOverlap?: boolean; distributed?: boolean; runCoordinator?: RunCoordinator; distributedLease?: number; maxExecutions?: number; maxRandomDelay?: number; logger?: Logger; suppressMissedWarning?: boolean; missedExecutionTolerance?: number; executeTimeout?: number; startTimeout?: number; }; type Execution = { id: string; reason: 'invoked' | 'scheduled'; startedAt?: Date; finishedAt?: Date; error?: Error; result?: any; }; type TaskFn = (context: TaskContext) => any | Promise; interface ScheduledTask { id: string; name?: string; start(): void | Promise; stop(): void | Promise; getStatus(): string; destroy(): void | Promise; execute(): Promise; getNextRun(): Date | null; getNextRuns(count: number): Date[]; match(date: Date): boolean; msToNext(): number | null; isBusy(): boolean; runsLeft(): number | undefined; getPattern(): string; on(event: TaskEvent, fun: (context: TaskContext) => Promise | void): void; off(event: TaskEvent, fun: (context: TaskContext) => Promise | void): void; once(event: TaskEvent, fun: (context: TaskContext) => Promise | void): void; } interface CronFieldError { field: string; value?: string; message: string; } interface ParsedFields { second: number[]; minute: number[]; hour: number[]; dayOfMonth: (number | string)[]; month: number[]; dayOfWeek: number[]; } interface DetailedValidation { valid: boolean; fields?: ParsedFields; errors: CronFieldError[]; } declare function validateDetailed$1(pattern: string): DetailedValidation; declare function parse$1(pattern: string): ParsedFields; declare function schedule(expression: string, func: TaskFn | string, options?: TaskOptions): ScheduledTask; declare function createTask(expression: string, func: TaskFn | string, options?: TaskOptions): ScheduledTask; declare function solvePath(filePath: string): string; declare function validate(expression: string): boolean; declare const validateDetailed: typeof validateDetailed$1; declare const parse: typeof parse$1; declare const getTasks: () => Map; declare const getTask: (taskId: string) => ScheduledTask | undefined; interface NodeCron { schedule: typeof schedule; createTask: typeof createTask; validate: typeof validate; validateDetailed: typeof validateDetailed; parse: typeof parse; getTasks: typeof getTasks; getTask: typeof getTask; setLogger: typeof setLogger; setRunCoordinator: typeof setRunCoordinator; } declare const nodeCron: NodeCron; export { createTask, nodeCron as default, getTask, getTasks, nodeCron, parse, schedule, setLogger, setRunCoordinator, solvePath, validate, validateDetailed }; export type { CronFieldError, DetailedValidation, Logger, NodeCron, ParsedFields, RunCoordinator, ScheduledTask, SkipReason, TaskContext, TaskFn, TaskOptions };