/**
 * Lock helper — thin wrapper around `proper-lockfile` providing a
 * single `withLock(filePath, fn)` entry point used by every shared-state
 * write in the framework.
 *
 * Guarantees:
 * - Mutual exclusion across processes, including across git worktrees that
 *   share the same `.aperant/` directory (lock is taken on the target
 *   file path itself).
 * - Stale-lock recovery via `proper-lockfile`'s `stale` option (default 5s).
 * - Structured timeout error emitted to `.aperant/events/` so Pre-mortem #1
 *   monitoring can catch sustained contention.
 *
 * Callers pass the path to the shared JSON/Markdown file (NOT a `.lock`
 * sidecar). `proper-lockfile` manages the sidecar internally.
 */
export interface WithLockOptions {
    /** Milliseconds before the lock is considered stale. Default 5000. */
    stale?: number;
    /** Total retry attempts when the lock is held. Default 20. */
    retries?: number;
    /** Base delay between retries in ms. Default 50. */
    retryDelayMs?: number;
    /** Maximum retry delay in ms. Default 500. */
    maxRetryDelayMs?: number;
    /**
     * Project root (optional). If provided and the lock times out, a
     * structured event is written to `{projectRoot}/.aperant/events/`.
     */
    projectRoot?: string;
    /** Override the realpath requirement (for paths that may not exist yet). */
    realpath?: boolean;
}
/**
 * Acquire an exclusive lock on `filePath`, run `fn`, then release.
 *
 * The target file does not need to exist — `proper-lockfile` is configured
 * with `realpath: false` by default so we can lock paths the caller is
 * about to create. `fn` is awaited if it returns a promise.
 */
export declare function withLock<T>(filePath: string, fn: () => T | Promise<T>, options?: WithLockOptions): Promise<T>;
export declare class LockTimeoutError extends Error {
    readonly code = "E_LOCK_TIMEOUT";
    readonly target: string;
    readonly cause: Error;
    constructor(target: string, cause: Error);
}
//# sourceMappingURL=lock.d.ts.map