import { HttpAdapterConfigInterface } from "./interfaces"; import { AdapterAbstract, TypeId, TypeJRPCRequestBody, TypeJRPCResponse, TypeMethodParam } from "../../core"; export * from "./interfaces"; /** * HTTP Client Adapter for JSONRPC Client * * * @author Mahsum UREBE * @licence MIT * * @example * // Create adapter for HTTP Connection * const adapter = new HttpAdapter({ * protocol: "http", * hostname: "localhost", * port: 3000, * }); * * @example * // Create adapter for HTTPs Connection * const adapter = new HttpAdapter({ * protocol: "https", * hostname: "foo.bar", * port: 443, * }); */ export declare class HttpAdapter> extends AdapterAbstract { protected readonly url: string; protected readonly config?: HttpAdapterConfigInterface; /** * Fetch config * * @private */ private readonly fetchConfig; constructor(url: string, config?: HttpAdapterConfigInterface); /** * Request to server * * @param {object|object[]} body * * @abstract * @return Promise Returns the smoothed response output. */ request(body: TypeJRPCRequestBody): Promise | TypeJRPCResponse[] | void>; /** * Connect to server * * @return {Promise} Returns a void Promise */ connect(): Promise; /** * Destroy server connection * * @return {Promise} Returns a void Promise */ destroy(): Promise | void; }