UNPKG

nats

Version:

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

48 lines (47 loc) 1.72 kB
export interface MsgHdrs extends Iterable<[string, string[]]> { hasError: boolean; status: string; code: number; description: string; get(k: string, match?: Match): string; set(k: string, v: string, match?: Match): void; append(k: string, v: string, match?: Match): void; has(k: string, match?: Match): boolean; keys(): string[]; values(k: string, match?: Match): string[]; delete(k: string, match?: Match): void; } export declare function canonicalMIMEHeaderKey(k: string): string; export declare function headers(code?: number, description?: string): MsgHdrs; export declare enum Match { Exact = 0, CanonicalMIME = 1, IgnoreCase = 2 } export declare class MsgHdrsImpl implements MsgHdrs { _code: number; headers: Map<string, string[]>; _description: string; constructor(code?: number, description?: string); [Symbol.iterator](): IterableIterator<[string, string[]]>; size(): number; equals(mh: MsgHdrsImpl): boolean; static decode(a: Uint8Array): MsgHdrsImpl; toString(): string; encode(): Uint8Array; static validHeaderValue(k: string): string; keys(): string[]; findKeys(k: string, match?: Match): string[]; get(k: string, match?: Match): string; has(k: string, match?: Match): boolean; set(k: string, v: string, match?: Match): void; append(k: string, v: string, match?: Match): void; values(k: string, match?: Match): string[]; delete(k: string, match?: Match): void; get hasError(): boolean; get status(): string; toRecord(): Record<string, string[]>; get code(): number; get description(): string; static fromRecord(r: Record<string, string[]>): MsgHdrs; }