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