UNPKG

nats

Version:

Node.js client for NATS, a lightweight, high-performance cloud native messaging system

30 lines (29 loc) 1.56 kB
import { JetStreamOptions, KvStatus, Lister, MsgRequest, NatsConnection, ObjectStoreStatus, PurgeOpts, PurgeResponse, StoredMsg, StreamAPI, StreamConfig, StreamInfo, StreamInfoRequestOptions, StreamMsgResponse, StreamSource, StreamUpdateConfig } from "./types"; import { BaseApiClient } from "./jsbaseclient_api"; import { MsgHdrs } from "./headers"; export declare function convertStreamSourceDomain(s?: StreamSource): StreamSource; export declare class StreamAPIImpl extends BaseApiClient implements StreamAPI { constructor(nc: NatsConnection, opts?: JetStreamOptions); add(cfg?: Partial<StreamConfig>): Promise<StreamInfo>; delete(stream: string): Promise<boolean>; update(name: string, cfg?: Partial<StreamUpdateConfig>): Promise<StreamInfo>; info(name: string, data?: Partial<StreamInfoRequestOptions>): Promise<StreamInfo>; list(subject?: string): Lister<StreamInfo>; _fixInfo(si: StreamInfo): void; purge(name: string, opts?: PurgeOpts): Promise<PurgeResponse>; deleteMessage(stream: string, seq: number, erase?: boolean): Promise<boolean>; getMessage(stream: string, query: MsgRequest): Promise<StoredMsg>; find(subject: string): Promise<string>; listKvs(): Lister<KvStatus>; listObjectStores(): Lister<ObjectStoreStatus>; names(subject?: string): Lister<string>; } export declare class StoredMsgImpl implements StoredMsg { subject: string; seq: number; data: Uint8Array; time: Date; header: MsgHdrs; constructor(smr: StreamMsgResponse); _parse(s: string): Uint8Array; }