import type { AnyMessage, Message, MethodInfo, PartialMessage, ServiceType } from "@bufbuild/protobuf"; import type { StreamResponse, UnaryResponse } from "./interceptor.js"; /** * Transport represents the underlying transport for a client. * A transport implements a protocol, such as Connect or gRPC-web, and allows * for the concrete clients to be independent of the protocol. */ export interface Transport { /** * Call a unary RPC - a method that takes a single input message, and * responds with a single output message. */ unary = AnyMessage, O extends Message = AnyMessage>(service: ServiceType, method: MethodInfo, signal: AbortSignal | undefined, timeoutMs: number | undefined, header: HeadersInit | undefined, input: PartialMessage): Promise>; /** * Call a streaming RPC - a method that takes zero or more input messages, * and responds with zero or more output messages. */ stream = AnyMessage, O extends Message = AnyMessage>(service: ServiceType, method: MethodInfo, signal: AbortSignal | undefined, timeoutMs: number | undefined, header: HeadersInit | undefined, input: AsyncIterable>): Promise>; }