///
export = Client;
/**
* @typedef {import('http').Agent} HttpAgent
* @typedef {import('https').Agent} HttpsAgent
*
* @typedef {Object} ClientOptions
* @property {string} [host]
* @property {number} [port]
* @property {string} [protocol]
* @property {Headers|Record} [headers] - Request headers.
* @property {number|string} [timeout] - Amount of time until request should timeout in ms or humand readable. https://www.npmjs.com/package/parse-duration for valid string values.
* @property {string} [apiPath] - Path to the API.
* @property {URL|string|Multiaddr} [url] - Full API URL.
* @property {'POST' | 'GET'} [method]
* @property {object} [ipld]
* @property {any[]} [ipld.formats] - An array of additional [IPLD formats](https://github.com/ipld/interface-ipld-format) to support
* @property {(format: string) => Promise} [ipld.loadFormat] - an async function that takes the name of an [IPLD format](https://github.com/ipld/interface-ipld-format) as a string and should return the implementation of that codec
* @property {HttpAgent|HttpsAgent} [agent] - A [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent) used to control connection persistence and reuse for HTTP clients (only supported in node.js)
*/
declare class Client extends HTTP {
/**
* @param {ClientOptions|URL|Multiaddr|string} [options]
*/
constructor(options?: string | ClientOptions | URL | Multiaddr | undefined);
}
declare namespace Client {
export { errorHandler, HttpAgent, HttpsAgent, ClientOptions };
}
import HTTP = require("ipfs-utils/src/http");
type ClientOptions = {
host?: string | undefined;
port?: number | undefined;
protocol?: string | undefined;
/**
* - Request headers.
*/
headers?: Headers | Record | undefined;
/**
* - Amount of time until request should timeout in ms or humand readable. https://www.npmjs.com/package/parse-duration for valid string values.
*/
timeout?: string | number | undefined;
/**
* - Path to the API.
*/
apiPath?: string | undefined;
/**
* - Full API URL.
*/
url?: string | URL | Multiaddr | undefined;
method?: "POST" | "GET" | undefined;
ipld?: {
/**
* - An array of additional [IPLD formats](https://github.com/ipld/interface-ipld-format) to support
*/
formats?: any[] | undefined;
/**
* - an async function that takes the name of an [IPLD format](https://github.com/ipld/interface-ipld-format) as a string and should return the implementation of that codec
*/
loadFormat?: ((format: string) => Promise) | undefined;
} | undefined;
/**
* - A [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent) used to control connection persistence and reuse for HTTP clients (only supported in node.js)
*/
agent?: http.Agent | https.Agent | undefined;
};
import Multiaddr = require("multiaddr");
declare function errorHandler(response: any): Promise;
type HttpAgent = http.Agent;
type HttpsAgent = https.Agent;
import http = require("http");
import https = require("https");
//# sourceMappingURL=core.d.ts.map