export type GithubDiffLineSide = "old" | "new" | "context";
export type GithubDiffLineKind = "context" | "add" | "del";
export interface GithubDiffLine {
    id: string;
    side: GithubDiffLineSide;
    oldLine?: number;
    newLine?: number;
    text: string;
    kind: GithubDiffLineKind;
}
export interface GithubDiffHunk {
    id: string;
    header: string;
    lines: GithubDiffLine[];
}
export type GithubWalkthroughFileStatus = "added" | "modified" | "deleted" | "renamed" | "copied" | "binary";
export interface GithubDiffBlock {
    id: string;
    filePath: string;
    oldPath?: string;
    status?: GithubWalkthroughFileStatus;
    isBinary?: boolean;
    isGenerated?: boolean;
    isTruncated?: boolean;
    hunks: GithubDiffHunk[];
    externalUrl?: string;
    blobUrl?: string;
    rawUrl?: string;
    contentsUrl?: string;
}
export interface GithubWalkthroughChangesetRef {
    baseSha: string;
    headSha: string;
    provider: "github";
    externalUrl: string;
    prUrl: string;
    prNumber: number;
    prTitle: string;
    prBody?: string;
    title: string;
    filesChanged?: number;
    additions?: number;
    deletions?: number;
    owner: string;
    repo: string;
}
export interface GithubWalkthroughFile {
    filePath: string;
    oldPath?: string;
    status: GithubWalkthroughFileStatus;
    additions: number;
    deletions: number;
    changes: number;
    patch?: string;
    blobUrl?: string;
    rawUrl?: string;
    contentsUrl?: string;
    isBinary?: boolean;
    isGenerated?: boolean;
    isTruncated?: boolean;
    warnings?: GithubWalkthroughWarning[];
    diffBlocks: GithubDiffBlock[];
}
export interface GithubWalkthroughWarning {
    code: string;
    severity: "info" | "warning" | "error";
    message: string;
    filePath?: string;
}
export interface GithubWalkthroughExportCapability {
    provider: "github";
    available: boolean;
    owner: string;
    repo: string;
    prNumber: number;
    url: string;
    reason?: string;
}
export interface GithubResolvedPr {
    changesetId: string;
    changeset: GithubWalkthroughChangesetRef;
    files: GithubWalkthroughFile[];
    warnings: GithubWalkthroughWarning[];
    export: GithubWalkthroughExportCapability;
    provider: {
        name: "github";
        owner: string;
        repo: string;
        prNumber: number;
        prUrl: string;
        apiUrl: string;
        baseSha: string;
        headSha: string;
    };
}
export interface ResolveGithubPrOptions {
    cwd?: string;
    prUrl?: string;
    prNumber?: string | number;
    token?: string;
    fetch?: FetchLike;
    apiBaseUrl?: string;
    maxFiles?: number;
    maxPatchBytes?: number;
    maxLinesPerFile?: number;
    trustedHosts?: string[];
}
export interface ParsedGithubPrReference {
    owner?: string;
    repo?: string;
    number?: number;
    host?: string;
    url?: string;
}
interface FetchHeadersLike {
    get(name: string): string | null;
}
interface FetchResponseLike {
    ok: boolean;
    status: number;
    statusText: string;
    headers: FetchHeadersLike;
    json(): Promise<unknown>;
    text(): Promise<string>;
}
type FetchLike = (url: string, init?: {
    method?: string;
    headers?: Record<string, string>;
    body?: string;
    signal?: AbortSignal;
}) => Promise<FetchResponseLike>;
export declare class GithubPrAdapterError extends Error {
    readonly status: number;
    readonly code: string;
    readonly warnings: GithubWalkthroughWarning[];
    readonly host?: string;
    constructor(message: string, options?: {
        status?: number;
        code?: string;
        warnings?: GithubWalkthroughWarning[];
        host?: string;
    });
}
export declare function parseGithubPrReference(input: {
    prUrl?: string;
    prNumber?: string | number;
}, trustedHosts?: string[]): ParsedGithubPrReference;
export declare function parseGithubRemoteUrl(remoteUrl: string): {
    owner: string;
    repo: string;
    host: string;
} | null;
export declare function resolveGithubPr(options: ResolveGithubPrOptions): Promise<GithubResolvedPr>;
declare function changesetIdForGithub(host: string, owner: string, repo: string, number: number, headSha?: string): string;
export declare const changesetIdForGithubForTesting: typeof changesetIdForGithub;
export {};
//# sourceMappingURL=github-adapter.d.ts.map