/**
 * io-locks.ts
 *
 * Path constants, lockfile management, and config I/O helpers extracted from
 * unified-config-loader.ts (Phase 1 split — issue #1164).
 *
 * Forward-reference note: loadUnifiedConfigWithLockHeld and
 * writeUnifiedConfigWithLockHeld depend on mergeWithDefaults,
 * validateCompositeVariants, generateYamlHeader, and generateYamlWithComments
 * which still live in unified-config-loader.ts (extracted in later phases).
 * Those are passed as callbacks to avoid a circular import. Once Phases 2–3
 * land in separate modules with no dependency on this file, they can be
 * imported directly.
 */
import type { UnifiedConfig } from '../unified-config-types';
export declare const CONFIG_YAML = "config.yaml";
export declare const CONFIG_JSON = "config.json";
export declare const CONFIG_LOCK = "config.yaml.lock";
/** Lock is stale after this many milliseconds */
export declare const LOCK_STALE_MS = 5000;
export declare const GO_DURATION_SEGMENT: string;
export declare const GO_DURATION_PATTERN: RegExp;
/**
 * Get path to unified config.yaml
 */
export declare function getConfigYamlPath(): string;
/**
 * Get path to legacy config.json
 */
export declare function getConfigJsonPath(): string;
/**
 * Acquire lockfile for config write operations.
 * Returns a lock token if acquired, null if already locked by another process.
 * Cleans up stale locks (older than LOCK_STALE_MS).
 */
export declare function acquireLock(): string | null;
/**
 * Release lockfile after config write operation.
 */
export declare function releaseLock(lockToken: string): void;
/**
 * Check if unified config.yaml exists
 */
export declare function hasUnifiedConfig(): boolean;
/**
 * Check if legacy config.json exists
 */
export declare function hasLegacyConfig(): boolean;
/**
 * Sync sleep helper for lock retry loops.
 * Uses Atomics.wait when available to avoid CPU-intensive busy-wait.
 */
export declare function sleepSync(ms: number): void;
/**
 * Execute a callback while holding the config lock.
 */
export declare function withConfigWriteLock<T>(callback: () => T): T;
/**
 * Load unified config directly from disk while lock is already held.
 * Falls back to empty config when file doesn't exist.
 *
 * Forward-reference: mergeWithDefaults and validateCompositeVariants are
 * passed as callbacks to avoid a circular dependency. They will be imported
 * directly once all phases are complete.
 */
export declare function loadUnifiedConfigWithLockHeld(mergeWithDefaults: (partial: Partial<UnifiedConfig>) => UnifiedConfig, validateCompositeVariants: (config: UnifiedConfig) => void): UnifiedConfig;
/**
 * Write unified config to disk while lock is already held.
 * Uses atomic write (temp file + rename) to prevent corruption.
 *
 * Forward-reference: generateYamlHeader and generateYamlWithComments are
 * passed as callbacks to avoid a circular dependency. They will be imported
 * directly once all phases are complete.
 */
export declare function writeUnifiedConfigWithLockHeld(config: UnifiedConfig, generateYamlHeader: () => string, generateYamlWithComments: (config: UnifiedConfig) => string): void;
//# sourceMappingURL=io-locks.d.ts.map