import type { JobData } from './types.js';
export interface JobsFile {
    jobs: JobData[];
    version: number;
}
export declare class CronPersistence {
    private filePath;
    private cache;
    private dirty;
    private saveTimeout;
    private readonly debounceMs;
    constructor(filePath: string);
    /**
     * Initialize the storage file
     */
    initialize(): Promise<void>;
    /**
     * Load jobs from disk (with caching)
     */
    load(): Promise<JobsFile>;
    /**
     * Save jobs to disk (debounced)
     */
    save(data: JobsFile): Promise<void>;
    /**
     * Force immediate save (sync to disk)
     */
    flush(): Promise<void>;
    /**
     * Get all jobs
     */
    getJobs(): Promise<JobData[]>;
    /**
     * Get a single job by ID
     */
    getJob(id: string): Promise<JobData | null>;
    /**
     * Add a new job
     */
    addJob(job: JobData): Promise<void>;
    /**
     * Update an existing job
     */
    updateJob(id: string, updates: Partial<JobData>, options?: {
        clearAgentId?: boolean;
        clearWorkingDirectory?: boolean;
    }): Promise<boolean>;
    /**
     * Remove a job
     */
    removeJob(id: string): Promise<boolean>;
    /** Atomic write (fsync + rename) via shared helper. */
    private writeToDisk;
    /**
     * Mark cache as dirty and schedule debounced save
     */
    private markDirty;
    /**
     * Clear cache (useful for testing)
     */
    clearCache(): void;
}
