import { Request, Response, Middleware, HttpHeaderLiteral } from "./"; export declare type Portal = (request: Request) => Promise; /** * Read all response headers from the given XHR instance into a standard * object literal. */ export declare function getAllHeaders(xhr: XMLHttpRequest): HttpHeaderLiteral; /** * Sends the request to the server. This is used by createPortal() after * all middleware has been applied. */ export declare function send(request: Request): Promise; /** * Creates and returns a new "portal" instance for creating HTTP * requests. Each request and response is passed through the * given middleware. */ export declare function createPortal(...middleware: Middleware[]): = Request, Res extends Response = Response>(request: Req) => Promise;