/**
 * PMO Sync Manager
 *
 * Handles automatic bi-directional sync between SQLite database and board.md:
 * - Auto-sync from board.md before read operations (if file is newer)
 * - Auto-export to board.md after write operations
 *
 * Uses hybrid mtime + content-based sync detection:
 * 1. Check mtime first (fast) - if unchanged, skip
 * 2. If mtime changed, compare content - if same, just update stored mtime
 * 3. If content differs, perform full sync
 *
 * Multi-project support:
 * - Default project: pmo/board.md
 * - Other projects: pmo/board-{projectId}.md
 *
 * Clock source: Uses filesystem mtime which comes from the OS system clock
 * (computer/VM clock depending on where the filesystem resides)
 */
import { SQLiteStorage } from './storage-sqlite.js';
/**
 * Get the board path for a project
 * Standard: pmo/projects/{projectId}/kanban.md
 * Falls back to legacy paths for backwards compatibility
 */
export declare function getBoardPath(pmoPath: string, projectId: string): string;
export interface SyncMetadata {
    lastSyncAt: number;
    lastBoardMtime: number;
    lastDbWriteAt: number;
    contentHash?: string;
}
export interface PMOContext {
    pmoPath: string;
    storage: SQLiteStorage;
    storageType: 'sqlite' | 'git';
}
/**
 * Get sync metadata from database
 */
export declare function getSyncMetadata(storage: SQLiteStorage): SyncMetadata | null;
/**
 * Update sync metadata after a sync operation
 */
export declare function updateSyncMetadata(storage: SQLiteStorage, boardMtime: number, contentHash?: string): void;
/**
 * Check if board.md mtime has changed (fast check)
 */
export declare function boardMtimeChanged(pmoPath: string, storage: SQLiteStorage, projectId?: string): boolean;
/**
 * Check if board.md content has actually changed (slower, content-based check)
 * Only called when mtime indicates a potential change
 */
export declare function boardContentChanged(pmoPath: string, storage: SQLiteStorage, content: string): boolean;
/**
 * Auto-sync from board.md if it has changes
 * Uses hybrid mtime + content approach:
 * 1. If mtime unchanged -> skip (fast path)
 * 2. If mtime changed -> check content hash
 * 3. If content same -> just update mtime, skip sync
 * 4. If content different -> perform sync
 *
 * Returns: true if sync performed, false otherwise
 */
export declare function autoSyncFromBoard(pmoPath: string, storage: SQLiteStorage, logger?: (msg: string) => void, projectId?: string): boolean;
/**
 * Auto-export database to board.md after write operations
 *
 * DISABLED: Markdown sync is disabled. DB is the sole source of truth.
 * To re-enable, uncomment the function body below.
 */
export declare function autoExportToBoard(_pmoPath: string, _storage: SQLiteStorage, _logger?: (msg: string) => void, _projectId?: string): Promise<void>;
/**
 * Get the workspace.db path from a PMO path
 * PMO can be at <workspace>/pmo or <workspace>/repos/<repo>/pmo
 * workspace.db is always at <workspace>/.proletariat/workspace.db
 */
export declare function getWorkspaceDbPath(pmoPath: string): string;
/**
 * Get storage with auto-sync from board.md (for read operations)
 * Use this when you need to READ from the database
 *
 * Note: storageType parameter controls sync strategy, not storage engine.
 * - All modes use SQLite (workspace.db) for storage
 * - 'git' mode enables multi-machine sync via git push/pull
 * - 'sqlite' mode is local-only (no multi-machine sync)
 */
export declare function getStorageWithAutoSync(pmoPath: string, _storageType: 'sqlite' | 'git', _logger?: (msg: string) => void): SQLiteStorage;
/**
 * Wrapper for write operations that auto-exports to board.md after
 */
export declare function withAutoExport<T>(pmoPath: string, storage: SQLiteStorage, operation: () => Promise<T>, logger?: (msg: string) => void): Promise<T>;
