/**
 * CI/CD Monitor State Manager
 *
 * Manages persistent state for workflow monitoring, failure detection,
 * and deduplication. Uses file-based storage with locking to prevent
 * concurrent write corruption.
 */
import { CICDMonitorState, FailureRecord, IStateManager } from './types.js';
/**
 * StateManager - Manages CI/CD monitor persistent state
 *
 * Features:
 * - File-based JSON storage
 * - File locking to prevent corruption
 * - Automatic directory creation
 * - State migration support
 * - Deduplication tracking
 */
export declare class StateManager implements IStateManager {
    private statePath;
    private lockPath;
    /**
     * Create state manager
     *
     * @param rootDir - Project root directory (defaults to cwd)
     */
    constructor(rootDir?: string);
    /**
     * Load state from disk (read-only, no locking)
     *
     * @returns Current state (or default if file doesn't exist/invalid)
     */
    loadState(): Promise<CICDMonitorState>;
    /**
     * Save state to disk with file locking
     *
     * @param state - State to save
     */
    saveState(state: CICDMonitorState): Promise<void>;
    /**
     * Write state to disk (internal, assumes lock is held)
     */
    private writeState;
    /**
     * Mark failure as processed (deduplication)
     *
     * @param runId - Workflow run ID
     */
    markProcessed(runId: number): Promise<void>;
    /**
     * Get last poll timestamp
     *
     * @returns ISO 8601 timestamp or null
     */
    getLastPoll(): Promise<string | null>;
    /**
     * Update last poll timestamp to now
     */
    updateLastPoll(): Promise<void>;
    /**
     * Add failure record
     *
     * @param failure - Failure record to add
     */
    addFailure(failure: FailureRecord): Promise<void>;
    /**
     * Get all unprocessed failures
     *
     * @returns Array of unprocessed failure records
     */
    getUnprocessedFailures(): Promise<FailureRecord[]>;
    /**
     * Acquire file lock (with timeout)
     *
     * Prevents concurrent writes from corrupting state file.
     */
    private acquireLock;
    /**
     * Release file lock
     */
    private releaseLock;
}
//# sourceMappingURL=state-manager.d.ts.map