/**
 * Windows + WSL sharing one index on a Windows drive (issue #995).
 *
 * A repo under `/mnt/<drive>/` can be used from both sides: Windows-native
 * CodeGraph and WSL CodeGraph then open the same `.codegraph/codegraph.db`
 * across the 9p/DrvFs bridge, where SQLite's file locking and its `-shm`
 * shared memory don't hold between the two OSes. WSL's connection fails with a
 * bare "disk I/O error" (SQLITE_IOERR). A private WSL index on the same drive
 * works fine, so a fresh WSL project there already gets its own
 * `.codegraph-wsl` (`codeGraphDirNameFor`). An index already in `.codegraph` —
 * built by Windows first, or by WSL before that default — is kept as it is,
 * and when it fails this way the SQLite adapter rewrites the error into the
 * `CODEGRAPH_DIR=.codegraph-wsl` instruction instead of letting it reach the
 * user as an unexplained I/O failure.
 */
/**
 * Is `err` a SQLite I/O error? node:sqlite reports the EXTENDED result code on
 * `errcode` (SQLITE_IOERR_LOCK = 3850, SQLITE_IOERR_SHMMAP = 5130, ...), whose
 * low byte is the primary code. An error without one (re-wrapped somewhere
 * along the way) is matched by SQLite's message for the whole family.
 */
export declare function isSqliteIoError(err: unknown): boolean;
/**
 * A SQLite I/O error on an index that Windows CodeGraph most likely shares.
 * Keeps the original as `cause` and carries its SQLite codes, so a caller that
 * branches on them sees the same values as before the rewrite.
 */
export declare class WslSharedIndexError extends Error {
    readonly code: unknown;
    readonly errcode: unknown;
    readonly errstr: unknown;
    constructor(original: Error, dataDir: string);
}
/**
 * Inputs that can be overridden in tests so the decision is deterministic
 * without touching `/proc/version` (see `WatchProbe`).
 */
export interface WslSharedIndexProbe {
    /** Defaults to `detectWsl()` (through `isWslWindowsDrive`). */
    isWsl?: boolean;
}
/**
 * The error to throw in place of `err`: a {@link WslSharedIndexError} when a
 * SQLite I/O error hit the default-named index of a project on a Windows drive
 * under WSL, else `null` (throw `err` unchanged).
 *
 * Only the default `.codegraph` counts: it is the directory Windows CodeGraph
 * opens too. A WSL that already has its own directory (`.codegraph-wsl`, or
 * any `CODEGRAPH_DIR`) hit some other I/O failure, and pointing it at
 * `CODEGRAPH_DIR` would mislead.
 */
export declare function toWslSharedIndexError(err: unknown, dbPath: string, probe?: WslSharedIndexProbe): WslSharedIndexError | null;
//# sourceMappingURL=wsl-shared-index.d.ts.map