import type { DocumentSource } from './index.js'; import type { FileParser } from './text.js'; /** Options for `loadGitRepository()`. */ export interface GitLoaderOptions { /** A branch or tag to read. Cloned at that ref; a local repository without it is read as checked out. */ ref?: string; /** File extensions read, lower case with the dot, such as `['.md', '.ts']`. Defaults to every text file. */ extensions?: readonly string[]; /** Skips a path, relative to the repository root with `/` separators. */ ignore?: (path: string) => boolean; /** A parser per extension, as for `loadDirectory()`. Other files load as plain text. */ parsers?: Record; /** Files larger than this are skipped, in bytes. Defaults to 1 MB. */ maxFileBytes?: number; /** The `git` executable. Defaults to `git` on the path. */ git?: string; /** Time allowed for the clone, in milliseconds. Defaults to 2 minutes. */ timeoutMs?: number; /** Application data added to every document. */ metadata?: Record; } /** Raised when `git` fails, with what it printed. */ export declare class GitLoaderError extends Error { /** What `git` wrote to stderr. */ readonly stderr: string; constructor(message: string, /** What `git` wrote to stderr. */ stderr: string); } /** * The files a Git repository tracks, one document each. A remote URL — `https://`, `ssh://`, * `git://`, `file://`, or `user@host:path` — is shallow-cloned into a temporary directory that is * removed afterwards; a local path is read in place. Only tracked files are read, binary files and * files over `maxFileBytes` are skipped, and each document carries the repository and commit in its * metadata, so a citation can link to the exact revision. * * Runs the `git` executable, without a shell, with credential prompts and the `ext::` transport * disabled. A clone keeps the committed line endings, so a commit loads the same on every platform. */ export declare function loadGitRepository(repository: string, options?: GitLoaderOptions): AsyncGenerator;