@stream-io/video-client 1.60.0 → 1.61.0

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/src/types.ts CHANGED
@@ -458,7 +458,17 @@ type StreamRNVideoSDKEndCallReason =
458
458
  | 'unknown';
459
459
 
460
460
  type StreamRNVideoSDKCallingX = {
461
- joinCall: (call: Call, activeCalls: Call[]) => Promise<void>;
461
+ /**
462
+ * @param isCancelled - polled around the bridge's waits: registration is
463
+ * skipped, or undone, when it returns true. Supplied by the join attempt
464
+ * because the call's own state cannot distinguish a fresh join starting
465
+ * from `LEFT` from an abandoned one that reached `LEFT` while waiting.
466
+ */
467
+ joinCall: (
468
+ call: Call,
469
+ activeCalls: Call[],
470
+ isCancelled?: () => boolean,
471
+ ) => Promise<void>;
462
472
  endCall: (
463
473
  call: Call,
464
474
  reason?: StreamRNVideoSDKEndCallReason,
@@ -468,8 +478,34 @@ type StreamRNVideoSDKCallingX = {
468
478
  unwireAudioEngineSubscription: () => void;
469
479
  };
470
480
 
481
+ /**
482
+ * React Native's preparation and cleanup for a ringing call's join.
483
+ *
484
+ * A ringing call is joined by the SDK rather than by app code, so there is no
485
+ * point at which the app holds the call and can still set it up. These are that
486
+ * point, and the matching release.
487
+ */
488
+ type StreamRNVideoSDKRingingCallLifecycle = {
489
+ /**
490
+ * Runs the app's pre-join setup and resolves once it is done, bounded by a
491
+ * deadline. Rejecting fails the join closed rather than joining with nothing
492
+ * installed.
493
+ */
494
+ beforeJoin: (call: Call) => Promise<void>;
495
+
496
+ /**
497
+ * The join failed terminally. Ends the ringing flow and releases what the
498
+ * setup installed. Never rejects, so the original join error survives.
499
+ */
500
+ onJoinFailed: (call: Call) => Promise<void>;
501
+
502
+ /** The call has ended; release whatever the pre-join hook installed. */
503
+ onLeave: (call: Call) => void;
504
+ };
505
+
471
506
  export type StreamRNVideoSDKGlobals = {
472
507
  callingX: StreamRNVideoSDKCallingX;
508
+ ringingCallLifecycle: StreamRNVideoSDKRingingCallLifecycle;
473
509
  callManager: {
474
510
  /**
475
511
  * Sets up the in call manager.