import { DenoBuffer } from "./denobuffer"; import type { Dispatcher } from "./core"; export declare const Kind: { readonly OK: 0; readonly ERR: 1; readonly MSG: 2; readonly INFO: 3; readonly PING: 4; readonly PONG: 5; }; export type Kind = typeof Kind[keyof typeof Kind]; export interface ParserEvent { kind: Kind; msg?: MsgArg; data?: Uint8Array; } export declare function describe(e: ParserEvent): string; export interface MsgArg { subject: Uint8Array; reply?: Uint8Array; sid: number; hdr: number; size: number; } export declare class Parser { dispatcher: Dispatcher; state: State; as: number; drop: number; hdr: number; ma: MsgArg; argBuf?: DenoBuffer; msgBuf?: DenoBuffer; constructor(dispatcher: Dispatcher); parse(buf: Uint8Array): void; cloneMsgArg(): void; processMsgArgs(arg: Uint8Array): void; fail(data: Uint8Array, label?: string): Error; processHeaderMsgArgs(arg: Uint8Array): void; protoParseInt(a: Uint8Array): number; } export declare const State: { readonly OP_START: 0; readonly OP_PLUS: 1; readonly OP_PLUS_O: 2; readonly OP_PLUS_OK: 3; readonly OP_MINUS: 4; readonly OP_MINUS_E: 5; readonly OP_MINUS_ER: 6; readonly OP_MINUS_ERR: 7; readonly OP_MINUS_ERR_SPC: 8; readonly MINUS_ERR_ARG: 9; readonly OP_M: 10; readonly OP_MS: 11; readonly OP_MSG: 12; readonly OP_MSG_SPC: 13; readonly MSG_ARG: 14; readonly MSG_PAYLOAD: 15; readonly MSG_END: 16; readonly OP_H: 17; readonly OP_P: 18; readonly OP_PI: 19; readonly OP_PIN: 20; readonly OP_PING: 21; readonly OP_PO: 22; readonly OP_PON: 23; readonly OP_PONG: 24; readonly OP_I: 25; readonly OP_IN: 26; readonly OP_INF: 27; readonly OP_INFO: 28; readonly OP_INFO_SPC: 29; readonly INFO_ARG: 30; }; export type State = typeof State[keyof typeof State]; export declare const cc: { readonly CR: number; readonly E: number; readonly e: number; readonly F: number; readonly f: number; readonly G: number; readonly g: number; readonly H: number; readonly h: number; readonly I: number; readonly i: number; readonly K: number; readonly k: number; readonly M: number; readonly m: number; readonly MINUS: number; readonly N: number; readonly n: number; readonly NL: number; readonly O: number; readonly o: number; readonly P: number; readonly p: number; readonly PLUS: number; readonly R: number; readonly r: number; readonly S: number; readonly s: number; readonly SPACE: number; readonly TAB: number; }; export type cc = typeof cc[keyof typeof cc];