/**
 * Cloud Sync Manager
 *
 * Manages synchronization of local data with cloud storage.
 * Uses TypedEventEmitterAdapter for type-safe events with backward compatibility.
 */
import { TypedEventEmitterAdapter, CloudSyncEvents } from '../../events/index.js';
import type { SyncConfig, SyncState, SyncResult, SyncConflict, SyncEventHandler, VersionInfo, CloudConfig } from './types.js';
export interface SyncManagerConfig {
    cloud: CloudConfig;
    sync: SyncConfig;
}
/**
 * Cloud Sync Manager with type-safe events.
 *
 * Emits the following events:
 * - 'sync:started' - When sync begins
 * - 'sync:completed' - When sync finishes successfully
 * - 'sync:failed' - When sync fails
 * - 'sync:progress' - Progress updates during sync
 * - 'sync:item_uploaded' - When an item is uploaded
 * - 'sync:item_downloaded' - When an item is downloaded
 * - 'sync:conflict_detected' - When a conflict is detected
 * - 'sync:conflict_resolved' - When a conflict is resolved
 */
export declare class CloudSyncManager extends TypedEventEmitterAdapter<CloudSyncEvents> {
    private storage;
    private config;
    private state;
    private syncTimer;
    private isSyncing;
    private versionCache;
    constructor(config: SyncManagerConfig);
    /**
     * Get current sync state
     */
    getState(): SyncState;
    /**
     * Start automatic sync
     */
    startAutoSync(): void;
    /**
     * Stop automatic sync
     */
    stopAutoSync(): void;
    /**
     * Perform sync operation
     */
    sync(): Promise<SyncResult>;
    /**
     * Sync a single item
     */
    private syncItem;
    /**
     * Calculate sync delta between local and remote
     */
    private calculateDelta;
    /**
     * Scan local files
     */
    private scanLocalFiles;
    /**
     * Recursively scan directory
     */
    private scanDirectory;
    /**
     * Scan remote files
     */
    private scanRemoteFiles;
    /**
     * Upload files to cloud storage
     */
    private uploadFiles;
    /**
     * Download files from cloud storage
     */
    private downloadFiles;
    /**
     * Resolve a sync conflict
     */
    private resolveConflict;
    /**
     * Manually resolve a conflict
     */
    resolveConflictManually(conflict: SyncConflict, resolution: 'local' | 'remote' | 'merged', mergedData?: Buffer): Promise<void>;
    /**
     * Get version history for a file
     */
    getVersionHistory(path: string): Promise<VersionInfo[]>;
    /**
     * Restore a specific version
     */
    restoreVersion(path: string, versionId: string): Promise<void>;
    /**
     * Check if path matches exclusion patterns
     */
    private isExcluded;
    /**
     * Calculate file checksum
     */
    private calculateChecksum;
    /**
     * Update sync state
     */
    private updateState;
    /**
     * Update progress
     */
    private updateProgress;
    /**
     * Emit sync event (maps legacy events to typed events)
     */
    private emitEvent;
    /**
     * Add event handler (legacy API)
     */
    onSyncEvent(handler: SyncEventHandler): void;
    /**
     * Remove event handler (legacy API)
     */
    offSyncEvent(handler: SyncEventHandler): void;
    /**
     * Add typed event handler (new API)
     */
    onTypedSyncEvent<K extends keyof CloudSyncEvents>(type: K, handler: (event: CloudSyncEvents[K]) => void): string;
    /**
     * Force push local state to remote
     */
    forcePush(): Promise<SyncResult>;
    /**
     * Force pull remote state to local
     */
    forcePull(): Promise<SyncResult>;
    /**
     * Dispose of the sync manager
     */
    dispose(): void;
}
export declare function createSyncManager(config: SyncManagerConfig): CloudSyncManager;
