/** * Generate a 12-character hex operation identifier. * * @returns A unique 12-char hex string. */ export declare function generateOpId(): string; /** * Compute a SHA-256 hex digest of the provided content. * * @param content - String content to hash. * @returns Lowercase 64-character hex hash. */ export declare function computeContentHash(content: string): string; /** * Result of a lockedTransform operation. */ export type LockedTransformResult = { changed: boolean; hash: string; opId: string; bytesChanged: number; }; /** * Execute a read-lock-transform-write cycle for a single file. * * 1. Acquires advisory lock via `proper-lockfile` * 2. Reads current file content * 3. Computes content hash (SHA-256) * 4. Optionally checks `expectedHash` for stale-file detection * 5. Calls `transform(currentContent, currentHash)` to get new content * 6. If unchanged → skips write, returns `{ changed: false, hash }` * 7. Writes to temp file → atomic rename to target * 8. Releases lock * 9. Returns `{ changed: true, hash: newHash, opId, bytesChanged }` * * @param filePath - Absolute path to the target file. * @param transform - Transform function receiving current content + hash. * @param options - Optional stale-file detection (`expectedHash`). * @returns Write result with change signal and verification data. */ export declare function lockedTransform(filePath: string, transform: (content: string, currentHash: string) => string | Promise, options?: { expectedHash?: string; }): Promise; /** * Sync variant of lockedTransform for hot-path single-section writes. * * Identical flow but uses sync FS exclusively. No async/await. * Note: lockSync does not support retries — fails immediately if lock held. * * @param filePath - Absolute path to the target file. * @param transform - Transform function receiving current content + hash. * @param options - Optional stale-file detection (`expectedHash`). * @returns Write result with change signal and verification data. */ export declare function lockedTransformSync(filePath: string, transform: (content: string, currentHash: string) => string, options?: { expectedHash?: string; }): LockedTransformResult; //# sourceMappingURL=concurrency.d.ts.map