@pexip/media-control 17.3.0 → 18.0.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,979 +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
- declare const toMediaDeviceInfo: (info: MediaDeviceInfoLike) => {
321
- deviceId: string;
322
- groupId: string;
323
- kind: MediaDeviceKind;
324
- label: string;
325
- };
326
- /**
327
- * Find the MediaDeviceInfo from provided MediaDeviceInfo[] by comparing with
328
- * provided MediaStreamTrack
329
- *
330
- * @param devices - A device list used for the searching
331
- * @param track - A track for the searching criteria
332
- *
333
- * @returns `MediaDeviceInfo` if found, otherwise `undefined`
334
- *
335
- * @beta
336
- */
337
- declare const findMediaInputFromMediaStreamTrack: (devices: MediaDeviceInfoLike[]) => (track?: MediaStreamTrack | undefined) => MediaDeviceInfoLike | undefined;
338
- /**
339
- * Find media input from media stream
340
- *
341
- * @param devices - A list of media devices from
342
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
343
- * @param stream - A media stream used for the search criteria
344
- *
345
- * @returns A object may contains the devices
346
- *
347
- * @beta
348
- */
349
- declare const findMediaInputFromStream: (devices: MediaDeviceInfoLike[]) => (stream: MediaStream | undefined) => MediaInput;
350
- declare const isRequestedResolution: (request: InputDeviceConstraint | undefined, response: MediaDeviceInfoLike | undefined) => boolean;
351
- declare const isRequestedInputDevice: (request: InputDeviceConstraint | undefined, response: MediaDeviceInfoLike | undefined) => boolean;
352
- /**
353
- * Compare request and the input to see if the request has been fulfilled
354
- */
355
- declare const isRequestedInputTrack: (request: InputDeviceConstraint | undefined, current: MediaStreamTrack | MediaDeviceInfoLike | undefined) => boolean;
356
- declare const hasRequestingDevice: (request: InputDeviceConstraint | undefined, kind: MediaDeviceKind, currentDevices: MediaDeviceInfoLike[]) => boolean;
357
- /**
358
- * Decide if we should send a new gUM request based on the inputs
359
- *
360
- * @param request - Requesting input device constraint
361
- * @param tracks - The current media stream tracks
362
- * @param currentDevices - The current list of device of the same kind of the
363
- * request
364
- *
365
- * @returns `true` means the request should be conducted, otherwise `false`.
366
- */
367
- declare const shouldRequestDevice: (request: InputDeviceConstraint | undefined, tracks: MediaStreamTrack[], currentDevices: MediaDeviceInfoLike[]) => boolean;
368
- declare const isStreamingRequestedDevicesBase: (request: MediaDeviceRequest, tracksOrDevices: {
369
- audio?: MediaDeviceInfoLike | MediaStreamTrack[];
370
- video?: MediaDeviceInfoLike | MediaStreamTrack[];
371
- }, devices: MediaDeviceInfoLike[]) => {
372
- audio: boolean;
373
- video: boolean;
374
- };
375
- /**
376
- * Check if provided request has already been fulfilled
377
- *
378
- * @param request - A media request constraints
379
- * @param stream - Current media stream
380
- *
381
- * @returns
382
- * audio - The stream is using the same device as requested if `true`
383
- * video - The stream is using the same device as requested if `true`
384
- */
385
- declare const isStreamingRequestedDevices: (request: MediaDeviceRequest, stream: MediaStream | undefined, devices: MediaDeviceInfoLike[]) => {
386
- audio: boolean;
387
- video: boolean;
388
- };
389
- /**
390
- * Find in the list of devices which has permissions granted
391
- *
392
- * From MDN:
393
- * For security reasons,the label field is always blank unless an active media stream
394
- * exists or the user has granted persistent permission for media device access.
395
- *
396
- * @param devices - A list of media devices from
397
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
398
- *
399
- * @returns List of devices that has permission granted
400
- *
401
- * @beta
402
- */
403
- declare const findPermissionGrantedDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
404
- /**
405
- * A wrapper for `navigator.permissions.query` with fallback to use
406
- * `navigator.mediaDevices.enumerateDevices` to guess the `PermissionState`
407
- *
408
- * @param anyActiveStream - Has ever got an active stream to help the fallback to
409
- * guess the state more accurately
410
- */
411
- declare const getInputDevicePermissionState: (anyActiveStream?: boolean) => Promise<InputDevicePermission>;
412
- /**
413
- * Find current audio output id to be used to set as sinkId
414
- *
415
- * If you set the stale deviceId to setSink it will throw exception.
416
- * So we want to check if audio output id still exist.
417
- *
418
- * @param audioOutput - Audio output as `MediaDeviceInfo`
419
- * @param devices - A list of media devices from
420
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
421
- *
422
- * @returns Audio output id or empty string if couldn't find it.
423
- *
424
- * @beta
425
- */
426
- declare const findCurrentAudioOutputId: (audioOutput?: MediaDeviceInfoLike, devices?: MediaDeviceInfoLike[]) => string;
427
- /**
428
- * Find videoinput device id in the stream
429
- *
430
- * @param stream - Media stream to do the lookup
431
- *
432
- * @returns A object may contains the devices
433
- *
434
- * @beta
435
- */
436
- declare const findCurrentVideoInputDeviceIdFromStream: (stream: MediaStream) => string | undefined;
437
- /**
438
- * Finds device with given deviceId
439
- *
440
- * @param devices - A list of media devices from
441
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
442
- * @param deviceId - id that represents desired device
443
- *
444
- * @returns device with given deviceId
445
- *
446
- * @beta
447
- */
448
- declare const findDeviceWithDeviceId: (devices: MediaDeviceInfoLike[], deviceId: string) => MediaDeviceInfoLike | undefined;
449
- /**
450
- * Find in the list of devices with given MediaDeviceKind
451
- *
452
- * @param devices - A list of media devices from
453
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
454
- * @param kind - A list of media devices from
455
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
456
- *
457
- * @returns List of devices that have required MediaDeviceKind
458
- *
459
- * @beta
460
- */
461
- declare const findDevicesByKind: (kind: MediaDeviceKind) => (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
462
- /**
463
- * Find in the list of devices only the audio input ones
464
- *
465
- * @param devices - A list of media devices from
466
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
467
- *
468
- * @returns List of devices that are audio inputs
469
- *
470
- * @beta
471
- */
472
- declare const findAudioInputDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
473
- /**
474
- * Find in the list of devices only the video input ones
475
- *
476
- * @param devices - A list of media devices from
477
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
478
- *
479
- * @returns List of devices that are video inputs
480
- *
481
- * @beta
482
- */
483
- declare const findVideoInputDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
484
- /**
485
- * Find in the list of devices only the audio output ones
486
- *
487
- * @param devices - A list of media devices from
488
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
489
- *
490
- * @returns List of devices that are audio outputs
491
- *
492
- * @beta
493
- */
494
- declare const findAudioOutputDevices: (devices: MediaDeviceInfoLike[]) => MediaDeviceInfoLike[];
495
- /**
496
- * Set `MediaStreamTrack['enabled']` according to `mute` param for the provided `stream`
497
- *
498
- * @param stream - Media stream
499
- * @param mute - disable or enable the audio stream
500
- * @param mediaType - Can either be 'audio', 'video' or 'all'
501
- * @defaultValue
502
- * 'all'
503
- *
504
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/enabled
505
- *
506
- * @beta
507
- */
508
- declare const muteStreamTrack: (stream?: MediaStream) => (mute: boolean, mediaType?: 'audio' | 'video' | 'all') => void;
509
- /**
510
- * Stops all tracks in the given stream
511
- *
512
- * Immediately after calling stop(), the readyState property is set to `ended`.
513
- * Note that the `ended` event will not be fired in this situation
514
- * https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop#description
515
- *
516
- * @param stream - `MediaStream` which we mutate
517
- * @param onStopped - callback to be called when the track is stopped
518
- */
519
- declare const stopMediaStream: (stream: MediaStream | undefined, onStopped?: ((track: MediaStreamTrack) => void) | undefined) => void;
520
- /**
521
- * Checks that tracks with a given type are enabled in the stream
522
- *
523
- * @param stream - `MediaStream` used for comparison
524
- * @param type - `MediaInput` used for comparison
525
- *
526
- * @returns Return true when all the tracks are enabled false otherwise
527
- *
528
- * @beta
529
- */
530
- declare const areTracksEnabled: (stream: MediaStream | undefined, type: 'audio' | 'video') => boolean;
531
- /**
532
- * Check if list contains media inputs
533
- *
534
- * @param devices - A list of media devices from
535
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
536
- *
537
- * @returns True when some media inputs false otherwise
538
- *
539
- * @beta
540
- */
541
- declare const hasAudioOrVideoInputs: (devices: MediaDeviceInfoLike[]) => boolean;
542
- /**
543
- * Check if list contains audio inputs
544
- *
545
- * @param devices - A list of media devices from
546
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
547
- *
548
- * @returns True when some audio inputs false otherwise
549
- *
550
- * @beta
551
- */
552
- declare const hasAudioInputs: (devices: MediaDeviceInfoLike[]) => boolean;
553
- /**
554
- * Check if list contains video inputs
555
- *
556
- * @param devices - A list of media devices from
557
- * `navigator.mediaDevices.enumerateDevices()`. Will be used for search target
558
- *
559
- * @returns True when some video inputs false otherwise
560
- *
561
- * @beta
562
- */
563
- declare const hasVideoInputs: (devices: MediaDeviceInfoLike[]) => boolean;
564
- /**
565
- * Check if provided devices have any granted input device
566
- *
567
- * @param devices - The devices to check
568
- */
569
- declare const hasAnyGrantedInput: (devices: MediaDeviceInfoLike[]) => boolean;
570
- /**
571
- * Check if provided devices have any video and audio inputs
572
- *
573
- * @param devices - The devices to lookup
574
- * @param grantedOnly - When it is `true`, the device label is also taken into
575
- * consideration
576
- * @defaultValue `false`
577
- *
578
- * @returns A tuple of `[anyAudioInput, anyVideoInput]`, e.g. `[true, false]`
579
- * means there is audio input but no video input
580
- */
581
- declare const hasAnyInputs: (devices: MediaDeviceInfoLike[], grantedOnly?: boolean) => [boolean, boolean];
582
- /**
583
- * An utility function to check the input device has been changed
584
- *
585
- * @param oldInput - The previous input device
586
- * @param newInput - The current input device
587
- */
588
- declare const hasChangedInput: (oldInput: MediaDeviceInfoLike | undefined, newInput: MediaDeviceInfoLike | undefined) => boolean;
589
- /**
590
- * An utility function to check if facing mode is supported by interpreting the
591
- * device label and the API `getSupportedConstraints`
592
- *
593
- * @remarks
594
- * Only support snooping the label for English
595
- *
596
- * @param currentDevices - Current list of devices available
597
- * @param getSupportedConstraints - A function to get supported constraints,
598
- * i.e. `navigator.mediaDevices.getSupportedConstraints()`
599
- * @param tracks - Current video input track
600
- */
601
- declare const areMultipleFacingModeSupported: (currentDevices: MediaDeviceInfoLike[], getSupportedConstraints?: () => MediaTrackSupportedConstraints) => boolean;
602
- /**
603
- * Interpret the current facing mode from the provided track, and try to get the
604
- * mode from settings, or use the label to guess the facing mode when facingMode
605
- * is not supported from settings
606
- *
607
- * @param currentTrack - The current video input track
608
- */
609
- declare const interpretCurrentFacingMode: (currentTrack: MediaStreamTrack | undefined) => FacingMode | undefined;
610
-
611
- declare const isAudioInput: (device: MediaDeviceInfoLike) => boolean;
612
- declare const isVideoInput: (device: MediaDeviceInfoLike) => boolean;
613
- declare const isAudioOutput: (device: MediaDeviceInfoLike) => boolean;
614
- /**
615
- * Check if provided device is a permission-granted device by inspecting the
616
- * device label
617
- *
618
- * @param device - The device to check
619
- *
620
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/label#value}
621
- **/
622
- declare const isDeviceGranted: (device: MediaDeviceInfoLike) => boolean;
623
- /**
624
- * Compare 2 devices to see if they are the same by `deviceId` or `label` as
625
- * a fallback
626
- *
627
- * @beta
628
- */
629
- declare const compareDevices: (deviceInfo: MediaDeviceInfoLike, key?: Exclude<keyof MediaDeviceInfoLike, 'kind' | 'settings'>) => (anotherDeviceInfo: MediaDeviceInfoLike) => boolean;
630
- /**
631
- * Lookup the the `device` from `devices` list
632
- *
633
- * @remarks
634
- * When we cannot find the device by `deviceId`, we compare the label as last
635
- * resort, and return the first one.
636
- *
637
- * @param deviceToFind - Provide a device info to be used for the searching
638
- * @param useFallback - Whether to use `label` as a fallback when there is no
639
- * match from using `deviceId`
640
- *
641
- * @beta
642
- */
643
- declare const findDevice: (deviceToFind: MediaDeviceInfoLike, useFallback?: boolean) => (devices: readonly MediaDeviceInfoLike[]) => MediaDeviceInfoLike | undefined;
644
-
645
- /**
646
- * Reference https://w3c.github.io/mediacapture-main/#dom-mediatrackconstraintset
647
- */
648
- declare const CONSTRAIN_STRING_KEYS: readonly ["facingMode", "resizeMode", "deviceId", "groupId"];
649
- declare const EXTENDED_CONSTRAIN_STRING_KEYS: readonly ["videoSegmentation", "videoSegmentationModel", "bgImageUrl", "contentHint"];
650
- type ExtendedConstrainStringKeys = (typeof EXTENDED_CONSTRAIN_STRING_KEYS)[number];
651
- type ConstrainStringKeys = (typeof CONSTRAIN_STRING_KEYS)[number];
652
- declare const CONSTRAIN_U_LONG_KEYS: readonly ["width", "height", "sampleRate", "sampleSize", "channelCount"];
653
- declare const EXTENDED_CONSTRAIN_U_LONG_KEYS: readonly ["backgroundBlurAmount", "edgeBlurAmount"];
654
- type ExtendedConstrainULongKeys = (typeof EXTENDED_CONSTRAIN_U_LONG_KEYS)[number];
655
- type ConstrainULongKeys = (typeof CONSTRAIN_U_LONG_KEYS)[number];
656
- declare const CONSTRAIN_DOUBLE_KEYS: readonly ["aspectRatio", "frameRate", "latency"];
657
- declare const EXTENDED_CONSTRAIN_DOUBLE_KEYS: readonly ["foregroundThreshold"];
658
- type ExtendedConstrainDoubleKeys = (typeof EXTENDED_CONSTRAIN_DOUBLE_KEYS)[number];
659
- type ConstrainDoubleKeys = (typeof CONSTRAIN_DOUBLE_KEYS)[number];
660
- declare const CONSTRAIN_BOOLEAN_KEYS: readonly ["echoCancellation", "autoGainControl", "noiseSuppression", "pan", "tilt", "zoom"];
661
- /**
662
- * Extends boolean constraint keys for our own implementation of the media
663
- * feature
664
- */
665
- declare const EXTENDED_CONSTRAIN_BOOLEAN_KEYS: readonly ["vad", "asd", "mixWithAdditionalMedia", "denoise", "flipHorizontal"];
666
- type ExtendedConstrainBooleanKeys = (typeof EXTENDED_CONSTRAIN_BOOLEAN_KEYS)[number];
667
- type ConstrainBooleanKeys = (typeof CONSTRAIN_BOOLEAN_KEYS)[number];
668
- /**
669
- * Check if provided is `MediaDeviceInfo`
670
- *
671
- * @beta
672
- */
673
- declare const isMediaDeviceInfo: (t: unknown) => t is MediaDeviceInfo;
674
- declare const isMediaDeviceInfoArray: (t: unknown) => t is MediaDeviceInfo[];
675
- declare const CONSTRAIN_PARAM_KEYS: readonly ["exact", "ideal"];
676
- type ConstrainParamKeys = (typeof CONSTRAIN_PARAM_KEYS)[number];
677
- declare const CONSTRAIN_RANGE_KEYS: readonly ["min", "max"];
678
- type ConstrainRangeKeys = (typeof CONSTRAIN_RANGE_KEYS)[number];
679
- type ConstrainRangeParamKeys = ConstrainParamKeys | ConstrainRangeKeys;
680
- /**
681
- * Check if provided is `MediaStreamTrack`
682
- *
683
- * @beta
684
- */
685
- declare const isMediaStreamTrack: (m: unknown) => m is MediaStreamTrack;
686
- declare const isFacingMode: (s: unknown) => s is "user" | "environment" | "left" | "right";
687
-
688
- /**
689
- * Check if provided constraint is an `exact` device constraint
690
- */
691
- declare const isExactDeviceConstraint: (constraint: InputDeviceConstraint | undefined) => boolean;
692
- /**
693
- * Merge base constraints with provided base constraints and another constraints
694
- */
695
- declare const mergeConstraints: (baseConstraints: InputConstraintSet | boolean | undefined) => (constraints: InputDeviceConstraint | undefined) => InputConstraintSet | boolean;
696
- type ConstrainNoneTuple = [undefined, 'ideal'];
697
- type ConstrainStringTuple = [string[], ConstrainParamKeys];
698
- type ConstrainBooleanTuple = [boolean, ConstrainParamKeys];
699
- type ConstrainNumber = number | Partial<Record<ConstrainRangeParamKeys, number>>;
700
- type ConstrainNumberTuple = [
701
- ConstrainNumber,
702
- ConstrainParamKeys | 'min-max'
703
- ];
704
- type ConstrainDeviceTuple = [MediaDeviceInfoLike[], ConstrainParamKeys];
705
- declare const getValueFromConstrainNumber: (constraint: ConstrainNumber) => number;
706
- declare const getFacingModeFromConstraintString: (constraint: string) => FacingMode | undefined;
707
- /**
708
- * Call applyConstraints foreach track accordingly
709
- *
710
- * @param tracks - Tracks to be applied
711
- * @param constraints - constraints to be applied
712
- */
713
- declare const applyConstraints: (tracks: MediaStreamTrack[] | undefined, constraints: MediaDeviceRequest) => Promise<void>;
714
- type ConstrainNumberKeys = ConstrainULongKeys | ConstrainDoubleKeys | ExtendedConstrainDoubleKeys | ExtendedConstrainULongKeys;
715
- type ConstrainStrings = Record<ConstrainStringKeys | ExtendedConstrainStringKeys, ConstrainStringTuple | ConstrainNoneTuple>;
716
- type ConstrainNumbers = Record<ConstrainNumberKeys, ConstrainNumberTuple | ConstrainNoneTuple>;
717
- type ConstrainBooleans = Record<ConstrainBooleanKeys | ExtendedConstrainBooleanKeys, ConstrainBooleanTuple | ConstrainNoneTuple>;
718
- type ConstrainDevices = Record<'device', ConstrainDeviceTuple | ConstrainNoneTuple>;
719
- type Constraints = ConstrainStrings & ConstrainNumbers & ConstrainBooleans & ConstrainDevices;
720
- /**
721
- * Extract the constraints with provided keys
722
- *
723
- * @param keys - The keys to be used for the extraction
724
- * @param constraints - The constraints to be used for the extraction
725
- *
726
- * @returns an object with the provided key and the value-param tuple
727
- *
728
- * @example
729
- *
730
- * ```typescript
731
- * const device = {deviceId: 'xxxx', label: 'abc', kind: 'audioinput'};
732
- * const constraints = { device, noiseSuppression: true };
733
- * const extract = extractConstraintsWithKeys(['device', 'noiseSuppression']);
734
- * const {
735
- * device: [devices, deviceParam],
736
- * noiseSuppression: [noiseSuppression, noiseSuppressionParam],
737
- * } = extract(constraints);
738
- * expect(devices).toEqual([device]);
739
- * expect(deviceParam).toEqual('ideal');
740
- * expect(noiseSuppression).toEqual(true);
741
- * expect(noiseSuppressionParam).toEqual('ideal');
742
- * ```
743
- */
744
- 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>;
745
- /**
746
- * Find device from the device list with provided constraints
747
- *
748
- * @param constraints - The constraints to be used for the lookup
749
- * @param devices - The devices to be used for the lookup
750
- *
751
- * @returns `true` means it can be any devices, `undefined` means not found,
752
- * otherwise, the matched device will be returned
753
- */
754
- declare const findDeviceFromConstraints: (constraints: InputDeviceConstraint | undefined, devices: MediaDeviceInfoLike[]) => boolean | MediaDeviceInfoLike | undefined;
755
- /**
756
- * Relax input constraints to enable looking up the device by `deviceId` as well
757
- * as `label` as a fallback as a best effort to get a similar device when
758
- * possible.
759
- *
760
- * @param input - The input constraints to be relaxed
761
- * @param devices - The current device list
762
- */
763
- declare const relaxInputConstraint: (input: InputDeviceConstraint | undefined, devices: MediaDeviceInfoLike[]) => InputDeviceConstraint | undefined;
764
-
765
- /**
766
- * MediaStreamTrack Events
767
- *
768
- * @remarks
769
- * See MDN {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#Events | Events}
770
- *
771
- * @beta
772
- */
773
- declare enum MediaEventType {
774
- /**
775
- * Sent to the MediaStreamTrack when the value of the muted property is
776
- * changed to true, indicating that the track is unable to provide data
777
- * temporarily (such as when the network is experiencing a service
778
- * malfunction).
779
- */
780
- Mute = "mute",
781
- /**
782
- * Sent to the track when data becomes available again, ending the muted state.
783
- */
784
- Unmute = "unmute",
785
- /**
786
- * Sent when playback of the track ends (when the value readyState changes to
787
- * ended).
788
- */
789
- Ended = "ended",
790
- /**
791
- * Fired when a media input or output device is attached to or removed from
792
- * the user's computer.
793
- *
794
- * @remarks
795
- * See MDN {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices#Events | Events}
796
- */
797
- DevicesChanged = "devices:changed",
798
- /**
799
- * Found new devices from authorized device list
800
- */
801
- DevicesFound = "devices:found",
802
- /**
803
- * Lost devices from authorized device list
804
- */
805
- DevicesLost = "devices:lost",
806
- /**
807
- * Lost device from authorized device list
808
- */
809
- DeviceLost = "device:lost",
810
- /**
811
- * Unauthorized devices
812
- */
813
- DevicesUnauthorized = "devices:unauthorized",
814
- /**
815
- * No Input Devices, and no further device events will be emitted
816
- */
817
- NoInputDevices = "devices:noinput",
818
- /**
819
- * Other errors
820
- */
821
- Error = "error",
822
- /**
823
- * When stream
824
- */
825
- Stream = "stream"
826
- }
827
- /**
828
- * Event object by MediaEventType
829
- *
830
- * @beta
831
- */
832
- type Events = {
833
- id: string;
834
- type: MediaEventType.Mute;
835
- } | {
836
- id: string;
837
- type: MediaEventType.Unmute;
838
- } | {
839
- id: string;
840
- type: MediaEventType.Ended;
841
- } | {
842
- devices: MediaDeviceInfoLike[];
843
- type: MediaEventType.DevicesChanged;
844
- } | {
845
- devices: MediaDeviceInfoLike[];
846
- authorizedDevices: MediaDeviceInfoLike[];
847
- unauthorizedDevices: MediaDeviceInfoLike[];
848
- type: MediaEventType.DevicesFound;
849
- } | {
850
- devices: MediaDeviceInfoLike[];
851
- authorizedDevices: MediaDeviceInfoLike[];
852
- unauthorizedDevices: MediaDeviceInfoLike[];
853
- type: MediaEventType.DevicesLost;
854
- } | {
855
- devices: MediaDeviceInfoLike[];
856
- authorizedDevices: MediaDeviceInfoLike[];
857
- type: MediaEventType.DevicesUnauthorized;
858
- } | {
859
- devices: MediaDeviceInfoLike[];
860
- type: MediaEventType.NoInputDevices;
861
- } | {
862
- device: MediaDeviceInfoLike;
863
- type: MediaEventType.DeviceLost;
864
- } | {
865
- error: Error;
866
- type: MediaEventType.Error;
867
- } | {
868
- facingMode: boolean;
869
- stream: MediaStream;
870
- type: MediaEventType.Stream;
871
- video: boolean;
872
- };
873
- /**
874
- * Custom Media Event
875
- * @beta
876
- */
877
- type MediaEvent = CustomEvent<Events>;
878
-
879
- /**
880
- * Create a MediaStreamTrack's native events subscription
881
- *
882
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack#events
883
- *
884
- * @param track - The track used for the subscription
885
- * @param handlers - An object contains the event handlers
886
- */
887
- declare const createStreamTrackEventSubscriptions: (track: MediaStreamTrack, handlers: StreamTrackEventHandlers) => Unsubscribe;
888
-
889
- /**
890
- * Log meta and message with respective log level
891
- */
892
- type LogMethod = (meta: unknown, message?: string) => void;
893
- declare enum LogLevels {
894
- trace = 10,
895
- debug = 20,
896
- info = 30,
897
- warn = 40,
898
- error = 50,
899
- fatal = 60,
900
- silent
901
- }
902
- type LogLevelsString = keyof typeof LogLevels;
903
- type LogMethods = {
904
- [key in LogLevelsString]: LogMethod;
905
- };
906
- /**
907
- * Log Level from high to low, "fatal" | "error" | "warn" | "info" | "debug" | "trace"
908
- * Typically, debug and trace logs are only valid for development, and not needed in production
909
- */
910
- interface Logger extends LogMethods {
911
- /**
912
- * Adds a value to the redaction set, which makes it replaced by [REDACTED] when logged to file.
913
- *
914
- * @remarks
915
- * The redaction set is applied globally, and only applies to the log file, not console logs.
916
- *
917
- * @param value - the string to redact
918
- */
919
- redact(value: string): void;
920
- }
921
-
922
- declare function setLogger(newLogger: Logger): void;
923
-
924
- type ExtractObjectValueTypes<T extends object> = T[keyof T];
925
- /**
926
- * The `DisplayCaptureSurfaceType` enumeration describes the different types of
927
- * display surface
928
- *
929
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype}
930
- */
931
- declare const DISPLAY_CAPTURE_SURFACE_TYPE: {
932
- readonly Monitor: "monitor";
933
- readonly Window: "window";
934
- readonly Browser: "browser";
935
- };
936
- /**
937
- * The `DisplayCaptureSurfaceType` enumeration describes the different types of
938
- * display surface
939
- *
940
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#displaycapturesurfacetype}
941
- */
942
- type DisplayCaptureSurfaceType = ExtractObjectValueTypes<typeof DISPLAY_CAPTURE_SURFACE_TYPE>;
943
- /**
944
- * The `CursorCaptureConstraint` enumerates the conditions under which the
945
- * cursor is captured.
946
- *
947
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint}
948
- */
949
- declare const CURSOR_CAPTURE_CONSTRAINT: {
950
- readonly Never: "never";
951
- readonly Always: "always";
952
- readonly Motion: "motion";
953
- };
954
- /**
955
- * The `CursorCaptureConstraint` enumerates the conditions under which the
956
- * cursor is captured.
957
- *
958
- * @see {@link https://w3c.github.io/mediacapture-screen-share/#cursorcaptureconstraint}
959
- */
960
- type CursorCaptureConstraint = ExtractObjectValueTypes<typeof CURSOR_CAPTURE_CONSTRAINT>;
961
- declare const INCLUDE_EXCLUDE_CONSTRAINT: {
962
- readonly Include: "include";
963
- readonly Exclude: "exclude";
964
- };
965
- type IncludeExcludeConstraint = ExtractObjectValueTypes<typeof INCLUDE_EXCLUDE_CONSTRAINT>;
966
-
967
- /**
968
- * A fallback implementation of `monitorTypeSurfaces` limitation when it is not
969
- * supported by the current browser and the source of the `displaySurface` is
970
- * available.
971
- *
972
- * @param constraints - The constraints used to request display media.
973
- * @param stream - The MediaStream returned from the requesting display media.
974
- */
975
- declare const limitSharingMonitorInterface: (constraints: DisplayMediaOptions, stream: MediaStream) => MediaStream;
976
-
977
1
  /**
978
2
  * media-control is meant to extend the mediaDevices api methods such as
979
3
  * `getUserMedia`, `enumerateDevices` and events on media streams and tracks.
@@ -983,31 +7,41 @@ declare const limitSharingMonitorInterface: (constraints: DisplayMediaOptions, s
983
7
  *
984
8
  * @packageDocumentation
985
9
  */
986
-
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';
987
18
  declare const
988
19
  /**
989
20
  * Get MediaStream with provided {@link MediaDeviceRequest | input constraints}
990
21
  */
991
- getUserMedia: ({ audio, video, }: MediaDeviceRequest) => Promise<MediaStream>;
992
- declare const /**
22
+ getUserMedia: ({ audio, video, }: MediaDeviceRequest) => Promise<MediaStream>,
23
+ /**
993
24
  * Set default media stream constraints
994
25
  *
995
26
  * A {@link
996
27
  * https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints |
997
28
  * MediaStreamConstraints} object specifying the types of media to request, along with any requirements for each type.
998
29
  */
999
- setDefaultConstraints: (newConstraints: MediaStreamConstraints) => void;
1000
- declare const /**
30
+ setDefaultConstraints: (newConstraints: MediaStreamConstraints) => void,
31
+ /**
1001
32
  * Subscribe media events
1002
33
  */
1003
34
  subscribe: (listener: (event: MediaEvent) => void) => () => void;
1004
-
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';
1005
39
  /**
1006
40
  * MediaControl Interface
1007
41
  *
1008
42
  * @beta
1009
43
  */
1010
- interface MediaControl {
44
+ export interface MediaControl {
1011
45
  /** {@inheritDoc deviceChanged} */
1012
46
  deviceChanged: typeof deviceChanged;
1013
47
  /** {@inheritDoc getDevices} */
@@ -1021,5 +55,4 @@ interface MediaControl {
1021
55
  /** {@inheritDoc subscribe} */
1022
56
  subscribe: typeof subscribe;
1023
57
  }
1024
-
1025
- 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, toMediaDeviceInfo, toMediaDeviceInfoLike };
58
+ export type { InputDevicePermission } from './types';