/** Result from a completed `jj` subprocess invocation. */
export interface JjCommandResult {
    /** Process exit code reported by `jj`. */
    exitCode: number;
    /** Captured standard output as UTF-8 text. */
    stdout: string;
    /** Captured standard error as UTF-8 text. */
    stderr: string;
}
/** Resolved Jujutsu workspace metadata. */
export interface JjRepository {
    /** Root directory containing the `.jj` workspace metadata. */
    repoRoot: string;
    /** Path to the shared workspace store directory, resolved through `.jj/repo`'s file indirection for non-default workspaces. */
    storeDir: string;
}
/** Options for `jj diff` invocations. */
export interface DiffOptions {
    /** Optional file paths to restrict the diff with `-- <files>`. */
    readonly files?: readonly string[];
    /** Return only changed file names instead of Git-format diff text. */
    readonly nameOnly?: boolean;
    /** Optional abort signal passed to the spawned `jj` process. */
    readonly signal?: AbortSignal;
}
/** Error thrown when a checked `jj` command exits non-zero. */
export declare class JjCommandError extends Error {
    /** Arguments passed after the common `jj --no-pager --color=never` prefix. */
    readonly args: readonly string[];
    /** Captured command result that caused the failure. */
    readonly result: JjCommandResult;
    /** Create an error for a failed checked `jj` command. */
    constructor(args: readonly string[], result: JjCommandResult);
}
/** Run `jj diff --git` for the current workspace commit and return the raw Git-format diff text. */
export declare const diff: ((cwd: string, options?: DiffOptions) => Promise<string>) & {
    /** List changed file paths. */
    changedFiles(cwd: string, options?: Pick<DiffOptions, "files" | "signal">): Promise<string[]>;
};
export declare const repo: {
    /** Clear cached workspace roots. Intended for tests that mutate JJ metadata under an existing path. */
    clearRootCache(): void;
    /** Resolve the current Jujutsu workspace root, or `null` when `cwd` is not in a JJ repository. */
    root(cwd: string): Promise<string | null>;
    /** Full Jujutsu workspace metadata. */
    resolve(cwd: string): Promise<JjRepository | null>;
    /** Check whether `cwd` is inside a Jujutsu repository. */
    is(cwd: string): Promise<boolean>;
};
