/// /// /// import type { CommonTransportOptions, UniversalClientFn } from "@bufbuild/connect/protocol"; import type { NodeHttp2ClientSessionManager } from "./node-universal-client.js"; import type { Http2SessionOptions } from "./http2-session-manager.js"; import * as http2 from "http2"; import * as http from "http"; import * as https from "https"; export type DeprecatedNodeTransportOptions = { /** * @deprecated use the Http2SessionManager instead for fine-grained control over sessions and keep-alive * * By default, HTTP/2 sessions are terminated after each request. * Set this option to true to keep sessions alive across multiple * requests. */ keepSessionAlive?: boolean; }; /** * Options specific to Node.js client transports. */ export type NodeTransportOptions = { httpVersion: "1.1"; /** * Options passed to the request() call of the Node.js built-in * http or https module. */ nodeOptions?: Omit | Omit; } | ({ httpVersion: "2"; /** * A manager for the HTTP/2 connection of the transport. * * Providing this option makes nodeOptions as well as the HTTP/2 session * options (pingIntervalMs et cetera) ineffective. */ sessionManager?: NodeHttp2ClientSessionManager; /** * Options passed to the connect() call of the Node.js built-in * http2 module. */ nodeOptions?: http2.ClientSessionOptions | http2.SecureClientSessionOptions; } & Http2SessionOptions); /** * Asserts that the options are within sane limits, and returns default values * where no value is provided. * * @private Internal code, does not follow semantic versioning. */ export declare function validateNodeTransportOptions(options: NodeTransportOptions & Partial> & Pick): { readMaxBytes: number; writeMaxBytes: number; compressMinBytes: number; httpClient: UniversalClientFn; useBinaryFormat: boolean; interceptors: import("@bufbuild/connect").Interceptor[]; sendCompression: import("@bufbuild/connect/protocol").Compression | null; acceptCompression: import("@bufbuild/connect/protocol").Compression[]; httpVersion: "1.1"; /** * Options passed to the request() call of the Node.js built-in * http or https module. */ nodeOptions?: Omit | Omit | undefined; jsonOptions?: Partial | undefined; binaryOptions?: Partial | undefined; useHttpGet?: boolean | undefined; baseUrl: string; } | { readMaxBytes: number; writeMaxBytes: number; compressMinBytes: number; httpClient: UniversalClientFn; useBinaryFormat: boolean; interceptors: import("@bufbuild/connect").Interceptor[]; sendCompression: import("@bufbuild/connect/protocol").Compression | null; acceptCompression: import("@bufbuild/connect/protocol").Compression[]; httpVersion: "2"; /** * A manager for the HTTP/2 connection of the transport. * * Providing this option makes nodeOptions as well as the HTTP/2 session * options (pingIntervalMs et cetera) ineffective. */ sessionManager?: NodeHttp2ClientSessionManager | undefined; /** * Options passed to the connect() call of the Node.js built-in * http2 module. */ nodeOptions?: http2.ClientSessionOptions | http2.SecureClientSessionOptions | undefined; pingIntervalMs?: number | undefined; pingIdleConnection?: boolean | undefined; pingTimeoutMs?: number | undefined; idleConnectionTimeoutMs?: number | undefined; jsonOptions?: Partial | undefined; binaryOptions?: Partial | undefined; useHttpGet?: boolean | undefined; baseUrl: string; };