/**
 * Task Scheduler - Priority-based task scheduling with execution timing
 *
 * Features:
 * - Priority queue with aging to prevent starvation
 * - Scheduled execution at specific times
 * - Dependency management between tasks
 * - Concurrent execution control
 * - Retry handling with backoff
 * - Task lifecycle events
 */
import { EventEmitter } from 'events';
import { ScheduledTask, ScheduledTaskStatus, TaskPriority, CreateTaskOptions, SchedulerConfig, SchedulerStats, TaskExecutionResult } from './types.js';
export declare class Scheduler extends EventEmitter {
    private tasks;
    private config;
    private running;
    private tickTimer;
    private agingTimer;
    private executionTimes;
    private waitTimes;
    private completedCount;
    private startTime;
    constructor(config?: Partial<SchedulerConfig>);
    /**
     * Generate unique task ID
     */
    private generateId;
    /**
     * Create and add a new task to the scheduler
     */
    createTask(handler: () => Promise<unknown> | unknown, options?: CreateTaskOptions): ScheduledTask;
    /**
     * Add an existing task to the scheduler
     */
    addTask(task: ScheduledTask): void;
    /**
     * Get a task by ID
     */
    getTask(taskId: string): ScheduledTask | undefined;
    /**
     * Get all tasks
     */
    getAllTasks(): ScheduledTask[];
    /**
     * Get tasks by status
     */
    getTasksByStatus(status: ScheduledTaskStatus): ScheduledTask[];
    /**
     * Get tasks by tag
     */
    getTasksByTag(tag: string): ScheduledTask[];
    /**
     * Get pending tasks sorted by priority (lower number = higher priority)
     */
    getPendingTasks(): ScheduledTask[];
    /**
     * Get scheduled tasks that are ready to run
     */
    getReadyScheduledTasks(): ScheduledTask[];
    /**
     * Check if a task's dependencies are satisfied
     */
    areDependenciesSatisfied(task: ScheduledTask): boolean;
    /**
     * Get next task to execute
     */
    getNextTask(): ScheduledTask | null;
    /**
     * Get count of currently running tasks
     */
    getRunningCount(): number;
    /**
     * Update task priority
     */
    updatePriority(taskId: string, priority: TaskPriority): boolean;
    /**
     * Apply priority aging to prevent starvation
     */
    applyPriorityAging(): void;
    /**
     * Execute a single task
     */
    executeTask(task: ScheduledTask): Promise<TaskExecutionResult>;
    /**
     * Process the scheduler tick
     */
    private tick;
    /**
     * Start the scheduler
     */
    start(): void;
    /**
     * Stop the scheduler
     */
    stop(): void;
    /**
     * Check if scheduler is running
     */
    isRunning(): boolean;
    /**
     * Cancel a task
     */
    cancelTask(taskId: string): boolean;
    /**
     * Pause a task
     */
    pauseTask(taskId: string): boolean;
    /**
     * Resume a paused task
     */
    resumeTask(taskId: string): boolean;
    /**
     * Remove a task from the scheduler
     */
    removeTask(taskId: string): boolean;
    /**
     * Clear all completed/failed/cancelled tasks
     */
    clearFinished(): number;
    /**
     * Get scheduler statistics
     */
    getStats(): SchedulerStats;
    /**
     * Get scheduler configuration
     */
    getConfig(): SchedulerConfig;
    /**
     * Update scheduler configuration
     */
    updateConfig(config: Partial<SchedulerConfig>): void;
    /**
     * Schedule a task to run at a specific time
     */
    scheduleAt(handler: () => Promise<unknown> | unknown, scheduledAt: Date, options?: Omit<CreateTaskOptions, 'scheduledAt'>): ScheduledTask;
    /**
     * Schedule a task to run after a delay
     */
    scheduleAfter(handler: () => Promise<unknown> | unknown, delayMs: number, options?: Omit<CreateTaskOptions, 'scheduledAt'>): ScheduledTask;
    /**
     * Wait for all tasks to complete
     */
    waitForAll(timeoutMs?: number): Promise<void>;
    /**
     * Wait for a specific task to complete
     */
    waitForTask(taskId: string, timeoutMs?: number): Promise<TaskExecutionResult>;
    /**
     * Dispose of the scheduler and clean up resources
     */
    dispose(): void;
}
export declare function createScheduler(config?: Partial<SchedulerConfig>): Scheduler;
export declare function getScheduler(): Scheduler;
export declare function resetScheduler(): void;
