///
import https from 'node:https';
import { RequestInit, Response } from 'node-fetch';
import { HTTPMethod } from '../../shared/types/http';
import { NetworkProtocol } from './network-adapter-utils/types';
/**
* The options to init NetworkAdapter
*/
export interface NetworkAdapterOptions {
protocols: NetworkProtocol[];
allowLocalhost: boolean;
httpProxy?: string;
caCertPath?: string;
}
/**
* The type for fetchOptions to perform the NetworkAdapter.fetch call.
* It is a subset type of FetchOptionsParam for NetworkAdapter.fetch.
*
* The type is normally used for the result of converted request inputs from
* different shapes, e.g. LoadDataOptions, FetchRequestOptions.
*/
export interface NetworkAdapterFetchOptions {
method: Extract;
headers?: Record;
body?: string;
}
/**
* The type for options parameter of NetworkAdapter.fetch
*/
type FetchOptionsParam = Pick;
export declare class NetworkAdapter {
private readonly httpsAgent;
private readonly ruleEngine;
constructor(options: NetworkAdapterOptions);
fetch(url: string, options: FetchOptionsParam): Promise;
}
type HttpsAgentConfig = Pick;
export declare function createHttpsAgent(options: HttpsAgentConfig): https.Agent | undefined;
export {};