UNPKG

mediasoup

Version:

Cutting Edge WebRTC Video Conferencing

44 lines (43 loc) 2.1 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.Value = void 0; exports.unionToValue = unionToValue; exports.unionListToValue = unionListToValue; /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ const boolean_1 = require("../../fbs/rtp-parameters/boolean"); const double_1 = require("../../fbs/rtp-parameters/double"); const integer32_1 = require("../../fbs/rtp-parameters/integer32"); const integer32_array_1 = require("../../fbs/rtp-parameters/integer32-array"); const string_1 = require("../../fbs/rtp-parameters/string"); var Value; (function (Value) { Value[Value["NONE"] = 0] = "NONE"; Value[Value["Boolean"] = 1] = "Boolean"; Value[Value["Integer32"] = 2] = "Integer32"; Value[Value["Double"] = 3] = "Double"; Value[Value["String"] = 4] = "String"; Value[Value["Integer32Array"] = 5] = "Integer32Array"; })(Value || (exports.Value = Value = {})); function unionToValue(type, accessor) { switch (Value[type]) { case 'NONE': return null; case 'Boolean': return accessor(new boolean_1.Boolean()); case 'Integer32': return accessor(new integer32_1.Integer32()); case 'Double': return accessor(new double_1.Double()); case 'String': return accessor(new string_1.String()); case 'Integer32Array': return accessor(new integer32_array_1.Integer32Array()); default: return null; } } function unionListToValue(type, accessor, index) { switch (Value[type]) { case 'NONE': return null; case 'Boolean': return accessor(index, new boolean_1.Boolean()); case 'Integer32': return accessor(index, new integer32_1.Integer32()); case 'Double': return accessor(index, new double_1.Double()); case 'String': return accessor(index, new string_1.String()); case 'Integer32Array': return accessor(index, new integer32_array_1.Integer32Array()); default: return null; } }