/**
 * Source Request Builder
 *
 * Fluent builder for constructing HTTP requests with consistent
 * headers, authentication, and timeout handling.
 *
 * @since v1.37.0
 */
import type { ZodSchema } from 'zod';
/**
 * Authentication type for requests
 */
export type AuthType = 'bearer' | 'api-key' | 'basic';
/**
 * Request builder options
 */
export interface RequestBuilderOptions {
    /** Base URL for all requests */
    baseUrl?: string;
    /** Default timeout in milliseconds */
    timeout?: number;
    /** Default User-Agent header */
    userAgent?: string;
    /** Source name for error context */
    sourceName?: string;
}
/**
 * Request options for individual requests
 */
export interface RequestOptions {
    /** Request headers */
    headers?: Record<string, string>;
    /** Request timeout in milliseconds */
    timeout?: number;
    /** Request body (for POST/PUT) */
    body?: unknown;
    /** HTTP method */
    method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
}
/**
 * Fluent request builder for source API calls
 *
 * @example
 * ```typescript
 * const builder = new SourceRequestBuilder({
 *   baseUrl: 'https://api.modrinth.com/v2',
 *   userAgent: 'Pluginator/1.0',
 * });
 *
 * const data = await builder
 *   .withAuth('bearer', token)
 *   .get('/project/sodium', ProjectSchema);
 * ```
 */
export declare class SourceRequestBuilder {
    private baseUrl;
    private timeout;
    private userAgent;
    private sourceName;
    private headers;
    constructor(options?: RequestBuilderOptions);
    /**
     * Clone the builder with current settings
     */
    clone(): SourceRequestBuilder;
    /**
     * Set authentication header
     */
    withAuth(type: AuthType, credentials: string, keyHeader?: string): this;
    /**
     * Set custom User-Agent
     */
    withUserAgent(userAgent: string): this;
    /**
     * Set request timeout
     */
    withTimeout(ms: number): this;
    /**
     * Set base URL
     */
    withBaseUrl(baseUrl: string): this;
    /**
     * Set source name for error context
     */
    withSourceName(name: string): this;
    /**
     * Add custom header
     */
    withHeader(key: string, value: string): this;
    /**
     * Add multiple headers
     */
    withHeaders(headers: Record<string, string>): this;
    /**
     * Build the full URL
     */
    private buildUrl;
    /**
     * Execute a fetch request with error handling
     */
    private fetchWithErrorHandling;
    /**
     * Make a GET request
     *
     * @param path - URL path (will be appended to baseUrl)
     * @param schema - Optional Zod schema for response validation
     */
    get<T>(path: string, schema?: ZodSchema<T>): Promise<T>;
    /**
     * Make a POST request
     */
    post<T>(path: string, body?: unknown, schema?: ZodSchema<T>): Promise<T>;
    /**
     * Make a raw request without JSON parsing (for binary data)
     */
    getRaw(path: string): Promise<Response>;
    /**
     * Make a HEAD request (useful for checking if a resource exists)
     */
    head(path: string): Promise<Response>;
}
/**
 * Create a pre-configured request builder for a specific source
 */
export declare function createSourceRequestBuilder(sourceName: string, options?: Omit<RequestBuilderOptions, 'sourceName'>): SourceRequestBuilder;
//# sourceMappingURL=request-builder.d.ts.map