import { Options as GotOptions, Response } from 'got';
import { HttpProxyAgent, HttpsProxyAgent } from 'hpagent';
export interface PeerTubeRequestError extends Error {
    statusCode?: number;
    responseBody?: any;
    responseHeaders?: any;
}
declare type PeerTubeRequestOptions = {
    timeout?: number;
    activityPub?: boolean;
    bodyKBLimit?: number;
    httpSignature?: {
        algorithm: string;
        authorizationHeaderName: string;
        keyId: string;
        key: string;
        headers: string[];
    };
    jsonResponse?: boolean;
} & Pick<GotOptions, 'headers' | 'json' | 'method' | 'searchParams'>;
declare const peertubeGot: import("got").Got;
declare function doRequest(url: string, options?: PeerTubeRequestOptions): Promise<Response<string>>;
declare function doJSONRequest<T>(url: string, options?: PeerTubeRequestOptions): Promise<Response<T>>;
declare function doRequestAndSaveToFile(url: string, destPath: string, options?: PeerTubeRequestOptions): Promise<void>;
declare function getAgent(): {
    agent?: undefined;
} | {
    agent: {
        http: HttpProxyAgent;
        https: HttpsProxyAgent;
    };
};
declare function isBinaryResponse(result: Response<any>): boolean;
declare function findLatestRedirection(url: string, options: PeerTubeRequestOptions, iteration?: number): any;
export { PeerTubeRequestOptions, doRequest, doJSONRequest, doRequestAndSaveToFile, isBinaryResponse, getAgent, findLatestRedirection, peertubeGot };
//# sourceMappingURL=requests.d.ts.map