import { URL, UrlObject } from 'url' import { Duplex } from 'stream' import Dispatcher from './dispatcher' /** Performs an HTTP request. */ declare function request ( url: string | URL | UrlObject, options?: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path' | 'method'> & Partial>, ): Promise> /** A faster version of `request`. */ declare function stream ( url: string | URL | UrlObject, options: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path'>, factory: Dispatcher.StreamFactory ): Promise> /** For easy use with `stream.pipeline`. */ declare function pipeline ( url: string | URL | UrlObject, options: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path'>, handler: Dispatcher.PipelineHandler ): Duplex /** Starts two-way communications with the requested resource. */ declare function connect ( url: string | URL | UrlObject, options?: { dispatcher?: Dispatcher } & Omit, 'origin' | 'path'> ): Promise> /** Upgrade to a different protocol. */ declare function upgrade ( url: string | URL | UrlObject, options?: { dispatcher?: Dispatcher } & Omit ): Promise export { request, stream, pipeline, connect, upgrade }