This commit is contained in:
2026-01-28 00:55:06 +03:00
parent fc033be6a5
commit 25fc82c14a
1642 changed files with 101122 additions and 0 deletions

View File

@ -0,0 +1,35 @@
/// <reference types="node" />
import { ErrorReply } from '../../errors';
export type Reply = string | Buffer | ErrorReply | number | null | Array<Reply>;
export type ReturnStringsAsBuffers = () => boolean;
interface RESP2Options {
returnStringsAsBuffers: ReturnStringsAsBuffers;
onReply(reply: Reply): unknown;
}
export default class RESP2Decoder {
private options;
constructor(options: RESP2Options);
private cursor;
private type?;
private bufferComposer;
private stringComposer;
private currentStringComposer;
reset(): void;
write(chunk: Buffer): void;
private parseType;
private compose;
private parseSimpleString;
private parseError;
private integer;
private isNegativeInteger?;
private parseInteger;
private bulkStringRemainingLength?;
private parseBulkString;
private arraysInProcess;
private initializeArray;
private arrayItemType?;
private parseArray;
private returnArrayReply;
private pushArrayItem;
}
export {};