import type { SpawnOptions } from './spawn';
export interface GitHubFetchOptions {
    token?: string | undefined;
    headers?: Record<string, string> | undefined;
}
export interface GitHubRateLimitError extends Error {
    status: number;
    resetTime?: Date | undefined;
}
/**
 * Get GitHub token from environment variables.
 */
export declare function getGitHubToken(): string | undefined;
/**
 * Fetch data from GitHub API with rate limit handling.
 */
export declare function fetchGitHub<T = unknown>(url: string, options?: GitHubFetchOptions | undefined): Promise<T>;
export interface GitHubRef {
    object: {
        sha: string;
        type: string;
        url: string;
    };
    ref: string;
    url: string;
}
export interface GitHubTag {
    message: string;
    object: {
        sha: string;
        type: string;
        url: string;
    };
    sha: string;
    tag: string;
    tagger?: {
        date: string;
        email: string;
        name: string;
    };
    url: string;
}
export interface GitHubCommit {
    sha: string;
    url: string;
    commit: {
        message: string;
        author: {
            date: string;
            email: string;
            name: string;
        };
    };
}
export interface ResolveRefOptions {
    token?: string | undefined;
}
/**
 * Resolve a git ref (tag, branch, or commit SHA) to its full commit SHA.
 * Results are cached in-memory and on disk (with TTL) to minimize API calls.
 */
export declare function resolveRefToSha(owner: string, repo: string, ref: string, options?: ResolveRefOptions | undefined): Promise<string>;
/**
 * Clear the ref resolution cache (in-memory only).
 */
export declare function clearRefCache(): Promise<void>;
/**
 * Get GitHub token from git config if not in environment.
 * Falls back to checking git config for github.token.
 */
export declare function getGitHubTokenFromGitConfig(options?: SpawnOptions): Promise<string | undefined>;
/**
 * Get GitHub token from all available sources.
 * Checks environment variables first, then git config.
 */
export declare function getGitHubTokenWithFallback(): Promise<string | undefined>;
// GHSA (GitHub Security Advisory) types and utilities.
export interface GhsaDetails {
    ghsaId: string;
    summary: string;
    details: string;
    severity: string;
    aliases: string[];
    publishedAt: string;
    updatedAt: string;
    withdrawnAt: string | null;
    references: Array<{
        url: string;
    }>;
    vulnerabilities: Array<{
        package: {
            ecosystem: string;
            name: string;
        };
        vulnerableVersionRange: string;
        firstPatchedVersion: {
            identifier: string;
        } | null;
    }>;
    cvss: {
        score: number;
        vectorString: string;
    } | null;
    cwes: Array<{
        cweId: string;
        name: string;
        description: string;
    }>;
}
/**
 * Generate GitHub Security Advisory URL from GHSA ID.
 */
export declare function getGhsaUrl(ghsaId: string): string;
/**
 * Fetch GitHub Security Advisory details.
 */
export declare function fetchGhsaDetails(ghsaId: string, options?: GitHubFetchOptions): Promise<GhsaDetails>;
/**
 * Cached fetch for GHSA details.
 */
export declare function cacheFetchGhsa(ghsaId: string, options?: GitHubFetchOptions): Promise<GhsaDetails>;
