@cerbos/http
Version:
Client library for interacting with the Cerbos policy decision point service over HTTP from browser-based applications
13 lines • 1.03 kB
TypeScript
import type { ReadableStream } from "stream/web";
import type { DescMessage, DescMethodServerStreaming, DescMethodUnary, MessageShape, MessageValidType } from "@bufbuild/protobuf";
import type { AbortHandler, Transport as CoreTransport } from "@cerbos/core/~internal";
export declare class Transport implements CoreTransport {
private readonly baseUrl;
private readonly userAgent;
constructor(baseUrl: string, userAgent: string);
unary<I extends DescMessage, O extends DescMessage>(method: DescMethodUnary<I, O>, request: MessageValidType<I>, headers: Headers, abortHandler: AbortHandler): Promise<MessageShape<O>>;
serverStream<I extends DescMessage, O extends DescMessage>(method: DescMethodServerStreaming<I, O>, request: MessageValidType<I>, headers: Headers, abortHandler: AbortHandler): AsyncGenerator<MessageShape<O>, void, undefined>;
private fetch;
}
export declare function eachLine(stream: ReadableStream<Uint8Array>): AsyncGenerator<string, void, undefined>;
//# sourceMappingURL=transport.d.ts.map