UNPKG

fauna

Version:

A driver to query Fauna databases in browsers, Node.js, and other Javascript runtimes

26 lines (25 loc) 1.1 kB
import { HTTPClient, HTTPClientOptions, HTTPRequest, HTTPResponse, HTTPStreamClient, HTTPStreamRequest, StreamAdapter } from "./http-client"; import { QueryRequest } from "../wire-protocol"; /** * An implementation for {@link HTTPClient} that uses the node http package */ export declare class NodeHTTP2Client implements HTTPClient, HTTPStreamClient { #private; private constructor(); /** * Gets a {@link NodeHTTP2Client} matching the {@link HTTPClientOptions} * @param httpClientOptions - the {@link HTTPClientOptions} * @returns a {@link NodeHTTP2Client} matching the {@link HTTPClientOptions} */ static getClient(httpClientOptions: HTTPClientOptions): NodeHTTP2Client; /** {@inheritDoc HTTPClient.request} */ request<T = QueryRequest>(req: HTTPRequest<T>): Promise<HTTPResponse>; /** {@inheritDoc HTTPStreamClient.stream} */ stream(req: HTTPStreamRequest): StreamAdapter; /** {@inheritDoc HTTPClient.close} */ close(): void; /** * @returns true if this client has been closed, false otherwise. */ isClosed(): boolean; }