nats
Version:
Node.js client for NATS, a lightweight, high-performance cloud native messaging system
54 lines (53 loc) • 1.92 kB
TypeScript
import { ConsumerConfig, ConsumerOpts, ConsumerOptsBuilder, JsMsgCallback } from "./types";
export declare function consumerOpts(opts?: Partial<ConsumerConfig>): ConsumerOptsBuilder;
export declare class ConsumerOptsBuilderImpl implements ConsumerOptsBuilder {
config: Partial<ConsumerConfig>;
ordered: boolean;
mack: boolean;
stream: string;
callbackFn?: JsMsgCallback;
max?: number;
qname?: string;
isBind?: boolean;
constructor(opts?: Partial<ConsumerConfig>);
getOpts(): ConsumerOpts;
description(description: string): this;
deliverTo(subject: string): this;
durable(name: string): this;
startSequence(seq: number): this;
startTime(time: Date): this;
deliverAll(): this;
deliverLastPerSubject(): this;
deliverLast(): this;
deliverNew(): this;
startAtTimeDelta(millis: number): this;
headersOnly(): this;
ackNone(): this;
ackAll(): this;
ackExplicit(): this;
ackWait(millis: number): this;
maxDeliver(max: number): this;
filterSubject(s: string): this;
replayInstantly(): this;
replayOriginal(): this;
sample(n: number): this;
limit(n: number): this;
maxWaiting(max: number): this;
maxAckPending(max: number): this;
idleHeartbeat(millis: number): this;
flowControl(): this;
deliverGroup(name: string): this;
manualAck(): this;
maxMessages(max: number): this;
callback(fn: JsMsgCallback): this;
queue(n: string): this;
orderedConsumer(): this;
bind(stream: string, durable: string): this;
bindStream(stream: string): this;
inactiveEphemeralThreshold(millis: number): this;
maxPullBatch(n: number): this;
maxPullRequestExpires(millis: number): this;
memory(): this;
numReplicas(n: number): this;
}
export declare function isConsumerOptsBuilder(o: ConsumerOptsBuilder | Partial<ConsumerOpts>): o is ConsumerOptsBuilderImpl;