import { CookieJar } from "tough-cookie"; import { TLSResponse } from "./response"; import { ClientIdentifier, Cookie, CustomTlsClient, DestroyOutput, HttpMethod, RequestOptions, SerializedCookieJar, SessionOptions, TLSClientOptions } from "./types"; export interface FetchOptions extends RequestOptions { client?: TLSClient; session?: Session; } declare function buildForwardPayload(url: string, sessionDefaults: SessionOptions | undefined, requestOptions: RequestOptions, sessionId?: string): Promise<{ requestUrl: string; requestMethod: HttpMethod; requestBody: string | undefined; requestCookies: Cookie[]; tlsClientIdentifier: ClientIdentifier | undefined; customTlsClient: CustomTlsClient | undefined; followRedirects: boolean | undefined; insecureSkipVerify: boolean | undefined; withoutCookieJar: boolean | undefined; withCustomCookieJar: boolean | undefined; withRandomTLSExtensionOrder: boolean | undefined; timeoutSeconds: number | undefined; timeoutMilliseconds: number; sessionId: string | undefined; proxyUrl: string | undefined; isRotatingProxy: boolean | undefined; forceHttp1: boolean | undefined; disableHttp3: boolean | undefined; withProtocolRacing: boolean | undefined; withDebug: boolean | undefined; catchPanics: boolean | undefined; isByteRequest: boolean; isByteResponse: boolean | undefined; disableIPV6: boolean | undefined; disableIPV4: boolean | undefined; certificatePinningHosts: Record; transportOptions: import("./types").TransportOptions | undefined; headers: Record; defaultHeaders: Record | undefined; connectHeaders: Record | undefined; headerOrder: string[] | undefined; localAddress: string | undefined; serverNameOverwrite: string | undefined; requestHostOverride: string | undefined; streamOutputPath: string | undefined; streamOutputBlockSize: number | undefined; streamOutputEOFSymbol: string | undefined; }>; type ForwardPayload = Awaited>; export declare class TLSClient { private readonly options; private startPromise?; private runtime?; constructor(options?: TLSClientOptions); start(): Promise; stop(): Promise; session(options?: SessionOptions): Session; request(url: string, options?: RequestOptions): Promise; getCookies(sessionId: string, url: string): Promise; destroySession(sessionId: string): Promise; destroyAll(): Promise; private startInternal; private waitUntilReady; private getRuntime; forward(payload: ForwardPayload): Promise; private requestJson; } export declare class Session { private readonly client; private readonly defaults; readonly id: string; readonly cookieJar: CookieJar; private closed; private closePromise?; constructor(client: TLSClient, defaults?: SessionOptions); request(url: string, options?: RequestOptions): Promise; get(url: string, options?: RequestOptions): Promise; post(url: string, options?: RequestOptions): Promise; put(url: string, options?: RequestOptions): Promise; patch(url: string, options?: RequestOptions): Promise; delete(url: string, options?: RequestOptions): Promise; head(url: string, options?: RequestOptions): Promise; options(url: string, requestOptions?: RequestOptions): Promise; cookies(url: string): Promise; exportCookies(): Promise; close(): Promise; private assertOpen; } export declare function fetch(url: string, options?: FetchOptions): Promise; export {};