1 | import { IFrame } from './i-frame';
|
2 | import { IMessage } from './i-message';
|
3 | import { StompHeaders } from './stomp-headers';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare type debugFnType = (msg: string) => void;
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export declare type messageCallbackType = (message: IMessage) => void;
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export declare type frameCallbackType = (receipt: IFrame) => void;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export declare type closeEventCallbackType<T = any> = (evt: T) => void;
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export declare type wsErrorCallbackType<T = any> = (evt: T) => void;
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export interface IPublishParams {
|
43 | |
44 |
|
45 |
|
46 | destination: string;
|
47 | |
48 |
|
49 |
|
50 | headers?: StompHeaders;
|
51 | |
52 |
|
53 |
|
54 | body?: string;
|
55 | |
56 |
|
57 |
|
58 | binaryBody?: Uint8Array;
|
59 | |
60 |
|
61 |
|
62 |
|
63 | skipContentLengthHeader?: boolean;
|
64 | }
|
65 |
|
66 |
|
67 |
|
68 | export declare type publishParams = IPublishParams;
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | export declare type RawHeaderType = [string, string];
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | export interface IRawFrameType {
|
85 | command: string;
|
86 | headers: RawHeaderType[];
|
87 | binaryBody: Uint8Array;
|
88 | }
|
89 |
|
90 |
|
91 |
|
92 | export interface IStompSocketMessageEvent {
|
93 | data?: string | ArrayBuffer;
|
94 | }
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | export interface IStompSocket {
|
101 | onclose: ((this: IStompSocket, ev?: any) => any) | null;
|
102 | onerror: ((this: IStompSocket, ev: any) => any) | null;
|
103 | onmessage: ((this: IStompSocket, ev: IStompSocketMessageEvent) => any) | null;
|
104 | onopen: ((this: IStompSocket, ev?: any) => any) | null;
|
105 | terminate?: ((this: IStompSocket) => any) | null;
|
106 | /**
|
107 | * Returns a string that indicates how binary data from the socket is exposed to scripts:
|
108 | * We support only 'arraybuffer'.
|
109 | */
|
110 | binaryType: 'arraybuffer';
|
111 | /**
|
112 | * Returns the state of the socket connection. It can have the values of StompSocketState.
|
113 | */
|
114 | readonly readyState: number;
|
115 | /**
|
116 | * Closes the connection.
|
117 | */
|
118 | close(): void;
|
119 | /**
|
120 | * Transmits data using the connection. data can be a string or an ArrayBuffer.
|
121 | */
|
122 | send(data: string | ArrayBuffer): void;
|
123 | }
|
124 | /**
|
125 | * Possible states for the IStompSocket
|
126 | */
|
127 | export declare enum StompSocketState {
|
128 | CONNECTING = 0,
|
129 | OPEN = 1,
|
130 | CLOSING = 2,
|
131 | CLOSED = 3
|
132 | }
|
133 | /**
|
134 | * Possible activation state
|
135 | */
|
136 | export declare enum ActivationState {
|
137 | ACTIVE = 0,
|
138 | DEACTIVATING = 1,
|
139 | INACTIVE = 2
|
140 | }
|
141 |
|
\ | No newline at end of file |