/**
 * Shared helpers for the `setup-branch-protection` and `setup-prebuild`
 * CLI subcommands. Both wrap GitHub API calls behind `gh api` for the
 * common path, with consistent detection / error messaging / repo
 * resolution. Co-locating the shared surface keeps the two subcommand
 * modules focused on payload construction.
 */
export interface OwnerRepo {
    owner: string;
    repo: string;
}
export declare class GhError extends Error {
    readonly httpStatus?: number;
    readonly suggestion?: string;
    constructor(message: string, opts?: {
        httpStatus?: number;
        suggestion?: string;
    });
}
/**
 * Returns true if `gh` is on PATH and authenticated.
 *
 * Both setup-branch-protection and setup-prebuild require the gh CLI
 * (we don't ship an octokit-based fallback in 2.5.2 — keeps the
 * dependency surface narrow). Future octokit fallback would slot in
 * here without changing callers.
 */
export declare function ghCliAvailable(): boolean;
/**
 * Resolve the owner+repo of the current git working tree using
 * `gh repo view --json owner,name`. Requires gh to be authenticated
 * AND the repo to have a github.com remote configured (gh respects
 * the same git-remote conventions).
 *
 * Throws GhError with actionable suggestion on every failure path so
 * the callers can render a clean error to the customer.
 */
export declare function resolveOwnerRepo(cwd: string): OwnerRepo;
/**
 * Resolve the repo's default branch via `gh repo view --json
 * defaultBranchRef`. Used as the default `--branch` when the customer
 * doesn't pass one explicitly — most repos use `main` but legacy
 * repos may still default to `master` etc.
 */
export declare function resolveDefaultBranch(cwd: string): string;
/**
 * Call `gh api` with the given args and return the parsed JSON body.
 * Throws GhError with the parsed HTTP status when the call fails so
 * callers can branch on 403 / 404 / 422 specifically.
 *
 * `args` should NOT include the `-X METHOD` flag — pass it via
 * `opts.method`. The endpoint is added at the end.
 */
export declare function ghApi(endpoint: string, opts: {
    cwd: string;
    method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
    inputJson?: string;
    extraArgs?: string[];
}): unknown;
/**
 * Render a GhError to the customer. Returns the exit code the CLI
 * should use (always 1 for now, but kept as a separate return for
 * future "warn but don't fail" cases).
 */
export declare function renderGhError(err: GhError, context: string): number;
/**
 * Pre-flight check shared by both setup commands. Verifies gh CLI is
 * available + authenticated. Renders the manual-fallback instructions
 * if gh is missing rather than throwing — keeps the customer's
 * troubleshooting path consistent.
 *
 * Returns true if pre-flight passes; false (with rendered error) if not.
 */
export declare function preflightGhCli(commandName: string): boolean;
//# sourceMappingURL=setup-gh.d.ts.map