@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
28 lines (27 loc) • 1.06 kB
TypeScript
/// <reference types="node" />
import { Readable, ReadableOptions } from 'stream';
import { Codec } from '../codec/Codec';
import { ClientReadableStream } from '@grpc/grpc-js';
/**
* A stream of objects that are pushed from the server and are readable from
* the client. It it a Readable Node.js stream and wraps the call to gRPC.
*/
export declare class ClientReadableObjectStream<O> extends Readable {
private readonly wrappedStream?;
private readonly deserializedStream?;
private constructor();
static from<O>(wrapped: Error): ClientReadableObjectStream<O>;
static from<T, O>(wrapped: ClientReadableStream<T>, codec: Codec<T, O>, opts?: ReadableOptions): ClientReadableObjectStream<O>;
_read(): void;
/**
* Cancel the ongoing call. Results in the call ending with a CANCELLED status,
* unless it has already ended with some other status.
*/
cancel(): void;
/**
* Get the endpoint this call/stream is connected to.
*
* @returns {string} The URI of the endpoint
*/
getPeer(): string;
}