/**
 * Sync Service - Full export and import implementation
 *
 * Implements the sync operations specified in api/sync.md:
 * - Full and incremental export to JSONL
 * - Import with merge strategy
 * - Conflict resolution
 */
import type { StorageBackend } from '@stoneforge/storage';
import type { ExportResult, ImportResult as SyncImportResult, ExportOptions as SyncExportOptions, ImportOptions as SyncImportOptions } from './types.js';
/**
 * Service for handling JSONL export and import operations
 */
export declare class SyncService {
    private backend;
    constructor(backend: StorageBackend);
    /**
     * Export elements to JSONL format
     *
     * @param options - Export configuration
     * @returns Export result with file paths and counts
     */
    export(options: SyncExportOptions): Promise<ExportResult>;
    /**
     * Export synchronously (useful for CLI and testing)
     */
    exportSync(options: SyncExportOptions): ExportResult;
    /**
     * Export to string (for API and in-memory use)
     */
    exportToString(options?: {
        includeEphemeral?: boolean;
        includeDependencies?: boolean;
    }): {
        elements: string;
        dependencies?: string;
    };
    /**
     * Import elements from JSONL files
     *
     * @param options - Import configuration
     * @returns Import result with counts and conflicts
     */
    import(options: SyncImportOptions): Promise<SyncImportResult>;
    /**
     * Import synchronously
     */
    importSync(options: SyncImportOptions): SyncImportResult;
    /**
     * Import from JSONL strings (for API and in-memory use)
     */
    importFromStrings(elementsContent: string, dependenciesContent: string, options?: Partial<SyncImportOptions>): SyncImportResult;
    /**
     * Get all elements from storage
     */
    private getAllElements;
    /**
     * Filter out tasks that are children of ephemeral workflows
     */
    private filterOutEphemeralTasks;
    /**
     * Get dirty elements data (for incremental export)
     */
    private getDirtyElementsData;
    /**
     * Get all dependencies from storage
     */
    private getAllDependencies;
    /**
     * Get a single element by ID
     */
    private getElement;
    /**
     * Convert database row to Element
     */
    private rowToElement;
    /**
     * Serialize elements to JSONL, skipping any that fail validation.
     */
    private serializeElementsSafe;
    /**
     * Insert an element into storage (within transaction)
     */
    private insertElement;
    /**
     * Update an element in storage (within transaction)
     */
    private updateElement;
    /**
     * Insert a dependency into storage (within transaction)
     */
    private insertDependency;
    /**
     * Delete a dependency from storage (within transaction)
     */
    private deleteDependency;
}
/**
 * Create a new SyncService instance
 */
export declare function createSyncService(backend: StorageBackend): SyncService;
//# sourceMappingURL=service.d.ts.map