/**
 * CancelationHandler - Graceful Ctrl+C (SIGINT) handling with state persistence
 *
 * Features:
 * - Single Ctrl+C: Save state and exit gracefully
 * - Double Ctrl+C (within 2s): Force exit immediately
 * - Polling mechanism for cooperative cancelation
 * - State persistence to resume later
 *
 * @module core/progress/cancelation-handler
 */
import type { Logger } from '../../utils/logger.js';
/**
 * Cancelation handler options
 */
export interface CancelationOptions {
    /** State save callback - called when Ctrl+C is pressed */
    onSaveState?: () => Promise<void>;
    /** Logger instance */
    logger?: Logger;
    /** Force exit timeout in milliseconds (default: 2000ms) */
    forceExitTimeout?: number;
}
/**
 * CancelationHandler - Handles SIGINT gracefully with double Ctrl+C force exit
 *
 * @example
 * ```typescript
 * const handler = new CancelationHandler({
 *   onSaveState: async () => {
 *     await saveImportState();
 *   }
 * });
 *
 * handler.register();
 *
 * // In import loop
 * for (const project of projects) {
 *   if (handler.shouldCancel()) {
 *     break;
 *   }
 *   await importProject(project);
 * }
 *
 * handler.unregister();
 * ```
 */
export declare class CancelationHandler {
    private logger;
    private onSaveState?;
    private forceExitTimeout;
    private cancelRequested;
    private firstCtrlCTime;
    private sigintHandler;
    constructor(options?: CancelationOptions);
    /**
     * Register SIGINT listener
     */
    register(): void;
    /**
     * Unregister SIGINT listener
     */
    unregister(): void;
    /**
     * Check if cancelation was requested (polling mechanism)
     *
     * @returns true if Ctrl+C was pressed
     */
    shouldCancel(): boolean;
    /**
     * Handle SIGINT signal (Ctrl+C)
     */
    private handleSigint;
    /**
     * Reset cancelation state (useful for testing)
     */
    reset(): void;
}
//# sourceMappingURL=cancelation-handler.d.ts.map