forked from stomp-js/stompjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe-impl.d.ts
95 lines (95 loc) · 2.47 KB
/
frame-impl.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import { IFrame } from './i-frame';
import { StompHeaders } from './stomp-headers';
import { IRawFrameType } from './types';
/**
* Frame class represents a STOMP frame.
*
* @internal
*/
export declare class FrameImpl implements IFrame {
/**
* STOMP Command
*/
command: string;
/**
* Headers, key value pairs.
*/
headers: StompHeaders;
/**
* Is this frame binary (based on whether body/binaryBody was passed when creating this frame).
*/
isBinaryBody: boolean;
/**
* body of the frame
*/
readonly body: string;
private _body;
/**
* body as Uint8Array
*/
readonly binaryBody: Uint8Array;
private _binaryBody;
private escapeHeaderValues;
private skipContentLengthHeader;
/**
* Frame constructor. `command`, `headers` and `body` are available as properties.
*
* @internal
*/
constructor(params: {
command: string;
headers?: StompHeaders;
body?: string;
binaryBody?: Uint8Array;
escapeHeaderValues?: boolean;
skipContentLengthHeader?: boolean;
});
/**
* deserialize a STOMP Frame from raw data.
*
* @internal
*/
static fromRawFrame(rawFrame: IRawFrameType, escapeHeaderValues: boolean): FrameImpl;
/**
* @internal
*/
toString(): string;
/**
* serialize this Frame in a format suitable to be passed to WebSocket.
* If the body is string the output will be string.
* If the body is binary (i.e. of type Unit8Array) it will be serialized to ArrayBuffer.
*
* @internal
*/
serialize(): string | ArrayBuffer;
private serializeCmdAndHeaders;
private isBodyEmpty;
private bodyLength;
/**
* Compute the size of a UTF-8 string by counting its number of bytes
* (and not the number of characters composing the string)
*/
private static sizeOfUTF8;
private static toUnit8Array;
/**
* Serialize a STOMP frame as per STOMP standards, suitable to be sent to the STOMP broker.
*
* @internal
*/
static marshall(params: {
command: string;
headers?: StompHeaders;
body?: string;
binaryBody?: Uint8Array;
escapeHeaderValues?: boolean;
skipContentLengthHeader?: boolean;
}): string | ArrayBuffer;
/**
* Escape header values
*/
private static hdrValueEscape;
/**
* UnEscape header values
*/
private static hdrValueUnEscape;
}