/**
 * Generic Git forge abstraction — GitHub, GitLab, Gitea, Azure DevOps, Bitbucket.
 *
 * Each forge implements the same interface so PR creation, auth checks,
 * and status queries work uniformly regardless of hosting provider.
 */
import { type GitRemoteProvider, type ParsedRemote } from "./git.js";
export type { GitRemoteProvider, ParsedRemote };
export interface ForgeAuthResult {
    authenticated: boolean;
    username?: string;
    error?: string;
}
export interface ForgePrInput {
    title: string;
    baseBranch: string;
    headBranch: string;
    body: string;
}
export interface ForgePrResult {
    status: "created" | "opened_existing" | "not_found";
    url?: string;
    number?: number;
    baseBranch?: string;
    headBranch?: string;
    title?: string;
    state?: "open" | "closed" | "merged";
}
export interface ForgePrCheck {
    name: string;
    state: string;
    conclusion: string;
    startedAt: string;
    completedAt: string;
    detailsUrl: string;
}
export interface GitForge {
    readonly provider: GitRemoteProvider;
    readonly displayName: string;
    checkCliAvailable(cwd: string): Promise<boolean>;
    checkAuth(cwd: string): Promise<ForgeAuthResult>;
    loginWithToken(token: string, cwd: string): Promise<ForgeAuthResult>;
    resolveToken(cwd: string): Promise<string | null>;
    getDefaultBranch(cwd: string, remote: ParsedRemote): Promise<string | null>;
    findExistingPr(cwd: string, remote: ParsedRemote, headBranch: string, token?: string): Promise<ForgePrResult | null>;
    createPr(cwd: string, remote: ParsedRemote, input: ForgePrInput, token?: string): Promise<ForgePrResult>;
    getPrChecks(cwd: string, headBranch: string): Promise<ForgePrCheck[]>;
    buildCreatePrUrl(remote: ParsedRemote, headBranch: string, baseBranch?: string): string | null;
}
export declare class GitHubForge implements GitForge {
    readonly provider: "github";
    readonly displayName = "GitHub";
    checkCliAvailable(cwd: string): Promise<boolean>;
    checkAuth(cwd: string): Promise<ForgeAuthResult>;
    loginWithToken(token: string, cwd: string): Promise<ForgeAuthResult>;
    resolveToken(_cwd: string): Promise<string | null>;
    getDefaultBranch(cwd: string, _remote: ParsedRemote): Promise<string | null>;
    findExistingPr(cwd: string, remote: ParsedRemote, headBranch: string, token?: string): Promise<ForgePrResult | null>;
    createPr(cwd: string, remote: ParsedRemote, input: ForgePrInput, token?: string): Promise<ForgePrResult>;
    getPrChecks(cwd: string, _headBranch: string): Promise<ForgePrCheck[]>;
    buildCreatePrUrl(remote: ParsedRemote, headBranch: string, _baseBranch?: string): string | null;
    private createPrViaCli;
    private createPrViaApi;
    private findPrViaApi;
}
export declare class GitLabForge implements GitForge {
    readonly provider: "gitlab";
    readonly displayName = "GitLab";
    checkCliAvailable(cwd: string): Promise<boolean>;
    checkAuth(cwd: string): Promise<ForgeAuthResult>;
    loginWithToken(token: string, cwd: string): Promise<ForgeAuthResult>;
    resolveToken(_cwd: string): Promise<string | null>;
    getDefaultBranch(_cwd: string, remote: ParsedRemote): Promise<string | null>;
    findExistingPr(_cwd: string, remote: ParsedRemote, headBranch: string, token?: string): Promise<ForgePrResult | null>;
    createPr(_cwd: string, remote: ParsedRemote, input: ForgePrInput, token?: string): Promise<ForgePrResult>;
    getPrChecks(_cwd: string, _headBranch: string): Promise<ForgePrCheck[]>;
    buildCreatePrUrl(remote: ParsedRemote, headBranch: string, _baseBranch?: string): string | null;
}
export declare class GiteaForge implements GitForge {
    readonly provider: "gitea";
    readonly displayName = "Gitea";
    checkCliAvailable(cwd: string): Promise<boolean>;
    checkAuth(_cwd: string): Promise<ForgeAuthResult>;
    loginWithToken(_token: string, _cwd: string): Promise<ForgeAuthResult>;
    resolveToken(_cwd: string): Promise<string | null>;
    getDefaultBranch(_cwd: string, remote: ParsedRemote): Promise<string | null>;
    findExistingPr(_cwd: string, remote: ParsedRemote, headBranch: string, token?: string): Promise<ForgePrResult | null>;
    createPr(_cwd: string, remote: ParsedRemote, input: ForgePrInput, token?: string): Promise<ForgePrResult>;
    getPrChecks(_cwd: string, _headBranch: string): Promise<ForgePrCheck[]>;
    buildCreatePrUrl(remote: ParsedRemote, headBranch: string, baseBranch?: string): string | null;
}
export declare class AzureDevOpsForge implements GitForge {
    readonly provider: "azure-devops";
    readonly displayName = "Azure DevOps";
    checkCliAvailable(cwd: string): Promise<boolean>;
    checkAuth(cwd: string): Promise<ForgeAuthResult>;
    loginWithToken(_token: string, _cwd: string): Promise<ForgeAuthResult>;
    resolveToken(_cwd: string): Promise<string | null>;
    getDefaultBranch(_cwd: string, _remote: ParsedRemote): Promise<string | null>;
    findExistingPr(cwd: string, remote: ParsedRemote, headBranch: string, _token?: string): Promise<ForgePrResult | null>;
    createPr(cwd: string, remote: ParsedRemote, input: ForgePrInput, _token?: string): Promise<ForgePrResult>;
    getPrChecks(_cwd: string, _headBranch: string): Promise<ForgePrCheck[]>;
    buildCreatePrUrl(remote: ParsedRemote, headBranch: string, baseBranch?: string): string | null;
    private buildOrgUrl;
    private buildRepoUrl;
    private buildPrUrl;
}
export declare class BitbucketForge implements GitForge {
    readonly provider: "bitbucket";
    readonly displayName = "Bitbucket";
    checkCliAvailable(_cwd: string): Promise<boolean>;
    checkAuth(_cwd: string): Promise<ForgeAuthResult>;
    loginWithToken(_token: string, _cwd: string): Promise<ForgeAuthResult>;
    resolveToken(_cwd: string): Promise<string | null>;
    getDefaultBranch(_cwd: string, remote: ParsedRemote): Promise<string | null>;
    findExistingPr(_cwd: string, remote: ParsedRemote, headBranch: string, token?: string): Promise<ForgePrResult | null>;
    createPr(_cwd: string, remote: ParsedRemote, input: ForgePrInput, token?: string): Promise<ForgePrResult>;
    getPrChecks(_cwd: string, _headBranch: string): Promise<ForgePrCheck[]>;
    buildCreatePrUrl(remote: ParsedRemote, headBranch: string, _baseBranch?: string): string | null;
}
export declare function getForge(provider: GitRemoteProvider): GitForge | null;
export declare function getForgeForRemote(remoteUrl: string | null): GitForge | null;
//# sourceMappingURL=git-forge.d.ts.map