mezon-sdk 2.7.2 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,83 +0,0 @@
1
- /**
2
- * Copyright 2020 The Mezon Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * An interface used by Mezon's web socket to determine the payload protocol.
18
- */
19
- export interface WebSocketAdapter {
20
- /**
21
- * Dispatched when the web socket closes.
22
- */
23
- onClose: SocketCloseHandler | null;
24
- /**
25
- * Dispatched when the web socket receives an error.
26
- */
27
- onError: SocketErrorHandler | null;
28
- /**
29
- * Dispatched when the web socket receives a normal message.
30
- */
31
- onMessage: SocketMessageHandler | null;
32
- /**
33
- * Dispatched when the web socket opens.
34
- */
35
- onOpen: SocketOpenHandler | null;
36
- isOpen(): boolean;
37
- close(): void;
38
- connect(scheme: string, host: string, port: string, createStatus: boolean, token: string): void;
39
- send(message: any): void;
40
- }
41
- /**
42
- * SocketCloseHandler defines a lambda that handles WebSocket close events.
43
- */
44
- export interface SocketCloseHandler {
45
- (this: WebSocket, evt: CloseEvent): void;
46
- }
47
- /**
48
- * SocketErrorHandler defines a lambda that handles responses from the server via WebSocket
49
- * that indicate an error.
50
- */
51
- export interface SocketErrorHandler {
52
- (this: WebSocket, evt: Event): void;
53
- }
54
- /**
55
- * SocketMessageHandler defines a lambda that handles valid WebSocket messages.
56
- */
57
- export interface SocketMessageHandler {
58
- (message: any): void;
59
- }
60
- /**
61
- * SocketOpenHandler defines a lambda that handles WebSocket open events.
62
- */
63
- export interface SocketOpenHandler {
64
- (this: WebSocket, evt: Event): void;
65
- }
66
- /**
67
- * A text-based socket adapter that accepts and transmits payloads over UTF-8.
68
- */
69
- export declare class WebSocketAdapterText implements WebSocketAdapter {
70
- private _socket?;
71
- get onClose(): SocketCloseHandler | null;
72
- set onClose(value: SocketCloseHandler | null);
73
- get onError(): SocketErrorHandler | null;
74
- set onError(value: SocketErrorHandler | null);
75
- get onMessage(): SocketMessageHandler | null;
76
- set onMessage(value: SocketMessageHandler | null);
77
- get onOpen(): SocketOpenHandler | null;
78
- set onOpen(value: SocketOpenHandler | null);
79
- isOpen(): boolean;
80
- connect(scheme: string, host: string, port: string, createStatus: boolean, token: string): void;
81
- close(): void;
82
- send(msg: any): void;
83
- }