@voicenter-team/events-sdk 0.0.22 → 0.0.23

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.
@@ -173,6 +173,18 @@ export declare interface EventDataMap {
173
173
  [EventsEnum.ONLINE_STATUS_EVENT]: OnlineStatusEvent
174
174
  }
175
175
 
176
+ declare class EventEmitterClass {
177
+ private readonly eventsSdkClass;
178
+ private listeners;
179
+ private allListeners;
180
+ constructor(eventsSdkClass: EventsSdkClass);
181
+ on<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
182
+ on(event: '*', callback: (data: GenericEventWrapper) => void): void;
183
+ off<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
184
+ off(event: '*', callback: (data: GenericEventWrapper) => void): void;
185
+ emit<T extends EventTypeNames>(event: T, data: EventTypeData<T>): void;
186
+ }
187
+
176
188
  /**
177
189
  * All the eventNames that can be received from the server. Exists only in EXTENSION_EVENT and QueueEvent
178
190
  */
@@ -221,22 +233,17 @@ declare class EventsSdkClass {
221
233
  authClass: AuthClass;
222
234
  socketIoClass: SocketIoClass;
223
235
  loggerClass: LoggerClass;
236
+ eventEmitterClass: EventEmitterClass;
224
237
  reconnectOptions: ReconnectOptions;
225
238
  retryConnection: DebouncedFuncLeading<(serverParameter: ServerParameter) => void>;
226
- private listeners;
227
- private allListeners;
228
239
  constructor(options: EventsSdkOptions);
229
240
  on<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
230
- on(event: '*', callback: (data: GenericEventWrapper) => void): void;
231
- off<T extends EventTypeNames>(event: T, callback: EventSpecificCallback<T>): void;
232
- off(event: '*', callback: (data: GenericEventWrapper) => void): void;
233
- emit<T extends EventTypeNames>(event: T, data: EventTypeData<T>): void;
241
+ emit(event: EventsEnum, data: unknown): void;
234
242
  connect(serverParameter: ServerParameter): void;
235
243
  disconnect(): void;
236
244
  clearKeepAliveInterval(): void;
237
245
  private findMainServer;
238
246
  private findNextServer;
239
- getServerWithHighestPriority(servers: Server[]): Server;
240
247
  init(): Promise<boolean>;
241
248
  private getServers;
242
249
  }
@@ -651,6 +658,7 @@ declare class SocketIoClass {
651
658
  private onKeepAliveResponse;
652
659
  private onConnect;
653
660
  private onDisconnect;
661
+ private onConnectError;
654
662
  }
655
663
 
656
664
  export declare type SocketTyped = Socket_2<EventCallbackRegistry, Record<EventsEnum, any>>