/**
 * Scheduled Job Types
 *
 * Defines the types for scheduled jobs in the sync orchestration system.
 *
 * @module core/scheduler/scheduled-job
 */
/**
 * Job types supported by the scheduler
 */
export type JobType = 'external-sync' | 'external-pull' | 'discrepancy-check' | 'living-docs-sync' | 'notification-cleanup';
/**
 * Job status values
 */
export type JobStatus = 'idle' | 'running' | 'failed' | 'disabled';
/**
 * Job schedule configuration
 */
export interface JobSchedule {
    /**
     * Interval between job runs in milliseconds
     */
    intervalMs: number;
    /**
     * Whether the job is enabled
     */
    enabled: boolean;
    /**
     * ISO timestamp of last successful run
     */
    lastRun?: string;
    /**
     * ISO timestamp of next scheduled run
     */
    nextRun?: string;
    /**
     * Current retry count for failed jobs
     */
    retryCount: number;
    /**
     * Maximum retries before giving up
     * @default 3
     */
    maxRetries: number;
}
/**
 * Scheduled job definition
 */
export interface ScheduledJob {
    /**
     * Unique job identifier (e.g., 'external-sync', 'discrepancy-check')
     */
    id: string;
    /**
     * Job type
     */
    type: JobType;
    /**
     * Schedule configuration
     */
    schedule: JobSchedule;
    /**
     * Current job status
     */
    status: JobStatus;
    /**
     * Error message if job failed
     */
    lastError?: string;
    /**
     * ISO timestamp of last state change
     */
    lastStateChange?: string;
}
/**
 * Configuration for registering a new job
 */
export interface ScheduledJobConfig {
    /**
     * Job identifier
     */
    id: string;
    /**
     * Job type
     */
    type: JobType;
    /**
     * Interval in milliseconds
     */
    intervalMs: number;
    /**
     * Initial enabled state
     * @default true
     */
    enabled?: boolean;
    /**
     * Maximum retries
     * @default 3
     */
    maxRetries?: number;
}
/**
 * Job execution result
 */
export interface JobExecutionResult {
    /**
     * Whether the job succeeded
     */
    success: boolean;
    /**
     * Duration in milliseconds
     */
    durationMs: number;
    /**
     * Error message if failed
     */
    error?: string;
    /**
     * Job-specific result data
     */
    data?: Record<string, unknown>;
}
/**
 * Create a new scheduled job from config
 *
 * @param config - Job configuration
 * @returns New scheduled job
 */
export declare function createScheduledJob(config: ScheduledJobConfig): ScheduledJob;
/**
 * Calculate next run time with optional exponential backoff
 *
 * @param job - The job to calculate next run for
 * @param withBackoff - Whether to apply exponential backoff (for retries)
 * @returns ISO timestamp of next run
 */
export declare function calculateNextRun(job: ScheduledJob, withBackoff?: boolean): string;
/**
 * Check if a job is due for execution
 *
 * @param job - The job to check
 * @returns true if job should run now
 */
export declare function isJobDue(job: ScheduledJob): boolean;
/**
 * Update job state after successful execution
 *
 * @param job - The job to update
 * @returns Updated job
 */
export declare function markJobComplete(job: ScheduledJob): ScheduledJob;
/**
 * Update job state after failed execution
 *
 * @param job - The job to update
 * @param error - Error message
 * @returns Updated job
 */
export declare function markJobFailed(job: ScheduledJob, error: string): ScheduledJob;
/**
 * Mark job as running
 *
 * @param job - The job to update
 * @returns Updated job
 */
export declare function markJobRunning(job: ScheduledJob): ScheduledJob;
/**
 * Pause a job (disable without clearing schedule)
 *
 * @param job - The job to pause
 * @returns Updated job
 */
export declare function pauseJob(job: ScheduledJob): ScheduledJob;
/**
 * Resume a paused job
 *
 * @param job - The job to resume
 * @returns Updated job
 */
export declare function resumeJob(job: ScheduledJob): ScheduledJob;
/**
 * Reset a failed job for retry
 *
 * @param job - The job to reset
 * @returns Updated job
 */
export declare function resetJob(job: ScheduledJob): ScheduledJob;
//# sourceMappingURL=scheduled-job.d.ts.map