1 | import { IFrame } from './i-frame.js';
|
2 | import { IMessage } from './i-message.js';
|
3 | import { StompHeaders } from './stomp-headers.js';
|
4 | import { Versions } from './versions.js';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export declare type debugFnType = (msg: string) => void;
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare type messageCallbackType = (message: IMessage) => void;
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare type frameCallbackType = ((frame: IFrame) => void) | (() => void);
|
23 | /**
|
24 | * This callback will receive a [CloseEvent]{@link https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent}
|
25 | * as parameter.
|
26 | *
|
27 | * Part of `@stomp/stompjs`.
|
28 | */
|
29 | export declare type closeEventCallbackType<T = any> = (evt: T) => void;
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export declare type wsErrorCallbackType<T = any> = (evt: T) => void;
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | export interface IPublishParams {
|
44 | |
45 |
|
46 |
|
47 | destination: string;
|
48 | |
49 |
|
50 |
|
51 | headers?: StompHeaders;
|
52 | |
53 |
|
54 |
|
55 | body?: string;
|
56 | |
57 |
|
58 |
|
59 | binaryBody?: Uint8Array;
|
60 | |
61 |
|
62 |
|
63 |
|
64 | skipContentLengthHeader?: boolean;
|
65 | }
|
66 |
|
67 |
|
68 |
|
69 | export declare type publishParams = IPublishParams;
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | export declare type RawHeaderType = [string, string];
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export interface IRawFrameType {
|
86 | command: string | undefined;
|
87 | headers: RawHeaderType[];
|
88 | binaryBody: Uint8Array | undefined;
|
89 | }
|
90 |
|
91 |
|
92 |
|
93 | export interface IStompSocketMessageEvent {
|
94 | data?: string | ArrayBuffer;
|
95 | }
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 | export interface IStompSocket {
|
102 | url: string;
|
103 | onclose: ((ev?: any) => any) | undefined | null;
|
104 | onerror: ((ev: any) => any) | undefined | null;
|
105 | onmessage: ((ev: IStompSocketMessageEvent) => any) | undefined | null;
|
106 | onopen: ((ev?: any) => any) | undefined | null;
|
107 | terminate?: (() => any) | undefined | null;
|
108 | /**
|
109 | * Returns a string that indicates how binary data from the socket is exposed to scripts:
|
110 | * We support only 'arraybuffer'.
|
111 | */
|
112 | binaryType?: string;
|
113 | /**
|
114 | * Returns the state of the socket connection. It can have the values of StompSocketState.
|
115 | */
|
116 | readonly readyState: number;
|
117 | /**
|
118 | * Closes the connection.
|
119 | */
|
120 | close(): void;
|
121 | /**
|
122 | * Transmits data using the connection. data can be a string or an ArrayBuffer.
|
123 | */
|
124 | send(data: string | ArrayBuffer): void;
|
125 | }
|
126 | /**
|
127 | * Possible states for the IStompSocket
|
128 | */
|
129 | export declare enum StompSocketState {
|
130 | CONNECTING = 0,
|
131 | OPEN = 1,
|
132 | CLOSING = 2,
|
133 | CLOSED = 3
|
134 | }
|
135 | /**
|
136 | * Possible activation state
|
137 | */
|
138 | export declare enum ActivationState {
|
139 | ACTIVE = 0,
|
140 | DEACTIVATING = 1,
|
141 | INACTIVE = 2
|
142 | }
|
143 | /**
|
144 | * @internal
|
145 | */
|
146 | export interface IStomptHandlerConfig {
|
147 | debug: debugFnType;
|
148 | stompVersions: Versions;
|
149 | connectHeaders: StompHeaders;
|
150 | disconnectHeaders: StompHeaders;
|
151 | heartbeatIncoming: number;
|
152 | heartbeatOutgoing: number;
|
153 | splitLargeFrames: boolean;
|
154 | maxWebSocketChunkSize: number;
|
155 | forceBinaryWSFrames: boolean;
|
156 | logRawCommunication: boolean;
|
157 | appendMissingNULLonIncoming: boolean;
|
158 | discardWebsocketOnCommFailure: boolean;
|
159 | onConnect: frameCallbackType;
|
160 | onDisconnect: frameCallbackType;
|
161 | onStompError: frameCallbackType;
|
162 | onWebSocketClose: closeEventCallbackType;
|
163 | onWebSocketError: wsErrorCallbackType;
|
164 | onUnhandledMessage: messageCallbackType;
|
165 | onUnhandledReceipt: frameCallbackType;
|
166 | onUnhandledFrame: frameCallbackType;
|
167 | }
|
168 |
|
\ | No newline at end of file |