@realsee/live 0.6.11-dev.1 → 0.6.12-alpha.1

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.
@@ -5,6 +5,7 @@ import { Subscribe } from '../utils/subscribe';
5
5
  export type LiveControllerEventMap = {
6
6
  stateChange: (state: LiveState, prevState: LiveState) => void;
7
7
  message: (message: LiveMsg) => void;
8
+ reconnecting: (detail: RobustWebSocketEventDetail) => void;
8
9
  reconnected: (detail: RobustWebSocketEventDetail) => void;
9
10
  };
10
11
  export declare class LiveController extends Subscribe<LiveControllerEventMap> {
@@ -92,6 +92,18 @@ export declare class Live<KeyframesSnapshot extends Record<string, any>> extends
92
92
  * 移除带看控制的事件监听
93
93
  */
94
94
  private _removeLiveControllerEventListeners;
95
+ /**
96
+ * 重连中事件
97
+ * @param detail
98
+ * @returns
99
+ */
100
+ private _handleReconnecting;
101
+ /**
102
+ * 重连成功事件
103
+ * @param detail
104
+ * @returns
105
+ */
106
+ private _handleReconnected;
95
107
  /**
96
108
  * 带看状态变化
97
109
  * @param state
@@ -1,3 +1,4 @@
1
+ import { RobustWebSocketEventDetail } from '../../utils/RobustWebSocket';
1
2
  import { BuiltinMsg, LiveMsg } from './LiveMsg';
2
3
  import { LiveState } from './LiveState';
3
4
  import { UserInfo } from './UserInfo';
@@ -61,6 +62,16 @@ export type LiveEventType<KeyframesSnapshot> = {
61
62
  * @param liveMsg
62
63
  */
63
64
  'error'(liveMsg: LiveMsg): void;
65
+ /**
66
+ * 重新连接成功
67
+ * @param detail
68
+ */
69
+ 'reconnected'(detail: RobustWebSocketEventDetail): void;
70
+ /**
71
+ * 重新连接中
72
+ * @param detail
73
+ */
74
+ 'reconnecting'(detail: RobustWebSocketEventDetail): void;
64
75
  };
65
76
  /**
66
77
  * 帧数据类型
@@ -17,6 +17,9 @@ export type RobustOptions = {
17
17
  ignoreConnectivityEvents?: boolean;
18
18
  automaticOpen?: boolean;
19
19
  };
20
+ /**
21
+ * 重连的事件详情
22
+ */
20
23
  export type RobustWebSocketEventDetail = {
21
24
  reconnects: number;
22
25
  attempts: number;