/** Normalized package metadata returned by any registry. */ export interface Package { name: string; description: string; homepage: string; documentation: string; repository: string; licenses: string; keywords: string[]; namespace: string; latestVersion: string; metadata: Record; } /** A single version entry of a package. */ export interface Version { number: string; publishedAt: Date | null; licenses: string; integrity: string; status: VersionStatus; metadata: Record; } /** Dependency of a package version. */ export interface Dependency { name: string; requirements: string; scope: Scope; optional: boolean; } /** Maintainer / author of a package. */ export interface Maintainer { uuid: string; login: string; name: string; email: string; url: string; role: string; } export type VersionStatus = "" | "yanked" | "deprecated" | "retracted"; export type Scope = "runtime" | "development" | "test" | "build" | "optional"; /** URL builder for a specific registry. */ export interface URLBuilder { registry(name: string, version?: string): string; download(name: string, version: string): string; documentation(name: string, version?: string): string; readme(name: string, version?: string): string; purl(name: string, version?: string): string; } /** Options for the HTTP client. */ export interface ClientOptions { maxRetries?: number; baseDelay?: number; timeout?: number; rateLimiter?: RateLimiter; userAgent?: string; } /** Rate limiter interface — bring your own implementation. */ export interface RateLimiter { wait(signal?: AbortSignal): Promise; } /** Parsed PURL components. */ export interface ParsedPURL { type: string; namespace: string; name: string; version: string; qualifiers: Record; subpath: string; } /** HTTP client with retry, backoff, rate limiting, and timeout. */ export declare class Client { readonly maxRetries: number; readonly baseDelay: number; readonly timeout: number; readonly userAgent: string; private readonly rateLimiter; constructor(options?: ClientOptions); /** * Fetch JSON with retry and rate limiting. * * @param url - Request URL. * @param signal - Optional cancellation signal. * @param headers - Optional request headers. * @returns {Promise} The decoded response body. */ getJSON(url: string, signal?: AbortSignal, headers?: Readonly>): Promise; /** * One request under a fresh timeout. Failures come back as data, so the loop picks what's next. * * @param url - Request URL. * @param signal - Optional cancellation signal. * @param headers - Optional request headers. * @returns {Promise} The decoded body or the failure. */ private attempt; private canRetry; /** * Exponential backoff with up to 10% jitter, stretched to a longer Retry-After. * * @param attempt - Zero-based index of the attempt that just failed. * @param url - Request URL, for the error when Retry-After is unschedulable. * @param failure - The failed attempt. * @returns {number} Milliseconds to wait before the next attempt. */ private retryDelay; /** * Default headers, each replaced by a caller header of the same name in any letter case. * * @param overrides - Optional request headers. * @returns {Headers} The headers for one request. */ private requestHeaders; private attemptSignal; } /** * Get or create the shared HTTP client. * * @returns {Client} The shared client. */ export declare function defaultClient(): Client; //# sourceMappingURL=client.d.mts.map