@vindral/web-sdk 4.8.1 → 4.8.2-2-g17ce1f28

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.
package/cast-sender.d.ts CHANGED
@@ -3,6 +3,11 @@ type VoidKeys<Record> = MatchingKeys<Record, void>;
3
3
  type EventListenerReturnType = (() => void) | void;
4
4
  declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<TEvents> = VoidKeys<TEvents>, ArgEvents extends Exclude<keyof TEvents, ArgLessEvents> = Exclude<keyof TEvents, ArgLessEvents>, ArgLessEmits extends VoidKeys<TEmits> = VoidKeys<TEmits>, ArgEmits extends Exclude<keyof TEmits, ArgLessEmits> = Exclude<keyof TEmits, ArgLessEmits>> {
5
5
  private listeners;
6
+ /**
7
+ * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch;
8
+ * an override that returns lets the remaining listeners and deferred functions run.
9
+ */
10
+ protected handleListenerError(error: unknown, _eventName: PropertyKey): void;
6
11
  emit<T extends ArgLessEmits>(eventName: T): void;
7
12
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
8
13
  /**
@@ -299,8 +304,9 @@ interface Options {
299
304
  * Note: the ReconnectState gets reset every time the client instance makes a successful connection.
300
305
  * This means the default reconnect handler will only stop reconnecting after 30 _consecutive_ failed connections.
301
306
  *
302
- * While the page is hidden, a failure counts toward `reconnectRetries` only when the server answered: the channel
303
- * is not live or not found, or the connect request got a 4xx other than 408 or 429. Retries back off up to 30 seconds.
307
+ * While the page is hidden or the browser reports offline, a failure counts toward `reconnectRetries` only when the
308
+ * server answered: the channel is not live or not found, or the connect request got a 4xx other than 408 or 429.
309
+ * Hidden retries back off up to 30 seconds; offline retries wait for the network to return, at most 30 seconds.
304
310
  *
305
311
  * ```typescript
306
312
  * // An example reconnect handler that will reconnect forever
package/cast-sender.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "./DQ5kuB8C.js";
1
+ import { t as e } from "./CLvW8aae.js";
2
2
  export { e as CastSender };
package/core.d.ts CHANGED
@@ -49,6 +49,11 @@ type VoidKeys<Record> = MatchingKeys<Record, void>;
49
49
  type EventListenerReturnType = (() => void) | void;
50
50
  declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<TEvents> = VoidKeys<TEvents>, ArgEvents extends Exclude<keyof TEvents, ArgLessEvents> = Exclude<keyof TEvents, ArgLessEvents>, ArgLessEmits extends VoidKeys<TEmits> = VoidKeys<TEmits>, ArgEmits extends Exclude<keyof TEmits, ArgLessEmits> = Exclude<keyof TEmits, ArgLessEmits>> {
51
51
  private listeners;
52
+ /**
53
+ * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch;
54
+ * an override that returns lets the remaining listeners and deferred functions run.
55
+ */
56
+ protected handleListenerError(error: unknown, _eventName: PropertyKey): void;
52
57
  emit<T extends ArgLessEmits>(eventName: T): void;
53
58
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
54
59
  /**
@@ -408,8 +413,9 @@ export interface Options {
408
413
  * Note: the ReconnectState gets reset every time the client instance makes a successful connection.
409
414
  * This means the default reconnect handler will only stop reconnecting after 30 _consecutive_ failed connections.
410
415
  *
411
- * While the page is hidden, a failure counts toward `reconnectRetries` only when the server answered: the channel
412
- * is not live or not found, or the connect request got a 4xx other than 408 or 429. Retries back off up to 30 seconds.
416
+ * While the page is hidden or the browser reports offline, a failure counts toward `reconnectRetries` only when the
417
+ * server answered: the channel is not live or not found, or the connect request got a 4xx other than 408 or 429.
418
+ * Hidden retries back off up to 30 seconds; offline retries wait for the network to return, at most 30 seconds.
413
419
  *
414
420
  * ```typescript
415
421
  * // An example reconnect handler that will reconnect forever
@@ -1215,6 +1221,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1215
1221
  private static BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT;
1216
1222
  /** How long a pause on a visible page may still turn out to be the platform backgrounding us. */
1217
1223
  private static VISIBLE_PAUSE_DISCONNECT_DELAY;
1224
+ protected handleListenerError(error: unknown, eventName: PropertyKey): void;
1218
1225
  /**
1219
1226
  * Picture in picture
1220
1227
  */
package/core.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./DlCbtbuA.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./SmL84Oio.js";
2
2
  export { s as AUTHENTICATION_EXPIRED_CODE, i as AUTHENTICATION_FAILED_CODE, e as CHANNEL_NOT_FOUND_CODE, o as CHANNEL_NOT_LIVE_CODE, c as CONNECTION_FAILED_AFTER_RETRIES_CODE, t as CONNECTION_FAILED_CODE, a as DISCONNECTED_BY_EDGE, u as INACTIVITY_CODE, n as NO_INCOMING_DATA, l as Vindral, r as VindralError };
package/legacy.d.ts CHANGED
@@ -52,6 +52,11 @@ type VoidKeys<Record> = MatchingKeys<Record, void>;
52
52
  type EventListenerReturnType = (() => void) | void;
53
53
  declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<TEvents> = VoidKeys<TEvents>, ArgEvents extends Exclude<keyof TEvents, ArgLessEvents> = Exclude<keyof TEvents, ArgLessEvents>, ArgLessEmits extends VoidKeys<TEmits> = VoidKeys<TEmits>, ArgEmits extends Exclude<keyof TEmits, ArgLessEmits> = Exclude<keyof TEmits, ArgLessEmits>> {
54
54
  private listeners;
55
+ /**
56
+ * Called when a listener or a deferred function throws. Rethrows by default, which stops the dispatch;
57
+ * an override that returns lets the remaining listeners and deferred functions run.
58
+ */
59
+ protected handleListenerError(error: unknown, _eventName: PropertyKey): void;
55
60
  emit<T extends ArgLessEmits>(eventName: T): void;
56
61
  emit<T extends ArgEmits>(eventName: T, args: TEmits[T]): void;
57
62
  /**
@@ -411,8 +416,9 @@ export interface Options {
411
416
  * Note: the ReconnectState gets reset every time the client instance makes a successful connection.
412
417
  * This means the default reconnect handler will only stop reconnecting after 30 _consecutive_ failed connections.
413
418
  *
414
- * While the page is hidden, a failure counts toward `reconnectRetries` only when the server answered: the channel
415
- * is not live or not found, or the connect request got a 4xx other than 408 or 429. Retries back off up to 30 seconds.
419
+ * While the page is hidden or the browser reports offline, a failure counts toward `reconnectRetries` only when the
420
+ * server answered: the channel is not live or not found, or the connect request got a 4xx other than 408 or 429.
421
+ * Hidden retries back off up to 30 seconds; offline retries wait for the network to return, at most 30 seconds.
416
422
  *
417
423
  * ```typescript
418
424
  * // An example reconnect handler that will reconnect forever
@@ -1230,6 +1236,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1230
1236
  private static BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT;
1231
1237
  /** How long a pause on a visible page may still turn out to be the platform backgrounding us. */
1232
1238
  private static VISIBLE_PAUSE_DISCONNECT_DELAY;
1239
+ protected handleListenerError(error: unknown, eventName: PropertyKey): void;
1233
1240
  /**
1234
1241
  * Picture in picture
1235
1242
  */