/** * Copyright (c) 2026 Microblink Ltd. All rights reserved. */ import { FacingMode } from "../core/Camera"; import { ExtendedCameraInfo, fakeDevices } from "./fake-devices"; /** * Options for the MediaMocker. */ type MediaMockerOptions = Partial<{ device: keyof typeof fakeDevices; facing: FacingMode; reverseCameraOrder: boolean; }>; /** * The MediaMocker class. */ declare class MediaMocker { #private; fakeDevice: keyof typeof fakeDevices; facing: FacingMode; cameras: ExtendedCameraInfo[]; /** * Creates a new MediaMocker. * * @param options - The options for the MediaMocker. */ constructor(options?: MediaMockerOptions); /** * Reverses the camera order. */ reverseCameraOrder(): void; /** * Gets the camera devices. * * @returns The camera devices. */ getCameraDevices(): ExtendedCameraInfo[]; /** * Sets the device. * * @param device - The device to set. */ setDevice(device: keyof typeof fakeDevices): void; /** * Configures the MediaMocker. * * @param options - The options for the MediaMocker. */ configure(options: MediaMockerOptions): void; /** * Mocks the enumerateDevices method. */ mockEnumerateDevices(): void; /** * Unmocks the enumerateDevices method. */ unmockEnumerateDevices(): void; /** * Mocks the MediaDevices methods. */ mock(): void; /** * Mocks the getUserMedia method. */ mockGetUserMedia(): void; /** * Unmocks the getUserMedia method. */ unmockGetUserMedia(): void; /** * Unmocks the MediaDevices methods. */ unmock(): void; /** * Resets the stream constraints. */ resetStreamConstraints(): void; /** * Creates a fake stream. * * @param constraints - The constraints for the stream. * @returns The fake stream. * @see MediaDevices.getUserMedia */ createFakeStream(constraints: MediaStreamConstraints): Promise; /** * Creates a fake track. * * @returns The fake track. */ createFakeTrack(): MediaStreamTrack; /** * Finds a device matching the constraints. * * @returns The device matching the constraints. */ findDeviceMatchingConstraints(): ExtendedCameraInfo; } /** * The media mocker singleton instance. */ export declare const mediaMocker: MediaMocker; export {}; //# sourceMappingURL=MediaMocker.d.ts.map