1 |
|
2 | export declare const HEADER_LENGTH = 8;
|
3 | export declare const TYPE: {
|
4 | [key: string]: number;
|
5 | };
|
6 | export declare const OFFSET: {
|
7 | Type: number;
|
8 | Status: number;
|
9 | Length: number;
|
10 | SPID: number;
|
11 | PacketID: number;
|
12 | Window: number;
|
13 | };
|
14 | export declare class Packet {
|
15 | buffer: Buffer;
|
16 | constructor(typeOrBuffer: Buffer | number);
|
17 | setLength(): void;
|
18 | length(): number;
|
19 | resetConnection(reset: boolean): void;
|
20 | last(last?: boolean): boolean;
|
21 | ignore(last: boolean): void;
|
22 | isLast(): boolean;
|
23 | packetId(packetId?: number): number;
|
24 | addData(data: Buffer): this;
|
25 | data(): Buffer;
|
26 | type(): number;
|
27 | statusAsString(): string;
|
28 | headerToString(indent?: string): string;
|
29 | dataToString(indent?: string): string;
|
30 | toString(indent?: string): string;
|
31 | payloadString(): string;
|
32 | }
|
33 | export declare function isPacketComplete(potentialPacketBuffer: Buffer): boolean;
|
34 | export declare function packetLength(potentialPacketBuffer: Buffer): number;
|