"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.registerGlobals = exports.permissions = exports.mediaDevices = exports.MediaStreamTrack = exports.MediaStream = exports.RTCErrorEvent = exports.RTCRtpSender = exports.RTCRtpReceiver = exports.RTCRtpTransceiver = exports.ScreenCapturePickerView = exports.RTCView = exports.RTCSessionDescription = exports.RTCPeerConnection = exports.RTCIceCandidate = void 0;
const EventEmitter_1 = require("./EventEmitter");
const Logger_1 = __importDefault(require("./Logger"));
const MediaDevices_1 = __importDefault(require("./MediaDevices"));
exports.mediaDevices = MediaDevices_1.default;
const MediaStream_1 = __importDefault(require("./MediaStream"));
exports.MediaStream = MediaStream_1.default;
const MediaStreamTrack_1 = __importDefault(require("./MediaStreamTrack"));
exports.MediaStreamTrack = MediaStreamTrack_1.default;
const MediaStreamTrackEvent_1 = __importDefault(require("./MediaStreamTrackEvent"));
const Permissions_1 = __importDefault(require("./Permissions"));
exports.permissions = Permissions_1.default;
const RTCErrorEvent_1 = __importDefault(require("./RTCErrorEvent"));
exports.RTCErrorEvent = RTCErrorEvent_1.default;
const RTCIceCandidate_1 = __importDefault(require("./RTCIceCandidate"));
exports.RTCIceCandidate = RTCIceCandidate_1.default;
const RTCPeerConnection_1 = __importDefault(require("./RTCPeerConnection"));
exports.RTCPeerConnection = RTCPeerConnection_1.default;
const RTCRtpReceiver_1 = __importDefault(require("./RTCRtpReceiver"));
exports.RTCRtpReceiver = RTCRtpReceiver_1.default;
const RTCRtpSender_1 = __importDefault(require("./RTCRtpSender"));
exports.RTCRtpSender = RTCRtpSender_1.default;
const RTCRtpTransceiver_1 = __importDefault(require("./RTCRtpTransceiver"));
exports.RTCRtpTransceiver = RTCRtpTransceiver_1.default;
const RTCSessionDescription_1 = __importDefault(require("./RTCSessionDescription"));
exports.RTCSessionDescription = RTCSessionDescription_1.default;
const RTCView_1 = __importDefault(require("./RTCView"));
exports.RTCView = RTCView_1.default;
const ScreenCapturePickerView_1 = __importDefault(require("./ScreenCapturePickerView"));
exports.ScreenCapturePickerView = ScreenCapturePickerView_1.default;
Logger_1.default.enable('*');
// Logger.enable(`*,-${Logger.ROOT_PREFIX}:*:DEBUG`);
// Add listeners for the native events early, since they are added asynchronously.
EventEmitter_1.setupNativeEvents();
function registerGlobals() {
    // Should not happen. React Native has a global navigator object.
    if (typeof global.navigator !== 'object') {
        throw new Error('navigator is not an object');
    }
    if (!global.navigator.mediaDevices) {
        global.navigator.mediaDevices = {};
    }
    global.navigator.mediaDevices.getUserMedia = MediaDevices_1.default.getUserMedia.bind(MediaDevices_1.default);
    global.navigator.mediaDevices.getDisplayMedia = MediaDevices_1.default.getDisplayMedia.bind(MediaDevices_1.default);
    global.navigator.mediaDevices.enumerateDevices = MediaDevices_1.default.enumerateDevices.bind(MediaDevices_1.default);
    global.RTCIceCandidate = RTCIceCandidate_1.default;
    global.RTCPeerConnection = RTCPeerConnection_1.default;
    global.RTCRtpReceiver = RTCRtpReceiver_1.default;
    global.RTCRtpSender = RTCRtpReceiver_1.default;
    global.RTCSessionDescription = RTCSessionDescription_1.default;
    global.MediaStream = MediaStream_1.default;
    global.MediaStreamTrack = MediaStreamTrack_1.default;
    global.MediaStreamTrackEvent = MediaStreamTrackEvent_1.default;
    global.RTCRtpTransceiver = RTCRtpTransceiver_1.default;
    global.RTCRtpReceiver = RTCRtpReceiver_1.default;
    global.RTCRtpSender = RTCRtpSender_1.default;
    global.RTCErrorEvent = RTCErrorEvent_1.default;
}
exports.registerGlobals = registerGlobals;
//# sourceMappingURL=index.js.map