@daily-co/react-native-daily-js 0.28.0 → 0.29.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/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@daily-co/react-native-daily-js",
3
- "//": "^ COMMENT OUT 'private: true' BEFORE RUNNING NPM PUBLISH",
4
- "version": "0.28.0",
3
+ "version": "0.29.0",
5
4
  "description": "React Native library for making video calls using Daily",
6
5
  "main": "dist/index.js",
7
6
  "types": "dist/index.d.ts",
@@ -27,7 +26,7 @@
27
26
  "baseUrl": "https://github.com/daily-co/react-native-daily-js"
28
27
  },
29
28
  "dependencies": {
30
- "@daily-co/daily-js": "^0.30.0",
29
+ "@daily-co/daily-js": "^0.31.0",
31
30
  "@types/react-native-background-timer": "^2.0.0",
32
31
  "react-native-url-polyfill": "^1.1.2"
33
32
  },
@@ -47,6 +47,7 @@ export type DailyEvent =
47
47
  | 'participant-joined'
48
48
  | 'participant-updated'
49
49
  | 'participant-left'
50
+ | 'participant-counts-updated'
50
51
  | 'track-started'
51
52
  | 'track-stopped'
52
53
  | 'recording-started'
@@ -172,10 +173,29 @@ export interface DailyTrackState {
172
173
  byUser?: boolean;
173
174
  byRemoteRequest?: boolean;
174
175
  byBandwidth?: boolean;
176
+ byCanSendPermission?: boolean;
175
177
  };
176
178
  track?: MediaStreamTrack;
177
179
  }
178
180
 
181
+ export interface DailyParticipantPermissions {
182
+ hasPresence: boolean;
183
+ canSend:
184
+ | Set<
185
+ | 'video'
186
+ | 'audio'
187
+ | 'screenVideo'
188
+ | 'screenAudio'
189
+ | 'customVideo'
190
+ | 'customAudio'
191
+ >
192
+ | boolean;
193
+ }
194
+
195
+ export type DailyParticipantPermissionsUpdate = {
196
+ [Property in keyof DailyParticipantPermissions]+?: DailyParticipantPermissions[Property];
197
+ };
198
+
179
199
  export interface DailyParticipant {
180
200
  // tracks
181
201
  audioTrack?: MediaStreamTrack;
@@ -205,6 +225,7 @@ export interface DailyParticipant {
205
225
  will_eject_at: Date;
206
226
  local: boolean;
207
227
  owner: boolean;
228
+ permissions: DailyParticipantPermissions;
208
229
  record: boolean;
209
230
 
210
231
  // video element info (iframe-based calls using standard UI only)
@@ -212,6 +233,11 @@ export interface DailyParticipant {
212
233
  screen_info: {} | DailyVideoElementInfo;
213
234
  }
214
235
 
236
+ export interface DailyParticipantCounts {
237
+ present: number;
238
+ hidden: number;
239
+ }
240
+
215
241
  export interface DailyWaitingParticipant {
216
242
  id: string;
217
243
  name: string;
@@ -234,6 +260,7 @@ export interface DailyParticipantUpdateOptions {
234
260
  setVideo?: boolean;
235
261
  setSubscribedTracks?: DailyTrackSubscriptionOptions;
236
262
  eject?: true;
263
+ updatePermissions?: DailyParticipantPermissionsUpdate;
237
264
  }
238
265
 
239
266
  export interface DailyWaitingParticipantUpdateOptions {
@@ -420,13 +447,26 @@ export interface DailyEventObjectParticipants {
420
447
  }
421
448
 
422
449
  export interface DailyEventObjectParticipant {
423
- action: Extract<
424
- DailyEvent,
425
- 'participant-joined' | 'participant-updated' | 'participant-left'
426
- >;
450
+ action: Extract<DailyEvent, 'participant-joined' | 'participant-updated'>;
427
451
  participant: DailyParticipant;
428
452
  }
429
453
 
454
+ // only 1 reason reported for now. more to come.
455
+ export type DailyParticipantLeftReason = 'hidden';
456
+
457
+ export interface DailyEventObjectParticipantLeft {
458
+ action: Extract<DailyEvent, 'participant-left'>;
459
+ participant: DailyParticipant;
460
+ // reason undefined if participant left for any reason other than those listed
461
+ // in DailyParticipantLeftReason
462
+ reason?: DailyParticipantLeftReason;
463
+ }
464
+
465
+ export interface DailyEventObjectParticipantCounts {
466
+ action: Extract<DailyEvent, 'participant-counts-updated'>;
467
+ participantCounts: DailyParticipantCounts;
468
+ }
469
+
430
470
  export interface DailyEventObjectWaitingParticipant {
431
471
  action: Extract<
432
472
  DailyEvent,
@@ -544,6 +584,10 @@ export type DailyEventObject<T extends DailyEvent = any> =
544
584
  ? DailyEventObjectParticipants
545
585
  : T extends DailyEventObjectParticipant['action']
546
586
  ? DailyEventObjectParticipant
587
+ : T extends DailyEventObjectParticipantLeft['action']
588
+ ? DailyEventObjectParticipantLeft
589
+ : T extends DailyEventObjectParticipantCounts['action']
590
+ ? DailyEventObjectParticipantCounts
547
591
  : T extends DailyEventObjectWaitingParticipant['action']
548
592
  ? DailyEventObjectWaitingParticipant
549
593
  : T extends DailyEventObjectAccessState['action']
@@ -711,6 +755,7 @@ export interface DailyCall {
711
755
  meetingState(): DailyMeetingState;
712
756
  accessState(): DailyAccessState;
713
757
  participants(): DailyParticipantsObject;
758
+ participantCounts(): DailyParticipantCounts;
714
759
  updateParticipant(
715
760
  sessionId: string,
716
761
  updates: DailyParticipantUpdateOptions