@pexip/media-control 17.2.0 → 17.4.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/dist/index.d.ts CHANGED
@@ -1,973 +1,3 @@
1
- /**
2
- * A striped version of MediaDeviceInfo
3
- *
4
- * @beta
5
- */
6
- type MediaDeviceInfoLike = Omit<MediaDeviceInfo, 'toJSON'> & {
7
- settings?: MediaTrackSettings;
8
- toJSON?: MediaDeviceInfo['toJSON'];
9
- };
10
- type DeviceConstraint = MediaDeviceInfoLike | MediaDeviceInfoLike[];
11
- interface ConstraintDeviceParameters {
12
- exact?: DeviceConstraint;
13
- ideal?: DeviceConstraint;
14
- }
15
- interface InputConstraintSet extends MediaTrackConstraints {
16
- /**
17
- * Same purpose as `deviceId` but it gives more information about the device
18
- * so that we can have extra tolerance on device selection
19
- */
20
- device?: DeviceConstraint | ConstraintDeviceParameters;
21
- /**
22
- * Whether or not using video segmentation, e.g. background
23
- * blur/replacement, to specify the effects, intended to be applied to the
24
- * segment. Available effects are `none`, `blur`, `overlay` or `remove`
25
- */
26
- videoSegmentation?: ConstrainDOMString;
27
- /**
28
- * Segmentation model to be used for video segmentation, currently only
29
- * supports `mediapipeSelfie` and `personify`
30
- */
31
- videoSegmentationModel?: ConstrainDOMString;
32
- /**
33
- * Whether or not using our own noise suppression
34
- */
35
- denoise?: ConstrainBoolean;
36
- /**
37
- * Voice Activity Detection
38
- */
39
- vad?: ConstrainBoolean;
40
- /**
41
- * Audio Signal Detection for the purpose of checking if the audio input is
42
- * hardware muted or unusable
43
- */
44
- asd?: ConstrainBoolean;
45
- /**
46
- * Audio Signal Detection for the purpose of checking if the audio input is
47
- * hardware muted or unusable
48
- */
49
- mixWithAdditionalMedia?: ConstrainBoolean;
50
- /**
51
- * Flip the video horizontally
52
- */
53
- flipHorizontal?: ConstrainBoolean;
54
- /**
55
- * Blur size/level parameter when using video segmentation with `blur`
56
- * effects
57
- */
58
- backgroundBlurAmount?: ConstrainULong;
59
- /**
60
- * Blur amount applied to the segmented person's edge
61
- */
62
- edgeBlurAmount?: ConstrainULong;
63
- /**
64
- * Erode level for edge smoothing when using video segmentation
65
- */
66
- foregroundThreshold?: ConstrainDouble;
67
- /**
68
- * Image Url that is being used for video overlay effects
69
- */
70
- bgImageUrl?: ConstrainDOMString;
71
- /**
72
- * Image Url that is being used for video overlay effects
73
- */
74
- resizeMode?: ConstrainDOMString;
75
- /**
76
- * Current pan, tilt and zoom level for a PTZ controllable camera on web
77
- */
78
- pan?: boolean;
79
- tilt?: boolean;
80
- zoom?: boolean;
81
- /**
82
- * Content Hint for the track to apply
83
- */
84
- contentHint?: ConstrainDOMString;
85
- }
86
- type InputDeviceConstraint = DeviceConstraint | InputConstraintSet | boolean;
87
- /**
88
- * The request constraints that applies to `getMediaStream`
89
- *
90
- * @beta
91
- */
92
- interface MediaDeviceRequest {
93
- /**
94
- * Either a Boolean (which indicates whether or not an audio track is
95
- * requested) or a {@link MediaDeviceInfoLike} object providing a hint for the
96
- * audio track included in the returned MediaStream
97
- */
98
- audio?: InputDeviceConstraint;
99
- /**
100
- * Either a Boolean (which indicates whether or not an video track is
101
- * requested) or a {@link MediaDeviceInfoLike} object providing a hint for the
102
- * video track included in the returned MediaStream
103
- */
104
- video?: InputDeviceConstraint;
105
- }
106
- /**
107
- * an enum of MediaDeviceKind which can be reused
108
- *
109
- * @beta
110
- */
111
- declare enum MediaDeviceKinds {
112
- /** audio input */
113
- AUDIOINPUT = "audioinput",
114
- /** audio output */
115
- AUDIOOUTPUT = "audiooutput",
116
- /** video input */
117
- VIDEOINPUT = "videoinput"
118
- }
119
- /**
120
- * MediaTrackConstraints.facingMode
121
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/facingMode}
122
- */
123
- declare const FACING_MODE: readonly ["user", "environment", "left", "right"];
124
- type FacingMode = (typeof FACING_MODE)[number];
125
- /**
126
- * An enum of failure events for media device
127
- *
128
- * @beta
129
- */
130
- declare enum MediaDeviceFailure {
131
- /**
132
- * some problem (not user or permissions) occurred which prevented the device
133
- * from being used.
134
- */
135
- AbortError = "AbortError",
136
- /**
137
- * Custom error for when selected audio and video device is not found
138
- */
139
- AudioAndVideoDeviceNotFoundError = "AudioAndVideoDeviceNotFoundError",
140
- /**
141
- * Custom error for selected audio device not found
142
- */
143
- AudioInputDeviceNotFoundError = "AudioInputDeviceNotFoundError",
144
- /**
145
- * Custom missing constraints error
146
- */
147
- MissingConstraintsError = "MissingConstraintsError",
148
- /**
149
- * user has blocked access
150
- */
151
- NotAllowedError = "NotAllowedError",
152
- /**
153
- * the media tracks doesn't match the constraints
154
- */
155
- NotFoundError = "NotFoundError",
156
- /**
157
- * hardware failure after user granted access
158
- */
159
- NotReadableError = "NotReadableError",
160
- /**
161
- * no devices met the criteria for the constraints
162
- */
163
- OverconstrainedError = "OverconstrainedError",
164
- /**
165
- * user has blocked access old chrome
166
- */
167
- PermissionDeniedError = "PermissionDeniedError",
168
- /**
169
- * User media support disabled by agent
170
- */
171
- SecurityError = "SecurityError",
172
- /**
173
- * when hardware in use old chrome win os
174
- */
175
- TrackStartError = "TrackStartError",
176
- /**
177
- * GetUserMedia invalid constraints error
178
- */
179
- TypeError = "TypeError",
180
- /**
181
- * Custom error for selected video device not found
182
- */
183
- VideoInputDeviceNotFoundError = "VideoInputDeviceNotFoundError",
184
- /**
185
- * action or function is not supported by the current platform
186
- */
187
- NotSupportedError = "NotSupportedError",
188
- /**
189
- * Canvas capture is not supported
190
- */
191
- StreamTrackNotFound = "StreamTrackNotFound"
192
- }
193
- /**
194
- * Lesser strict type of `MediaStreamTrack`
195
- *
196
- * @beta
197
- */
198
- type MediaStreamTrackLike = Pick<MediaStreamTrack, 'id' | 'kind' | 'label' | 'getSettings' | 'stop'>;
199
- /**
200
- * Holds user media input devices
201
- *
202
- * @beta
203
- */
204
- interface MediaInput {
205
- audioInput?: MediaDeviceInfoLike;
206
- videoInput?: MediaDeviceInfoLike;
207
- }
208
- type Unsubscribe = () => void;
209
- type TrackEventCallback = (track: MediaStreamTrack) => void;
210
- /**
211
- * An object contains the event handlers
212
- */
213
- interface StreamTrackEventHandlers {
214
- ended?: TrackEventCallback;
215
- mute?: TrackEventCallback;
216
- unmute?: TrackEventCallback;
217
- }
218
- interface InputDevicePermission {
219
- audio: PermissionState;
220
- video: PermissionState;
221
- }
222
- interface DisplayVideoTrackConstraint extends MediaTrackConstraintSet {
223
- displaySurface?: ConstrainDOMString;
224
- cursor?: ConstrainDOMString;
225
- }
226
- interface DisplayAudioTrackConstraint extends MediaTrackConstraintSet {
227
- restrictOwnAudio?: ConstrainBoolean;
228
- suppressLocalAudioPlayback?: ConstrainBoolean;
229
- }
230
- interface DisplayVideoTrackConstraints extends DisplayVideoTrackConstraint {
231
- advanced?: DisplayVideoTrackConstraint[];
232
- }
233
- interface DisplayAudioTrackConstraints extends DisplayAudioTrackConstraint {
234
- advanced?: DisplayAudioTrackConstraint[];
235
- }
236
- /**
237
- * The `DisplayMediaStreamOptions` dictionary is used to instruct the user agent
238
- * what sort of `MediaStreamTracks` may be included in the `MediaStream`
239
- * returned by `getDisplayMedia`.
240
- *
241
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#displaymediastreamoptions}
242
- */
243
- interface DisplayMediaOptions extends DisplayMediaStreamOptions {
244
- audio?: boolean | DisplayAudioTrackConstraints;
245
- video?: boolean | DisplayVideoTrackConstraints;
246
- selfBrowserSurface?: ConstrainDOMString;
247
- systemAudio?: ConstrainDOMString;
248
- surfaceSwitching?: ConstrainDOMString;
249
- monitorTypeSurfaces?: ConstrainDOMString;
250
- }
251
-
252
- /**
253
- * DeviceChange Event
254
- *
255
- * ```
256
- * devices (raw)
257
- * |--- authorized
258
- * | |--- found
259
- * | |--- lost
260
- * |--- unauthorized
261
- * ```
262
- *
263
- * @beta
264
- */
265
- type DeviceChangedChanges = {
266
- authorized: MediaDeviceInfoLike[];
267
- unauthorized: MediaDeviceInfoLike[];
268
- found: MediaDeviceInfoLike[];
269
- lost: MediaDeviceInfoLike[];
270
- devices: MediaDeviceInfoLike[];
271
- };
272
- interface ToKeyOptions {
273
- id: string;
274
- kind: string;
275
- label: string;
276
- }
277
- /**
278
- * Convert provided info to key for Map
279
- *
280
- * @beta
281
- */
282
- declare const toKey: ({ id, kind, label }: ToKeyOptions) => string;
283
- /**
284
- * Future proofing: in case we want to alter the values or type returned
285
- * by {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices | enumerateDevices}
286
- *
287
- * @returns
288
- * a list of currently available {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo | devices}
289
- *
290
- * @example
291
- * ```javascript
292
- * import {getDevices} from "media-control";
293
- *
294
- * const devices = await getDevices();
295
- * // return MediaDeviceInfo[]
296
- * ```
297
- *
298
- * @beta
299
- */
300
- declare const getDevices: () => Promise<MediaDeviceInfo[]>;
301
- declare const createTrackDevicesChanges: (prevDevices?: MediaDeviceInfoLike[]) => (devices: MediaDeviceInfoLike[]) => {
302
- unauthorized: MediaDeviceInfoLike[];
303
- authorized: MediaDeviceInfoLike[];
304
- found: MediaDeviceInfoLike[];
305
- lost: MediaDeviceInfoLike[];
306
- devices: MediaDeviceInfoLike[];
307
- };
308
- /**
309
- * Unified interface for subscribing {@link DeviceChangedChanges} Event
310
- *
311
- * @beta
312
- */
313
- declare const deviceChanged: (fn: (event: DeviceChangedChanges) => void) => () => void;
314
- /**
315
- * Convert `MediaStreamTrack` to `MediaDeviceInfoLike`
316
- *
317
- * @beta
318
- */
319
- declare const toMediaDeviceInfoLike: (track: MediaStreamTrack) => MediaDeviceInfoLike | undefined;
320
- /**
321
- * Find the MediaDeviceInfo from provided MediaDeviceInfo[] by comparing with
322
- * provided MediaStreamTrack
323
- *
324
- * @param devices - A device list used for the searching
325
- * @param track - A track for the searching criteria
326
- *
327
- * @returns `MediaDeviceInfo` if found, otherwise `undefined`
328
- *
329
- * @beta
330
- */
331
- declare const findMediaInputFromMediaStreamTrack: (devices: MediaDeviceInfoLike[]) => (track?: MediaStreamTrack | undefined) => MediaDeviceInfoLike | undefined;
332
- /**
333
- * Find media input from media stream
334
- *
335
- * @param devices - A list of media devices from
336
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
337
- * @param stream - A media stream used for the search criteria
338
- *
339
- * @returns A object may contains the devices
340
- *
341
- * @beta
342
- */
343
- declare const findMediaInputFromStream: (devices: MediaDeviceInfoLike[]) => (stream: MediaStream | undefined) => MediaInput;
344
- declare const isRequestedResolution: (request: InputDeviceConstraint | undefined, response: MediaDeviceInfoLike | undefined) => boolean;
345
- declare const isRequestedInputDevice: (request: InputDeviceConstraint | undefined, response: MediaDeviceInfoLike | undefined) => boolean;
346
- /**
347
- * Compare request and the input to see if the request has been fulfilled
348
- */
349
- declare const isRequestedInputTrack: (request: InputDeviceConstraint | undefined, current: MediaStreamTrack | MediaDeviceInfoLike | undefined) => boolean;
350
- declare const hasRequestingDevice: (request: InputDeviceConstraint | undefined, kind: MediaDeviceKind, currentDevices: MediaDeviceInfoLike[]) => boolean;
351
- /**
352
- * Decide if we should send a new gUM request based on the inputs
353
- *
354
- * @param request - Requesting input device constraint
355
- * @param tracks - The current media stream tracks
356
- * @param currentDevices - The current list of device of the same kind of the
357
- * request
358
- *
359
- * @returns `true` means the request should be conducted, otherwise `false`.
360
- */
361
- declare const shouldRequestDevice: (request: InputDeviceConstraint | undefined, tracks: MediaStreamTrack[], currentDevices: MediaDeviceInfoLike[]) => boolean;
362
- declare const isStreamingRequestedDevicesBase: (request: MediaDeviceRequest, tracksOrDevices: {
363
- audio?: MediaDeviceInfoLike | MediaStreamTrack[];
364
- video?: MediaDeviceInfoLike | MediaStreamTrack[];
365
- }, devices: MediaDeviceInfoLike[]) => {
366
- audio: boolean;
367
- video: boolean;
368
- };
369
- /**
370
- * Check if provided request has already been fulfilled
371
- *
372
- * @param request - A media request constraints
373
- * @param stream - Current media stream
374
- *
375
- * @returns
376
- * audio - The stream is using the same device as requested if `true`
377
- * video - The stream is using the same device as requested if `true`
378
- */
379
- declare const isStreamingRequestedDevices: (request: MediaDeviceRequest, stream: MediaStream | undefined, devices: MediaDeviceInfoLike[]) => {
380
- audio: boolean;
381
- video: boolean;
382
- };
383
- /**
384
- * Find in the list of devices which has permissions granted
385
- *
386
- * From MDN:
387
- * For security reasons,the label field is always blank unless an active media stream
388
- * exists or the user has granted persistent permission for media device access.
389
- *
390
- * @param devices - A list of media devices from
391
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
392
- *
393
- * @returns List of devices that has permission granted
394
- *
395
- * @beta
396
- */
397
- declare const findPermissionGrantedDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
398
- /**
399
- * A wrapper for `navigator.permissions.query` with fallback to use
400
- * `navigator.mediaDevices.enumerateDevices` to guess the `PermissionState`
401
- *
402
- * @param anyActiveStream - Has ever got an active stream to help the fallback to
403
- * guess the state more accurately
404
- */
405
- declare const getInputDevicePermissionState: (anyActiveStream?: boolean) => Promise<InputDevicePermission>;
406
- /**
407
- * Find current audio output id to be used to set as sinkId
408
- *
409
- * If you set the stale deviceId to setSink it will throw exception.
410
- * So we want to check if audio output id still exist.
411
- *
412
- * @param audioOutput - Audio output as `MediaDeviceInfo`
413
- * @param devices - A list of media devices from
414
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
415
- *
416
- * @returns Audio output id or empty string if couldn't find it.
417
- *
418
- * @beta
419
- */
420
- declare const findCurrentAudioOutputId: (audioOutput?: MediaDeviceInfoLike, devices?: MediaDeviceInfoLike[]) => string;
421
- /**
422
- * Find videoinput device id in the stream
423
- *
424
- * @param stream - Media stream to do the lookup
425
- *
426
- * @returns A object may contains the devices
427
- *
428
- * @beta
429
- */
430
- declare const findCurrentVideoInputDeviceIdFromStream: (stream: MediaStream) => string | undefined;
431
- /**
432
- * Finds device with given deviceId
433
- *
434
- * @param devices - A list of media devices from
435
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
436
- * @param deviceId - id that represents desired device
437
- *
438
- * @returns device with given deviceId
439
- *
440
- * @beta
441
- */
442
- declare const findDeviceWithDeviceId: (devices: MediaDeviceInfoLike[], deviceId: string) => MediaDeviceInfoLike | undefined;
443
- /**
444
- * Find in the list of devices with given MediaDeviceKind
445
- *
446
- * @param devices - A list of media devices from
447
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
448
- * @param kind - A list of media devices from
449
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
450
- *
451
- * @returns List of devices that have required MediaDeviceKind
452
- *
453
- * @beta
454
- */
455
- declare const findDevicesByKind: (kind: MediaDeviceKind) => (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
456
- /**
457
- * Find in the list of devices only the audio input ones
458
- *
459
- * @param devices - A list of media devices from
460
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
461
- *
462
- * @returns List of devices that are audio inputs
463
- *
464
- * @beta
465
- */
466
- declare const findAudioInputDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
467
- /**
468
- * Find in the list of devices only the video input ones
469
- *
470
- * @param devices - A list of media devices from
471
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
472
- *
473
- * @returns List of devices that are video inputs
474
- *
475
- * @beta
476
- */
477
- declare const findVideoInputDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
478
- /**
479
- * Find in the list of devices only the audio output ones
480
- *
481
- * @param devices - A list of media devices from
482
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
483
- *
484
- * @returns List of devices that are audio outputs
485
- *
486
- * @beta
487
- */
488
- declare const findAudioOutputDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
489
- /**
490
- * Set `MediaStreamTrack['enabled']` according to `mute` param for the provided `stream`
491
- *
492
- * @param stream - Media stream
493
- * @param mute - disable or enable the audio stream
494
- * @param mediaType - Can either be 'audio', 'video' or 'all'
495
- * @defaultValue
496
- * 'all'
497
- *
498
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/enabled
499
- *
500
- * @beta
501
- */
502
- declare const muteStreamTrack: (stream?: MediaStream) => (mute: boolean, mediaType?: 'audio' | 'video' | 'all') => void;
503
- /**
504
- * Stops all tracks in the given stream
505
- *
506
- * Immediately after calling stop(), the readyState property is set to `ended`.
507
- * Note that the `ended` event will not be fired in this situation
508
- * https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop#description
509
- *
510
- * @param stream - `MediaStream` which we mutate
511
- * @param onStopped - callback to be called when the track is stopped
512
- */
513
- declare const stopMediaStream: (stream: MediaStream | undefined, onStopped?: ((track: MediaStreamTrack) => void) | undefined) => void;
514
- /**
515
- * Checks that tracks with a given type are enabled in the stream
516
- *
517
- * @param stream - `MediaStream` used for comparison
518
- * @param type - `MediaInput` used for comparison
519
- *
520
- * @returns Return true when all the tracks are enabled false otherwise
521
- *
522
- * @beta
523
- */
524
- declare const areTracksEnabled: (stream: MediaStream | undefined, type: 'audio' | 'video') => boolean;
525
- /**
526
- * Check if list contains media inputs
527
- *
528
- * @param devices - A list of media devices from
529
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
530
- *
531
- * @returns True when some media inputs false otherwise
532
- *
533
- * @beta
534
- */
535
- declare const hasAudioOrVideoInputs: (devices: MediaDeviceInfoLike[]) => boolean;
536
- /**
537
- * Check if list contains audio inputs
538
- *
539
- * @param devices - A list of media devices from
540
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
541
- *
542
- * @returns True when some audio inputs false otherwise
543
- *
544
- * @beta
545
- */
546
- declare const hasAudioInputs: (devices: MediaDeviceInfoLike[]) => boolean;
547
- /**
548
- * Check if list contains video inputs
549
- *
550
- * @param devices - A list of media devices from
551
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
552
- *
553
- * @returns True when some video inputs false otherwise
554
- *
555
- * @beta
556
- */
557
- declare const hasVideoInputs: (devices: MediaDeviceInfoLike[]) => boolean;
558
- /**
559
- * Check if provided devices have any granted input device
560
- *
561
- * @param devices - The devices to check
562
- */
563
- declare const hasAnyGrantedInput: (devices: MediaDeviceInfoLike[]) => boolean;
564
- /**
565
- * Check if provided devices have any video and audio inputs
566
- *
567
- * @param devices - The devices to lookup
568
- * @param grantedOnly - When it is `true`, the device label is also taken into
569
- * consideration
570
- * @defaultValue `false`
571
- *
572
- * @returns A tuple of `[anyAudioInput, anyVideoInput]`, e.g. `[true, false]`
573
- * means there is audio input but no video input
574
- */
575
- declare const hasAnyInputs: (devices: MediaDeviceInfoLike[], grantedOnly?: boolean) => [boolean, boolean];
576
- /**
577
- * An utility function to check the input device has been changed
578
- *
579
- * @param oldInput - The previous input device
580
- * @param newInput - The current input device
581
- */
582
- declare const hasChangedInput: (oldInput: MediaDeviceInfoLike | undefined, newInput: MediaDeviceInfoLike | undefined) => boolean;
583
- /**
584
- * An utility function to check if facing mode is supported by interpreting the
585
- * device label and the API `getSupportedConstraints`
586
- *
587
- * @remarks
588
- * Only support snooping the label for English
589
- *
590
- * @param currentDevices - Current list of devices available
591
- * @param getSupportedConstraints - A function to get supported constraints,
592
- * i.e. `navigator.mediaDevices.getSupportedConstraints()`
593
- * @param tracks - Current video input track
594
- */
595
- declare const areMultipleFacingModeSupported: (currentDevices: MediaDeviceInfoLike[], getSupportedConstraints?: () => MediaTrackSupportedConstraints) => boolean;
596
- /**
597
- * Interpret the current facing mode from the provided track, and try to get the
598
- * mode from settings, or use the label to guess the facing mode when facingMode
599
- * is not supported from settings
600
- *
601
- * @param currentTrack - The current video input track
602
- */
603
- declare const interpretCurrentFacingMode: (currentTrack: MediaStreamTrack | undefined) => FacingMode | undefined;
604
-
605
- declare const isAudioInput: (device: MediaDeviceInfoLike) => boolean;
606
- declare const isVideoInput: (device: MediaDeviceInfoLike) => boolean;
607
- declare const isAudioOutput: (device: MediaDeviceInfoLike) => boolean;
608
- /**
609
- * Check if provided device is a permission-granted device by inspecting the
610
- * device label
611
- *
612
- * @param device - The device to check
613
- *
614
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/label#value}
615
- **/
616
- declare const isDeviceGranted: (device: MediaDeviceInfoLike) => boolean;
617
- /**
618
- * Compare 2 devices to see if they are the same by `deviceId` or `label` as
619
- * a fallback
620
- *
621
- * @beta
622
- */
623
- declare const compareDevices: (deviceInfo: MediaDeviceInfoLike, key?: Exclude<keyof MediaDeviceInfoLike, 'kind' | 'settings'>) => (anotherDeviceInfo: MediaDeviceInfoLike) => boolean;
624
- /**
625
- * Lookup the the `device` from `devices` list
626
- *
627
- * @remarks
628
- * When we cannot find the device by `deviceId`, we compare the label as last
629
- * resort, and return the first one.
630
- *
631
- * @param deviceToFind - Provide a device info to be used for the searching
632
- * @param useFallback - Whether to use `label` as a fallback when there is no
633
- * match from using `deviceId`
634
- *
635
- * @beta
636
- */
637
- declare const findDevice: (deviceToFind: MediaDeviceInfoLike, useFallback?: boolean) => (devices: readonly MediaDeviceInfoLike[]) => MediaDeviceInfoLike | undefined;
638
-
639
- /**
640
- * Reference https://w3c.github.io/mediacapture-main/#dom-mediatrackconstraintset
641
- */
642
- declare const CONSTRAIN_STRING_KEYS: readonly ["facingMode", "resizeMode", "deviceId", "groupId"];
643
- declare const EXTENDED_CONSTRAIN_STRING_KEYS: readonly ["videoSegmentation", "videoSegmentationModel", "bgImageUrl", "contentHint"];
644
- type ExtendedConstrainStringKeys = (typeof EXTENDED_CONSTRAIN_STRING_KEYS)[number];
645
- type ConstrainStringKeys = (typeof CONSTRAIN_STRING_KEYS)[number];
646
- declare const CONSTRAIN_U_LONG_KEYS: readonly ["width", "height", "sampleRate", "sampleSize", "channelCount"];
647
- declare const EXTENDED_CONSTRAIN_U_LONG_KEYS: readonly ["backgroundBlurAmount", "edgeBlurAmount"];
648
- type ExtendedConstrainULongKeys = (typeof EXTENDED_CONSTRAIN_U_LONG_KEYS)[number];
649
- type ConstrainULongKeys = (typeof CONSTRAIN_U_LONG_KEYS)[number];
650
- declare const CONSTRAIN_DOUBLE_KEYS: readonly ["aspectRatio", "frameRate", "latency"];
651
- declare const EXTENDED_CONSTRAIN_DOUBLE_KEYS: readonly ["foregroundThreshold"];
652
- type ExtendedConstrainDoubleKeys = (typeof EXTENDED_CONSTRAIN_DOUBLE_KEYS)[number];
653
- type ConstrainDoubleKeys = (typeof CONSTRAIN_DOUBLE_KEYS)[number];
654
- declare const CONSTRAIN_BOOLEAN_KEYS: readonly ["echoCancellation", "autoGainControl", "noiseSuppression", "pan", "tilt", "zoom"];
655
- /**
656
- * Extends boolean constraint keys for our own implementation of the media
657
- * feature
658
- */
659
- declare const EXTENDED_CONSTRAIN_BOOLEAN_KEYS: readonly ["vad", "asd", "mixWithAdditionalMedia", "denoise", "flipHorizontal"];
660
- type ExtendedConstrainBooleanKeys = (typeof EXTENDED_CONSTRAIN_BOOLEAN_KEYS)[number];
661
- type ConstrainBooleanKeys = (typeof CONSTRAIN_BOOLEAN_KEYS)[number];
662
- /**
663
- * Check if provided is `MediaDeviceInfo`
664
- *
665
- * @beta
666
- */
667
- declare const isMediaDeviceInfo: (t: unknown) => t is MediaDeviceInfo;
668
- declare const isMediaDeviceInfoArray: (t: unknown) => t is MediaDeviceInfo[];
669
- declare const CONSTRAIN_PARAM_KEYS: readonly ["exact", "ideal"];
670
- type ConstrainParamKeys = (typeof CONSTRAIN_PARAM_KEYS)[number];
671
- declare const CONSTRAIN_RANGE_KEYS: readonly ["min", "max"];
672
- type ConstrainRangeKeys = (typeof CONSTRAIN_RANGE_KEYS)[number];
673
- type ConstrainRangeParamKeys = ConstrainParamKeys | ConstrainRangeKeys;
674
- /**
675
- * Check if provided is `MediaStreamTrack`
676
- *
677
- * @beta
678
- */
679
- declare const isMediaStreamTrack: (m: unknown) => m is MediaStreamTrack;
680
- declare const isFacingMode: (s: unknown) => s is "user" | "environment" | "left" | "right";
681
-
682
- /**
683
- * Check if provided constraint is an `exact` device constraint
684
- */
685
- declare const isExactDeviceConstraint: (constraint: InputDeviceConstraint | undefined) => boolean;
686
- /**
687
- * Merge base constraints with provided base constraints and another constraints
688
- */
689
- declare const mergeConstraints: (baseConstraints: InputConstraintSet | boolean | undefined) => (constraints: InputDeviceConstraint | undefined) => InputConstraintSet | boolean;
690
- type ConstrainNoneTuple = [undefined, 'ideal'];
691
- type ConstrainStringTuple = [string[], ConstrainParamKeys];
692
- type ConstrainBooleanTuple = [boolean, ConstrainParamKeys];
693
- type ConstrainNumber = number | Partial<Record<ConstrainRangeParamKeys, number>>;
694
- type ConstrainNumberTuple = [
695
- ConstrainNumber,
696
- ConstrainParamKeys | 'min-max'
697
- ];
698
- type ConstrainDeviceTuple = [MediaDeviceInfoLike[], ConstrainParamKeys];
699
- declare const getValueFromConstrainNumber: (constraint: ConstrainNumber) => number;
700
- declare const getFacingModeFromConstraintString: (constraint: string) => FacingMode | undefined;
701
- /**
702
- * Call applyConstraints foreach track accordingly
703
- *
704
- * @param tracks - Tracks to be applied
705
- * @param constraints - constraints to be applied
706
- */
707
- declare const applyConstraints: (tracks: MediaStreamTrack[] | undefined, constraints: MediaDeviceRequest) => Promise<void>;
708
- type ConstrainNumberKeys = ConstrainULongKeys | ConstrainDoubleKeys | ExtendedConstrainDoubleKeys | ExtendedConstrainULongKeys;
709
- type ConstrainStrings = Record<ConstrainStringKeys | ExtendedConstrainStringKeys, ConstrainStringTuple | ConstrainNoneTuple>;
710
- type ConstrainNumbers = Record<ConstrainNumberKeys, ConstrainNumberTuple | ConstrainNoneTuple>;
711
- type ConstrainBooleans = Record<ConstrainBooleanKeys | ExtendedConstrainBooleanKeys, ConstrainBooleanTuple | ConstrainNoneTuple>;
712
- type ConstrainDevices = Record<'device', ConstrainDeviceTuple | ConstrainNoneTuple>;
713
- type Constraints = ConstrainStrings & ConstrainNumbers & ConstrainBooleans & ConstrainDevices;
714
- /**
715
- * Extract the constraints with provided keys
716
- *
717
- * @param keys - The keys to be used for the extraction
718
- * @param constraints - The constraints to be used for the extraction
719
- *
720
- * @returns an object with the provided key and the value-param tuple
721
- *
722
- * @example
723
- *
724
- * ```typescript
725
- * const device = {deviceId: 'xxxx', label: 'abc', kind: 'audioinput'};
726
- * const constraints = { device, noiseSuppression: true };
727
- * const extract = extractConstraintsWithKeys(['device', 'noiseSuppression']);
728
- * const {
729
- * device: [devices, deviceParam],
730
- * noiseSuppression: [noiseSuppression, noiseSuppressionParam],
731
- * } = extract(constraints);
732
- * expect(devices).toEqual([device]);
733
- * expect(deviceParam).toEqual('ideal');
734
- * expect(noiseSuppression).toEqual(true);
735
- * expect(noiseSuppressionParam).toEqual('ideal');
736
- * ```
737
- */
738
- declare const extractConstraintsWithKeys: <T extends "deviceId" | "groupId" | "facingMode" | "resizeMode" | "videoSegmentation" | "videoSegmentationModel" | "bgImageUrl" | "contentHint" | ConstrainNumberKeys | "echoCancellation" | "autoGainControl" | "noiseSuppression" | "pan" | "tilt" | "zoom" | "vad" | "asd" | "mixWithAdditionalMedia" | "denoise" | "flipHorizontal" | "device">(keys: T[]) => (constraints: InputDeviceConstraint | undefined) => Pick<Constraints, T>;
739
- /**
740
- * Find device from the device list with provided constraints
741
- *
742
- * @param constraints - The constraints to be used for the lookup
743
- * @param devices - The devices to be used for the lookup
744
- *
745
- * @returns `true` means it can be any devices, `undefined` means not found,
746
- * otherwise, the matched device will be returned
747
- */
748
- declare const findDeviceFromConstraints: (constraints: InputDeviceConstraint | undefined, devices: MediaDeviceInfoLike[]) => boolean | MediaDeviceInfoLike | undefined;
749
- /**
750
- * Relax input constraints to enable looking up the device by `deviceId` as well
751
- * as `label` as a fallback as a best effort to get a similar device when
752
- * possible.
753
- *
754
- * @param input - The input constraints to be relaxed
755
- * @param devices - The current device list
756
- */
757
- declare const relaxInputConstraint: (input: InputDeviceConstraint | undefined, devices: MediaDeviceInfoLike[]) => InputDeviceConstraint | undefined;
758
-
759
- /**
760
- * MediaStreamTrack Events
761
- *
762
- * @remarks
763
- * See MDN {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#Events | Events}
764
- *
765
- * @beta
766
- */
767
- declare enum MediaEventType {
768
- /**
769
- * Sent to the MediaStreamTrack when the value of the muted property is
770
- * changed to true, indicating that the track is unable to provide data
771
- * temporarily (such as when the network is experiencing a service
772
- * malfunction).
773
- */
774
- Mute = "mute",
775
- /**
776
- * Sent to the track when data becomes available again, ending the muted state.
777
- */
778
- Unmute = "unmute",
779
- /**
780
- * Sent when playback of the track ends (when the value readyState changes to
781
- * ended).
782
- */
783
- Ended = "ended",
784
- /**
785
- * Fired when a media input or output device is attached to or removed from
786
- * the user's computer.
787
- *
788
- * @remarks
789
- * See MDN {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices#Events | Events}
790
- */
791
- DevicesChanged = "devices:changed",
792
- /**
793
- * Found new devices from authorized device list
794
- */
795
- DevicesFound = "devices:found",
796
- /**
797
- * Lost devices from authorized device list
798
- */
799
- DevicesLost = "devices:lost",
800
- /**
801
- * Lost device from authorized device list
802
- */
803
- DeviceLost = "device:lost",
804
- /**
805
- * Unauthorized devices
806
- */
807
- DevicesUnauthorized = "devices:unauthorized",
808
- /**
809
- * No Input Devices, and no further device events will be emitted
810
- */
811
- NoInputDevices = "devices:noinput",
812
- /**
813
- * Other errors
814
- */
815
- Error = "error",
816
- /**
817
- * When stream
818
- */
819
- Stream = "stream"
820
- }
821
- /**
822
- * Event object by MediaEventType
823
- *
824
- * @beta
825
- */
826
- type Events = {
827
- id: string;
828
- type: MediaEventType.Mute;
829
- } | {
830
- id: string;
831
- type: MediaEventType.Unmute;
832
- } | {
833
- id: string;
834
- type: MediaEventType.Ended;
835
- } | {
836
- devices: MediaDeviceInfoLike[];
837
- type: MediaEventType.DevicesChanged;
838
- } | {
839
- devices: MediaDeviceInfoLike[];
840
- authorizedDevices: MediaDeviceInfoLike[];
841
- unauthorizedDevices: MediaDeviceInfoLike[];
842
- type: MediaEventType.DevicesFound;
843
- } | {
844
- devices: MediaDeviceInfoLike[];
845
- authorizedDevices: MediaDeviceInfoLike[];
846
- unauthorizedDevices: MediaDeviceInfoLike[];
847
- type: MediaEventType.DevicesLost;
848
- } | {
849
- devices: MediaDeviceInfoLike[];
850
- authorizedDevices: MediaDeviceInfoLike[];
851
- type: MediaEventType.DevicesUnauthorized;
852
- } | {
853
- devices: MediaDeviceInfoLike[];
854
- type: MediaEventType.NoInputDevices;
855
- } | {
856
- device: MediaDeviceInfoLike;
857
- type: MediaEventType.DeviceLost;
858
- } | {
859
- error: Error;
860
- type: MediaEventType.Error;
861
- } | {
862
- facingMode: boolean;
863
- stream: MediaStream;
864
- type: MediaEventType.Stream;
865
- video: boolean;
866
- };
867
- /**
868
- * Custom Media Event
869
- * @beta
870
- */
871
- type MediaEvent = CustomEvent<Events>;
872
-
873
- /**
874
- * Create a MediaStreamTrack's native events subscription
875
- *
876
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#events
877
- *
878
- * @param track - The track used for the subscription
879
- * @param handlers - An object contains the event handlers
880
- */
881
- declare const createStreamTrackEventSubscriptions: (track: MediaStreamTrack, handlers: StreamTrackEventHandlers) => Unsubscribe;
882
-
883
- /**
884
- * Log meta and message with respective log level
885
- */
886
- type LogMethod = (meta: unknown, message?: string) => void;
887
- declare enum LogLevels {
888
- trace = 10,
889
- debug = 20,
890
- info = 30,
891
- warn = 40,
892
- error = 50,
893
- fatal = 60,
894
- silent
895
- }
896
- type LogLevelsString = keyof typeof LogLevels;
897
- type LogMethods = {
898
- [key in LogLevelsString]: LogMethod;
899
- };
900
- /**
901
- * Log Level from high to low, "fatal" | "error" | "warn" | "info" | "debug" | "trace"
902
- * Typically, debug and trace logs are only valid for development, and not needed in production
903
- */
904
- interface Logger extends LogMethods {
905
- /**
906
- * Adds a value to the redaction set, which makes it replaced by [REDACTED] when logged to file.
907
- *
908
- * @remarks
909
- * The redaction set is applied globally, and only applies to the log file, not console logs.
910
- *
911
- * @param value - the string to redact
912
- */
913
- redact(value: string): void;
914
- }
915
-
916
- declare function setLogger(newLogger: Logger): void;
917
-
918
- type ExtractObjectValueTypes<T extends object> = T[keyof T];
919
- /**
920
- * The `DisplayCaptureSurfaceType` enumeration describes the different types of
921
- * display surface
922
- *
923
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype}
924
- */
925
- declare const DISPLAY_CAPTURE_SURFACE_TYPE: {
926
- readonly Monitor: "monitor";
927
- readonly Window: "window";
928
- readonly Browser: "browser";
929
- };
930
- /**
931
- * The `DisplayCaptureSurfaceType` enumeration describes the different types of
932
- * display surface
933
- *
934
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype}
935
- */
936
- type DisplayCaptureSurfaceType = ExtractObjectValueTypes<typeof DISPLAY_CAPTURE_SURFACE_TYPE>;
937
- /**
938
- * The `CursorCaptureConstraint` enumerates the conditions under which the
939
- * cursor is captured.
940
- *
941
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint}
942
- */
943
- declare const CURSOR_CAPTURE_CONSTRAINT: {
944
- readonly Never: "never";
945
- readonly Always: "always";
946
- readonly Motion: "motion";
947
- };
948
- /**
949
- * The `CursorCaptureConstraint` enumerates the conditions under which the
950
- * cursor is captured.
951
- *
952
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint}
953
- */
954
- type CursorCaptureConstraint = ExtractObjectValueTypes<typeof CURSOR_CAPTURE_CONSTRAINT>;
955
- declare const INCLUDE_EXCLUDE_CONSTRAINT: {
956
- readonly Include: "include";
957
- readonly Exclude: "exclude";
958
- };
959
- type IncludeExcludeConstraint = ExtractObjectValueTypes<typeof INCLUDE_EXCLUDE_CONSTRAINT>;
960
-
961
- /**
962
- * A fallback implementation of `monitorTypeSurfaces` limitation when it is not
963
- * supported by the current browser and the source of the `displaySurface` is
964
- * available.
965
- *
966
- * @param constraints - The constraints used to request display media.
967
- * @param stream - The MediaStream returned from the requesting display media.
968
- */
969
- declare const limitSharingMonitorInterface: (constraints: DisplayMediaOptions, stream: MediaStream) => MediaStream;
970
-
971
1
  /**
972
2
  * media-control is meant to extend the mediaDevices api methods such as
973
3
  * `getUserMedia`, `enumerateDevices` and events on media streams and tracks.
@@ -977,31 +7,41 @@ declare const limitSharingMonitorInterface: (constraints: DisplayMediaOptions, s
977
7
  *
978
8
  * @packageDocumentation
979
9
  */
980
-
10
+ import { DeviceChangedChanges, areMultipleFacingModeSupported, areTracksEnabled, createTrackDevicesChanges, deviceChanged, findAudioInputDevices, findAudioOutputDevices, findCurrentAudioOutputId, findCurrentVideoInputDeviceIdFromStream, findDeviceWithDeviceId, findDevicesByKind, findMediaInputFromMediaStreamTrack, findMediaInputFromStream, findPermissionGrantedDevices, findVideoInputDevices, getDevices, getInputDevicePermissionState, hasAnyGrantedInput, hasAnyInputs, hasAudioInputs, hasAudioOrVideoInputs, hasChangedInput, hasRequestingDevice, hasVideoInputs, interpretCurrentFacingMode, isRequestedInputDevice, isRequestedInputTrack, isRequestedResolution, isStreamingRequestedDevices, isStreamingRequestedDevicesBase, muteStreamTrack, shouldRequestDevice, stopMediaStream, toKey, toMediaDeviceInfo, toMediaDeviceInfoLike } from './devices';
11
+ import { compareDevices, findDevice, isAudioOutput, isVideoInput, isAudioInput, isDeviceGranted } from './utils';
12
+ import { mergeConstraints, relaxInputConstraint, findDeviceFromConstraints, isExactDeviceConstraint, extractConstraintsWithKeys, applyConstraints, getValueFromConstrainNumber, getFacingModeFromConstraintString } from './constraints';
13
+ import { MediaEvent, Events, MediaEventType } from './eventEmitter';
14
+ import { createStreamTrackEventSubscriptions } from './streams';
15
+ import { MediaDeviceRequest, MediaDeviceFailure, MediaDeviceKinds, MediaDeviceInfoLike, MediaStreamTrackLike, MediaInput, Unsubscribe, StreamTrackEventHandlers, InputConstraintSet, FacingMode, DisplayMediaOptions } from './types';
16
+ import { isMediaDeviceInfo, isMediaDeviceInfoArray, isMediaStreamTrack, isFacingMode } from './typeGuards';
17
+ export { setLogger } from './logger';
981
18
  declare const
982
19
  /**
983
20
  * Get MediaStream with provided {@link MediaDeviceRequest | input constraints}
984
21
  */
985
- getUserMedia: ({ audio, video, }: MediaDeviceRequest) => Promise<MediaStream>;
986
- declare const /**
22
+ getUserMedia: ({ audio, video, }: MediaDeviceRequest) => Promise<MediaStream>,
23
+ /**
987
24
  * Set default media stream constraints
988
25
  *
989
26
  * A {@link
990
27
  * https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints |
991
28
  * MediaStreamConstraints} object specifying the types of media to request, along with any requirements for each type.
992
29
  */
993
- setDefaultConstraints: (newConstraints: MediaStreamConstraints) => void;
994
- declare const /**
30
+ setDefaultConstraints: (newConstraints: MediaStreamConstraints) => void,
31
+ /**
995
32
  * Subscribe media events
996
33
  */
997
34
  subscribe: (listener: (event: MediaEvent) => void) => () => void;
998
-
35
+ export { getUserMedia, setDefaultConstraints, subscribe };
36
+ export { DeviceChangedChanges, DisplayMediaOptions, Events, FacingMode, InputConstraintSet, MediaDeviceFailure, MediaDeviceInfoLike, MediaDeviceKinds, MediaDeviceRequest, MediaEvent, MediaEventType, MediaInput, MediaStreamTrackLike, StreamTrackEventHandlers, Unsubscribe, applyConstraints, areMultipleFacingModeSupported, areTracksEnabled, compareDevices, createStreamTrackEventSubscriptions, createTrackDevicesChanges, deviceChanged, extractConstraintsWithKeys, findAudioInputDevices, findAudioOutputDevices, findCurrentAudioOutputId, findCurrentVideoInputDeviceIdFromStream, findDevice, findDeviceFromConstraints, findDeviceWithDeviceId, findDevicesByKind, findMediaInputFromMediaStreamTrack, findMediaInputFromStream, findPermissionGrantedDevices, findVideoInputDevices, getDevices, getFacingModeFromConstraintString, getInputDevicePermissionState, getValueFromConstrainNumber, hasAnyGrantedInput, hasAnyInputs, hasAudioInputs, hasAudioOrVideoInputs, hasChangedInput, hasRequestingDevice, hasVideoInputs, interpretCurrentFacingMode, isAudioInput, isAudioOutput, isDeviceGranted, isExactDeviceConstraint, isFacingMode, isMediaDeviceInfo, isMediaDeviceInfoArray, isMediaStreamTrack, isRequestedInputDevice, isRequestedInputTrack, isRequestedResolution, isStreamingRequestedDevices, isStreamingRequestedDevicesBase, isVideoInput, mergeConstraints, muteStreamTrack, relaxInputConstraint, shouldRequestDevice, stopMediaStream, toKey, toMediaDeviceInfo, toMediaDeviceInfoLike, };
37
+ export * from './constants';
38
+ export * from './displayMedia';
999
39
  /**
1000
40
  * MediaControl Interface
1001
41
  *
1002
42
  * @beta
1003
43
  */
1004
- interface MediaControl {
44
+ export interface MediaControl {
1005
45
  /** {@inheritDoc deviceChanged} */
1006
46
  deviceChanged: typeof deviceChanged;
1007
47
  /** {@inheritDoc getDevices} */
@@ -1015,5 +55,4 @@ interface MediaControl {
1015
55
  /** {@inheritDoc subscribe} */
1016
56
  subscribe: typeof subscribe;
1017
57
  }
1018
-
1019
- export { CURSOR_CAPTURE_CONSTRAINT, CursorCaptureConstraint, DISPLAY_CAPTURE_SURFACE_TYPE, DeviceChangedChanges, DisplayCaptureSurfaceType, DisplayMediaOptions, Events, FacingMode, INCLUDE_EXCLUDE_CONSTRAINT, IncludeExcludeConstraint, InputConstraintSet, InputDevicePermission, MediaControl, MediaDeviceFailure, MediaDeviceInfoLike, MediaDeviceKinds, MediaDeviceRequest, MediaEvent, MediaEventType, MediaInput, MediaStreamTrackLike, StreamTrackEventHandlers, Unsubscribe, applyConstraints, areMultipleFacingModeSupported, areTracksEnabled, compareDevices, createStreamTrackEventSubscriptions, createTrackDevicesChanges, deviceChanged, extractConstraintsWithKeys, findAudioInputDevices, findAudioOutputDevices, findCurrentAudioOutputId, findCurrentVideoInputDeviceIdFromStream, findDevice, findDeviceFromConstraints, findDeviceWithDeviceId, findDevicesByKind, findMediaInputFromMediaStreamTrack, findMediaInputFromStream, findPermissionGrantedDevices, findVideoInputDevices, getDevices, getFacingModeFromConstraintString, getInputDevicePermissionState, getUserMedia, getValueFromConstrainNumber, hasAnyGrantedInput, hasAnyInputs, hasAudioInputs, hasAudioOrVideoInputs, hasChangedInput, hasRequestingDevice, hasVideoInputs, interpretCurrentFacingMode, isAudioInput, isAudioOutput, isDeviceGranted, isExactDeviceConstraint, isFacingMode, isMediaDeviceInfo, isMediaDeviceInfoArray, isMediaStreamTrack, isRequestedInputDevice, isRequestedInputTrack, isRequestedResolution, isStreamingRequestedDevices, isStreamingRequestedDevicesBase, isVideoInput, limitSharingMonitorInterface, mergeConstraints, muteStreamTrack, relaxInputConstraint, setDefaultConstraints, setLogger, shouldRequestDevice, stopMediaStream, subscribe, toKey, toMediaDeviceInfoLike };
58
+ export type { InputDevicePermission } from './types';