import extsdk, { sysLogger, baseUtil, EventManager, base64Util, TafManager, parser, checker, errUtil } from '@hyext/ext-sdk-basic';
import '@hyext/ext-sdk-basic/src/platforms/rn';
import AsyncStorage from '@react-native-async-storage/async-storage';
import initSocket from 'react_native_mqtt';
import { NativeModules, Platform as Platform$1, AsyncStorage as AsyncStorage$1, AppState, NativeEventEmitter } from 'react-native';
import * as Sentry from '@sentry/browser';
import { RewriteFrames } from '@sentry/integrations';
import abab from 'abab';
import { Taf } from './wup/libwup.js';
import error from '@hyext/ext-sdk-basic/src/basicModules/error.js';
import localStorage$1 from '@hyext/ext-sdk-basic/src/basicModules/localStorage.js';
import logger from '@hyext/ext-sdk-basic/src/basicModules/logger.js';
import network from '@hyext/ext-sdk-basic/src/basicModules/network.js';
import storage from '@hyext/ext-sdk-basic/src/basicModules/storage.js';
import system$1 from '@hyext/ext-sdk-basic/src/basicModules/system.js';

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

const config$1 = {
  "platform": "rn",
  "version": "3.11.3"
};

extsdk.system.setConfig(config$1);

const Paho = global.Paho;
const UnicKey = '[Online Debuger]';

function defineProperty$2(obj, propertyName, injector) {
  // TODO defineProperty 不影响实际调用位置
  let orignProperty = obj[propertyName];
  Object.defineProperty(obj, propertyName, {
    value: injector(orignProperty)
  });
}

class Debuger {
  /**
   * @typedef {Object} Config 配置参数
   * @property {boolean} deubg 是否开启debug
   * @property {string} url 远程服务器url
   * @property {string} maxTempLen 最新日志缓存上限
   * @property {Function} onConnect 报错回调
   */
  /**
   * @param {Config} opt 
   */
  constructor(opt) {
    this.opt = {
      deubg: false,
      ...(opt || {})
    };
    this._temp = [];
    this.isConnect = false;
    this.isDistroied = false;
  }

  _log(...params) {
    if (this.opt.deubg) {
      console.info(UnicKey, ...params);
    }
  }

  /**
   * @param {Object} extInfo 
   * @param {string} extInfo.extUuid
   * @param {string} extInfo.extType
   */
  initClient(extInfo) {
    try {
      const { extUuid, extType } = extInfo || {};
      this.extInfo = extInfo || {};
      this.topic = `extlog/${extUuid}`;
      this.clientId = `${extType}_${extUuid}_${Date.now()}`;
      const { url } = this.opt;
      const client = new Paho.MQTT.Client(url, this.clientId);

      client.onConnectionLost = this._onDisConnect.bind(this);
      client.onMessageArrived = this._onMessage.bind(this);
      client.connect({ onSuccess: this._onConnect.bind(this), reconnect: true, });

      this.client = client;
      this._log('init client', this.topic);
    } catch (err) {
      this._log('init fail', err.message);
    }
  }

  _onConnect() {
    this.isConnect = true;
    this._log("connected", this.topic, this._temp.length);
    this._tryClearTemp();
    const { onConnect } = this.opt;
    onConnect && onConnect(this.topic);
  }

  _onDisConnect(resp) {
    this.isConnect = false;
    this._log("disConnected:", resp.errorCode, resp.errorMessage);
  }

  _onMessage(message) {
    this._log("onmessage:", message.payloadString);
  }

  _sendMsg(msg) {
    try {
      const message = new Paho.MQTT.Message(JSON.stringify({
        ...msg,
        ...this.extInfo,
        loggerId: this.clientId
      }));
      message.destinationName = this.topic;
      this.client.send(message);
      this._log('_send msg: ', message);
    } catch (err) {
      this._log('_send msg fail:', err.message);
    }
  }

  /**
   * 添加消息缓存，只缓存最近几条消息
   * @param {any} msg 
   */
  _addTempMsg(msg) {
    const { maxTempLen } = this.opt;
    if (maxTempLen && this._temp.length >= maxTempLen) {
      // 清除最早一条数据
      this._temp.shift();
    }
    this._temp.push(msg);
  }

  /**
   * 清除缓存日志
   */
  _tryClearTemp() {
    if (!this._temp.length || !this.isConnect) return;
    const msg = this._temp.shift();
    this._sendMsg(msg);

    // 循环清除
    setTimeout(() => this._tryClearTemp(), 1);
  }

  _toString(str) {
    if (typeof str === 'string') return str;
    try {
      // str 自定义了 toJSON，调用 stringify 可能会报错
      return JSON.stringify(str);
    } catch (err) {
      return err.message;
    }
  }

  sendMessage({ level, msg }) {
    try {
      // 已销毁
      if (this.isDistroied) return;

      const omsg = {
        level,
        msg: this._toString(msg),
        time: Date.now(),
      };

      // 未链接或者有缓存，缓存消息
      if (!this.isConnect || this._temp.length) {
        this._addTempMsg(omsg);
        return;
      }

      this._sendMsg(omsg);
    } catch (err) {
      this._log('send msg fail:', err.message);
    }
  }

  /**
   * @param {Object} Ins 要hook的实例
   * @param {Array.<string>} APIS 要hook的API
   */
  hookAPI(Ins, APIS) {
    if (!Ins || !APIS) return;
    const sendMessage = this.sendMessage.bind(this);
    try {
      APIS.map(level => {
        defineProperty$2(Ins, level, oProp => {
          return (...params) => {
            oProp && oProp.apply(Ins, params);
            if (params[0] !== UnicKey) {
              sendMessage({ level, msg: params });
            }
          }
        });
      });
    } catch (err) {
      this._log('hookAPI fail', err.message);
    }
  }

  distroy() {
    this._temp = [];
    this.isConnect = false;
    this.isDistroied = true;
  }
}

/** @ignore */
const MODULE_NAME$w = "HYExtContext";

var HYExtContext$2 = {
  /**
   * 直播间事件
   * @namespace context
   */
  context: {
    /**
     * @edata
     * @callback ContextOnCallback
     * @param {any} content 收到宿主消息
     */
    /**
     * 监听直播间消息
     * @eapi
     * @param {string} topic 宿主消息名, activated-小程序激活, subscribeSubmit-【观众端】当前观众订阅状态发生变化, giftSubmit-【观众端】当前观众送礼, barrageSubmit-当前用户发送弹幕, unzipProgress-每个任务的解压进度, userInteract-用户交互信息, openCoinPanelClosed-能量豆弹窗关闭
     * @param {ContextOnCallback} callback 收到消息时回调 返回消息内容
     * @returns {void} 调用结果
     */
    on(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$w, "on", topic, callback);
    },

    /**
     * 取消监听直播间消息
     * @eapi
     * @param {string} topic 宿主消息名, activated-小程序激活, subscribeSubmit-【观众端】当前观众订阅状态发生变化, giftSubmit-【观众端】当前观众送礼, barrageSubmit-当前用户发送弹幕, unzipProgress-每个任务的解压进度, userInteract-用户交互信息, openCoinPanelClosed-能量豆弹窗关闭
     * @param {ContextOnCallback} [callback] 收到消息时回调 返回消息内容
     * @returns {void} 调用结果
     */
    off(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$w, "off", topic, callback);
    },

    /**
     * 显示互动通道入口红点
     * @summary 仅面板类型小程序适用
     * @eapi
     * @returns {Promise<void>} 返回是否显示成功
     */
    showActivityBadge() {
      return extsdk.core.callEvent(MODULE_NAME$w, "showActivityBadge");
    },

    /**
     * 显示toast
     * @eapi
     * @param {string} message toast中显示的消息
     * @returns {Promise<void>}
     */
    showToast(message) {
      return extsdk.core.callEvent(MODULE_NAME$w, "showToast", message);
    },

    /**
     * 全区域位置信息
     * @edata
     * @typedef {Object} PositionInfo
     * @property {number} left 安全区域距离容器左侧的像素值
     * @property {number} top 安全区域距离容器上侧的像素值
     * @property {number} right 安全区域距离容器右侧的像素值
     * @property {number} bottom 安全区域距离容器下侧的像素值
     */
    /**
     * 获取安全区域的位置
     * @eapi
     * @returns {Promise<PositionInfo>} 返回安全区域位置信息
     */
    getSafeAreaPosition() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getSafeAreaPosition");
    },

    /**
     * 容器变化消息
     * @edata
     * @typedef {Object} LayoutInfo
     * @property {number} screenWidth 容器宽度
     * @property {number} screenHeight 容器高度
     * @property {boolean} isLandscape 是否横屏，web端固定为true
     */
    /**
     * 小程序容器布局变化回调
     * @edata
     * @callback LayoutChange
     * @param {LayoutInfo} info 容器变化消息
     */
    /**
     * 监听当前直播间小程序容器布局变化消息
     * @summary 适用于浮窗小程序类型
     * @eapi
     * @param {LayoutChange} callback 小程序容器布局变化回调
     * @returns {Promise<void>}
     */
    onLayoutChange(callback) {
      return extsdk.core.onEvent(MODULE_NAME$w, "onLayoutChange", callback);
    },

    /**
     * 引导订阅
     * @summary 用户完成交互后自动帮用户订阅当前直播间
     * @eapi
     * @returns {Promise<void>}
     */
    leadSubscribe() {
      return extsdk.core.callEvent(MODULE_NAME$w, "leadSubscribe");
    },

    /**
     * 直播间礼物配置
     * @edata
     * @typedef {Object} RoomGiftConfig
     * @property {number} giftId 礼物Id
     * @property {string} giftName 礼物名称
     * @property {string} giftLogo 礼物图标
     * @property {string} giftGif 小程序图标（gif动图）
     * @property {number} giftPriceHuya 礼物价格（虎牙币）
     * @property {number} giftPriceGreenBean 礼物价格（金豆）
     * @property {number} giftPriceWhiteBean 礼物价格（银豆）, -1-表示此礼物不支持使用银豆购买
     */
    /**
     * 获取当前直播间礼物配置
     * @eapi
     * @returns {Promise<Array.<RoomGiftConfig>>} 返回直播间礼物配置
     */
    getGiftConf() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getGiftConf");
    },

    /**
     * 发送礼物信息
     * @edata
     * @typedef {Object} SendGiftInfo
     * @property {number} giftId 发送礼物Id
     * @property {number} giftCount 发送礼物个数
     */
    /**
     * 当前观众送礼
     * @summary 需要用户授权使用
     * @eapi
     * @param {SendGiftInfo} params 发送礼物信息
     * @returns {Promise<void>}
     */
    sendGift(params) {
      return extsdk.core.callEvent(MODULE_NAME$w, "sendGift", params);
    },

    /**
     * 引导当前观众送礼
     * @summary 一般需要和监听当前用户送礼的消息配合使用
     * @eapi
     * @returns {Promise<void>} 引导成功返回送礼人信息
     */
    leadGift() {
      return extsdk.core.callEvent(MODULE_NAME$w, "leadGift");
    },

    /**
     * 送礼人信息
     * @edata
     * @typedef {Object} GifterInfo
     * @property {string} sendNick 送礼人的昵称
     * @property {string} senderAvatarUrl 送礼人的头像地址
     * @property {number} itemId 礼物Id
     * @property {string} itemName 礼物名称
     * @property {number} sendItemCount 礼物数量
     * @property {number} sendItemComboHits 送礼连击数
     * @property {number} roomId 房间号
     * @property {string} unionId 用户unionId
     * @property {string} customText 礼物的自定义文案
     * @property {number} nobleLevel 贵族等级
     * @property {number} totalPay 此次送礼支付总额（分）
     * @property {number} nobleAttrType 贵族等级类型
     */
    /**
     * 礼物变化过滤条件
     * @edata
     * @typedef {Object} GiftChangeOptions
     * @property {string} [sendNick] 用户昵称关键字
     * @property {string} [itemName] 礼物名称关键字
     * @property {number} [minSendItemCount] 礼物数量超过这个值才监听
     * @property {number} [minSendItemComboHits] 连击数量超过这个值才监听
     */
    /**
     * 礼物信息回调
     * @edata
     * @callback GiftChange
     * @param {GifterInfo} giftInfo 送礼人信息
     */
    /**
     * 监听当前直播间礼物变化消息
     * @summary 只保留最新的一次监听
     * - 最大触发频率为每50毫秒一条
     * @eapi
     * @param {GiftChangeOptions} options 过滤条件
     * @param {GiftChange} callback 礼物信息回调
     * @returns {Promise<void>} 操作结果
     */
    onGiftChange(options, callback) {
      return extsdk.core.onEvent(
        MODULE_NAME$w,
        "onGiftChange",
        options,
        callback
      );
    },

    /**
     * 取消监听当前直播间礼物变化消息
     * @eapi
     * @returns {Promise<void>} 操作结果
     */
    offGiftChange() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offGiftChange");
    },

    /**
     * 引导当前用户发送弹幕
     * @summary 一般需要和监听当前用户发言的消息配合使用
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    leadBarrage() {
      return extsdk.core.callEvent(MODULE_NAME$w, "leadBarrage");
    },

    /**
     * 弹幕消息
     * @edata
     * @typedef {Object} BarragerInfo
     * @property {string} sendNick 发言人的昵称
     * @property {string} senderAvatarUrl 发言人的头像地址
     * @property {number} senderGender 发言人的性别, 0-女, 1-男
     * @property {number} nobleLevel 发言人的贵族等级
     * @property {number} fansLevel 发言人的粉丝等级
     * @property {string} content 弹幕内容
     * @property {string} unionId 用户unionId
     * @property {string} badgeName 粉丝徽章名
     */
    /**
     * 弹幕信息回调
     * @edata
     * @callback BarrageCallback 弹幕信息回调
     * @param {BarragerInfo} barrageInfo 弹幕消息
     */
    /**
     * 弹幕筛选条件
     * @edata
     * @typedef {Object} OnBarrageChangeOptions
     * @property {string} [sendNick] 用户昵称关键字
     * @property {number} [nobleLevel] 贵族等级
     * @property {number} [fansLevel] 粉丝等级
     * @property {string} [content] 弹幕内容关键字
     */
    /**
     * 监听所有弹幕
     * @summary 只保留最新的一次监听
     * - 最大触发频率为每50毫秒一条
     * @eapi
     * @param {OnBarrageChangeOptions} options 弹幕筛选条件
     * @param {BarrageCallback} callback 弹幕信息回调
     * @returns {Promise<void>}
     */
    onBarrageChange(options, callback) {
      return extsdk.core.onEvent(
        MODULE_NAME$w,
        "onBarrageChange",
        options,
        callback
      );
    },

    /**
     * 关闭监听所有弹幕
     * @eapi
     * @returns {Promise<void>}
     */
    offBarrageChange() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offBarrageChange");
    },

    /**
     * 开启守护消息
     * @edata
     * @typedef {Object} OpenGuardianNotice
     * @property {number} openDays 开通或者续费天数
     * @property {number} lastGuardianLevel 开通或者续费之前的守护等级
     * @property {number} openGuardianLevel 开通或续费后守护等级
     * @property {string} presenterNick 主播昵称
     * @property {number} roomId 房间Id
     * @property {string} unionId 用户unionId
     * @property {string} userAvatarUrl 用户头像
     * @property {string} userNick 用户昵称
     * @property {number} guardType 守护类型, 0-初爱守护, 2-超级守护, 3-至尊守护
     */
    /**
     * 开通守护回调
     * @edata
     * @callback OpenGuardianNoticeCallback
     * @param {OpenGuardianNotice} notice 开启守护消息
     */
    /**
     * 监听开通守护参数
     * @edata
     * @typedef {Object} OpenGuardianNoticeParams
     * @property {OpenGuardianNoticeCallback} callback 开通守护回调
     */
    /**
     * 监听开通守护
     * @eapi
     * @param {OpenGuardianNoticeParams} params 监听开通守护参数
     * @returns {Promise<void>}
     */
    onOpenGuardianNotice(params) {
      return extsdk.core.onEvent(MODULE_NAME$w, "onOpenGuardianNotice", params);
    },

    /**
     * 关闭监听开通守护
     * @eapi
     * @returns {Promise<void>}
     */
    offOpenGuardianNotice() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offOpenGuardianNotice");
    },

    /**
     * 开启贵族消息
     * @edata
     * @typedef {Object} OpenNobleNotice
     * @property {number} startTime 贵族生效unix时间戳，单位是秒
     * @property {number} endTime 贵族失效unix时间戳，单位是秒
     * @property {number} openFlag 标志, 1-首次(非贵族开通任一贵族,或者低等级贵族更换高等级的贵族操作,都并入到首开), 2-续费
     * @property {number} months 开通月数
     * @property {number} nobleLevel 贵族等级
     * @property {number} nobleAttrType 贵族等级类型
     * @property {string} nobleName 贵族名
     * @property {number} roomId 房间Id
     * @property {string} unionId 用户unionId
     * @property {string} userAvatarUrl 用户头像
     * @property {string} userNick 用户昵称
     */
    /**
     * 开通贵族回调
     * @edata
     * @callback OpenNobleNoticeCallback
     * @param {OpenNobleNotice} notice 开启贵族消息
     */
    /**
     * 监听开通贵族参数
     * @edata
     * @typedef {Object} OnOpenNobleNoticeParams
     * @property {OpenNobleNoticeCallback} callback 监听开通贵族
     */
    /**
     * 监听开通贵族
     * @eapi
     * @param {OnOpenNobleNoticeParams} params 监听开通贵族参数
     * @returns {Promise<void>}
     */
    onOpenNobleNotice(params) {
      return extsdk.core.onEvent(MODULE_NAME$w, "onOpenNobleNotice", params);
    },

    /**
     * 关闭监听开通贵族
     * @eapi
     * @returns {Promise<void>}
     */
    offOpenNobleNotice() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offOpenNobleNotice");
    },

    /**
    * 高级用户进场消息
    * @edata
    * @typedef {Object} VipEnterBannerNotice
    * @property {string} badgeName 粉丝标签名
    * @property {number} fansLevel 粉丝等级
    * @property {number} nobleLevel 贵族等级
    * @property {number} nobleAttrType 贵族等级类型
    * @property {string} nobleName 贵族名
    * @property {string} unionId 用户unionId
    * @property {number} roomId 房间Id
    * @property {string} userAvatarUrl 用户头像
    * @property {string} userNick 用户昵称
    */
    /**
     * 高级用户进场回调
     * @edata
     * @callback VipEnterBannerNoticeCallback
     * @param {VipEnterBannerNotice} notice 高级用户进场消息
     */
    /**
     * 监听高级用户进场参数
     * @edata
     * @typedef {Object} VipEnterBannerNoticeParams
     * @property {VipEnterBannerNoticeCallback} callback 高级用户进场信息回调
     */
    /**
     * 监听高级用户进场
     * @eapi
     * @param {VipEnterBannerNoticeParams} params 参数
     * @returns {Promise<void>}
     */
    onVipEnterBannerNotice(params) {
      return extsdk.core.onEvent(MODULE_NAME$w, "onVipEnterBannerNotice", params);
    },

    /**
     * 取消监听高级用户进场
     * @eapi
     * @returns {Promise<void>}
     */
    offVipEnterBannerNotice() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offVipEnterBannerNotice");
    },

    /**
     * 直播间分享消息
     * @edata
     * @typedef {Object} ShareLiveNotice
     * @property {string} actionUrl 直播间跳转链接
     * @property {string} content 分享内容
     * @property {string} imageUrl 分享图片的url
     * @property {string} presenterUnionId 主播unionId
     * @property {number} roomId 房间Id
     * @property {number} shareType 分享类型，默认0
     * @property {string} sharerNick 分享人的昵称
     * @property {string} sharerUnionId 分享人的unionId
     * @property {string} subtitle 直播间副标题
     * @property {string} title 直播间标题
     */
    /**
     * 分享直播间回调
     * @edata
     * @callback ShareLiveNoticeCallback
     * @param {ShareLiveNotice} notice 直播间分享消息
     */
    /**
     * 监听分享直播间参数
     * @edata
     * @typedef {Object} ShareLiveNoticeParams
     * @property {ShareLiveNoticeCallback} callback 分享直播间回调
     */
    /**
     * 监听分享直播间事件
     * @summary 开播状态下才有分享回调，且伴随频率限制：
     * 1. 单个用户对单个主播每小时只能有1次
     * 2. 单个主播每分钟最多10次
     * @eapi
     * @param {ShareLiveNoticeParams} params 监听分享直播间参数
     * @returns {Promise<void>}
     */
    onShareLiveNotice(params) {
      return extsdk.core.onEvent(MODULE_NAME$w, "onShareLiveNotice", params);
    },

    /**
     * 取消监听分享直播间事件
     * @eapi
     * @returns {Promise<void>}
     */
    offShareLiveNotice() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offShareLiveNotice");
    },

    /**
     * 获取当前观众是否订阅当前主播
     * @eapi
     * @returns {Promise<boolean>} 返回是否订阅
     */
    getSubscribeInfo() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getSubscribeInfo");
    },

    /**
     * 主播信息
     * @edata
     * @typedef {Object} StreamerInfo
     * @property {string} streamerNick 主播昵称
     * @property {string} streamerAvatarUrl 主播头像地址
     * @property {number} streamerSex 主播性别, 1-表示男, 2-表示女
     * @property {string} streamerRoomId 房间Id
     * @property {number} streamerLevel 主播等级
     * @property {string} streamerUnionId 主播unionId
     */
    /**
     * 获取主播信息
     * @eapi
     * @returns {Promise<StreamerInfo>} 返回用户信息
     */
    getStreamerInfo() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getStreamerInfo");
    },

    /**
     * APP信息
     * @edata
     * @typedef {Object} ContextInfo
     * @property {string} version 版本信息
     * @property {string} huyaUA UA信息
     */
    /**
     * 获取app信息，目前返回app版本、UA（计划废弃）
     * @eapi
     * @returns {Promise<ContextInfo>} 返回app信息
     */
    getContextInfo() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getContextInfo");
    },

    /**
     * 直播间信息
     * @edata
     * @typedef {Object} RespLiveInfo
     * @property {string} gameName 品类，如果isOn为false，则为上次开播的品类
     * @property {number} liveCount 人气，如果isOn为false，则为上次开播的人气
     * @property {string} roomTitle 直播间介绍，如果isOn为false，则为上次开播的直播间介绍
     * @property {number} startTime 开播时间戳（秒)，如果isOn为false，则为上次开播的时间戳
     * @property {boolean} isOn 是否在播
     * @property {number} gameId 品类id，如果isOn为false，则为上次开播的品类id
     * @property {boolean} hasVideo 直播间中是否有视频，如果isOn为false，则返回false
     * @property {string} template 直播间模版
     * @property {number} sourceType 直播间来源
     * @property {number} liveImmersion 沉浸式直播间, 1-为沉浸式直播间, 0-为非沉浸式直播间
     * @property {number} liveCompany 交友陪玩直播间, 1-为交友陪玩直播间, 0-为非交友陪玩直播间
     * @property {string} liveMode 开播模式, kGame-【PC主播端】端游直播, kEntertainment-【PC主播端】娱乐直播, kMobile-【PC主播端】手游直播, kMakeFriends-【PC主播端】交友直播, kThirdParty-【PC主播端】第三方推流, kScreenCAP-【助手APP】录屏直播, kCamera-【助手APP】摄像头直播, kVoice-【助手APP】语音直播,
     * @property {string} liveSubMode 开播子模式, process-【PC主播端】端游直播-捕捉游戏画面, desktop-【PC主播端】端游直播-全屏捕捉, area-【PC主播端】端游直播-截取屏幕, window-【PC主播端】端游直播-窗口捕捉, adr-【PC主播端】手游直播-安卓手机, ios-【PC主播端】手游直播-苹果手机, audio-【PC主播端】交友直播-语音开播, video-【PC主播端】交友直播-视频开播, multiPlayersVideo-【PC主播端】派对模式,
     */
    /**
     * 获取直播间信息
     * @eapi
     * @returns {Promise<RespLiveInfo>} 返回直播间信息
     */
    getLiveInfo() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getLiveInfo");
    },

    /**
     * 用户信息
     * @edata
     * @typedef {Object} UserInfo
     * @property {string} userNick 用户昵称
     * @property {string} userAvatarUrl 用户头像地址
     * @property {number} userLevel 用户等级
     * @property {string} userUnionId 用户的unionId
     */
    /**
     * 获取用户信息
     * @summary 需要用户授权使用
     * @eapi
     * @returns {Promise<UserInfo>} 返回用户信息
     */
    getUserInfo() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getUserInfo");
    },

    /**
     * @edata
     * @typedef {Object} FansRankItem 粉丝榜单数据
     * @property {string} userNick 包含用户昵称
     * @property {string} userAvatarUrl 用户头像地址
     * @property {number} score 贡献值
     * @property {number} fansLevel 粉丝等级
     */
    /**
     * @edata
     * @typedef {Object} RankInfo
     * @property {string} badgeName 粉丝标签名
     * @property {Array.<FansRankItem>} rank 榜单列表
     */
    /**
     * 获取直播间的粉丝榜信息
     * @eapi
     * @returns {Promise<RankInfo>} 返回直播间粉丝榜信息
     */
    getFansRank() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getFansRank");
    },

    /**
     * Vip信息
     * @edata
     * @typedef {Object} VipItem
     * @property {string} userNick 用户昵称
     * @property {string} userAvatarUrl 用户头像地址
     * @property {number} nobleLevel 贵族等级
     * @property {string} nobleName 贵族名称
     */
    /**
     * 获取直播间所有贵宾信息
     * @eapi
     * @returns {Promise<Array.<VipItem>>} 返回直播间所有贵宾信息
     */
    getVip() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getVip");
    },

    /**
     * @edata
     * @typedef {Object} WeekRankItem 周榜榜单数据
     * @property {string} userNick 包含用户昵称
     * @property {string} userAvatarUrl 用户头像地址
     * @property {number} score 贡献值
     */
    /**
     * 获取直播间的周贡榜信息
     * @eapi
     * @returns {Promise<Array.<WeekRankItem>>} 返回周贡榜榜单数据
     */
    getWeekRank() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getWeekRank");
    },

    /**
     * 发送弹幕分组标签参数
     * @edata
     * @typedef {Object} SendBarrageTagParams
     * @property {string} tag 发送弹幕标签
     */
    /**
     * 设置发送弹幕分组标签
     * @eapi
     * @param {SendBarrageTagParams} param 发送弹幕分组标签参数
     * @returns {Promise<void>} 返回设置发送弹幕分组标签是否显示成功
     */
    setSendBarrageTag(param) {
      return extsdk.core.callEvent(MODULE_NAME$w, "setSendBarrageTag", param);
    },

    /**
     * 显示弹幕分组标签参数
     * @edata
     * @typedef {Object} DisplayBarrageTagParams
     * @property {Array.<string>} tags 显示弹幕标签组
     */
    /**
     * 设置显示弹幕分组标签
     * @eapi
     * @param {DisplayBarrageTagParams} param 显示弹幕分组标签参数
     * @returns {Promise<void>} 返回设置显示弹幕分组标签是否显示成功
     */
    setDisplayBarrageTags(param) {
      return extsdk.core.callEvent(MODULE_NAME$w, "setDisplayBarrageTags", param);
    },

    /**
     * 分享配置
     * @edata
     * @typedef {Object} ShareParams
     * @property {string} platform 平台, all-全部平台(默认), weixin-微信, circle-朋友圈, qq-QQ, qzone-QQ空间, sinaweibo-新浪微博, copy-复制链接
     * @property {string} title 标题
     * @property {string} content 摘要
     * @property {string} shareUrl H5地址
     * @property {string} imageUrl 图片地址
     * @property {string} [imageData] 图片内容
     * @property {string} [miniprogramUrl] 小程序url
     * @property {string} mediaType 分享类型, 1-H5分享(默认), 2-图片分享, 5-微信小程序
     */
    /**
     * 分享直播间
     * @eapi
     * @param {ShareParams} params 分享配置
     * @returns {Promise<void>} 返回分享直播间是否成功
     */
    share(params) {
      return extsdk.core.callEvent(MODULE_NAME$w, "share", params);
    },

    /**
     * 订阅者概况
     * @edata
     * @typedef {Object} SubscriberSummary
     * @property {number} subscribeCount 	当前主播订阅人数
     */
    /**
     * 获取当前主播的订阅概况
     * @summary 订阅了当前直播间的订阅者的信息
     * @eapi
     * @returns {Promise<SubscriberSummary>} 订阅者概况
     */
    getSubscriberSummary() {
      return extsdk.core.callEvent(MODULE_NAME$w, "getSubscriberSummary");
    },


    /**
     * 订阅人
     * @edata
     * @typedef {Object} SubscriberInfo
     * @property {string} userNick 用户昵称
     */
    /**
     * 订阅者消息
     * @edata
     * @typedef {Object} SubscriberInfos
     * @property {Array.<SubscriberInfo>} subscriberList 订阅用户列表
     */
    /**
     * 订阅信息改变回调
     * @edata
     * @callback SubscriberChangeCallback
     * @param {SubscriberInfos} subscriberInfo 订阅者消息
     */
    /**
     * 订阅信息过滤条件
     * @edata
     * @typedef {Object} SubscriberOptions
     * @property {string} userNick 用户昵称
     */
    /**
     * 监听订阅信息改变
     * @summary 只保留最新的一次监听
     * @eapi
     * @param {SubscriberOptions} options 订阅信息过滤条件
     * @param {SubscriberChangeCallback} callback 订阅信息改变回调
     * @returns {Promise<void>}
     */
    onSubscriberChange(options, callback) {
      return extsdk.core.onEvent(
        MODULE_NAME$w,
        "onSubscriberChange",
        options,
        callback
      );
    },

    /**
     * 取消监听订阅信息改变
     * @eapi
     * @returns {Promise<void>}
     */
    offSubscriberChange() {
      return extsdk.core.offEvent(MODULE_NAME$w, "offSubscriberChange");
    },

    /**
     * @edata
     * @typedef {Object} Barrage
     * @property {boolean} enable 是否接收弹幕（包括大弹幕、小弹幕、送礼弹幕等）
     */
    /**
     * @edata
     * @typedef {Object} Effect
     * @property {boolean} giftEffectEnable 是否接收并显示礼物特效
     * @property {boolean} nobleEffectEnable 是否接收并显示贵族特效
     */
    /**
     * @edata
     * @typedef {Object} Player
     * @property {string} status 播放器状态, playing-播放, paused-停止
     * @property {string} displayMode 画面显示状态, default-默认, stretch-拉伸, cover-放大
     */
    /**
     * @edata
     * @typedef {Object} UI
     * @property {boolean} activated 是否激活UI（人气、主播头像、送礼、弹幕输入框、小程序等相关UI元素）
     */
    /**
     * @edata
     * @typedef {Object} Stream
     * @property {string} videoStreamStatus 视频流状态, playing-播放, paused-暂停
     * @property {string} audioStreamStatus 音频流状态, playing-播放, paused-暂停
     */
    /**
     * @edata
     * @typedef {Object} Orientation
     * @property {string} value 设备方向, portrait-竖屏, landscape-横屏
     * @property {boolean} [locked] 是否锁定方向
     */
    /**
     * @edata
     * @typedef {Object} Features
     * @property {Barrage} [barrage] 弹幕功能信息
     * @property {Effect} [effect] 特效功能信息
     * @property {Player} [player] 播放功能信息
     * @property {UI} [ui] UI功能信息
     * @property {Stream} [stream] 流功能信息
     * @property {Orientation} [orientation] 设备方向信息
     */
    /**
    * @edata
    * @typedef {string} FeatureKey 相关功能key, barrage-弹幕功能, efect-特效功能, player-播放功能, ui-UI功能, stream-流功能, orientation-设备方向
    */
    /**
     * 获取直播间功能
     * @eapi
     * @param {Array.<FeatureKey>} params 相关功能的键的数组（可以提供一个或者多个）
     * @returns {Promise<Features>} 返回 直播间功能信息（根据参数提供的键会有对应的字段）
     */
    getLiveRoomFeatures(params) {
      return extsdk.core.callEvent(MODULE_NAME$w, "getLiveRoomFeatures", params);
    },

    /**
     * @edata
     * @typedef {Object} FeaturesResp
     * @property {boolean} [barrage] 设置弹幕功能结果
     * @property {boolean} [effect] 设置特效功能结果
     * @property {boolean} [player] 设置播放功能结果
     * @property {boolean} [ui] 设置UI功能结果
     * @property {boolean} [stream] 设置流功能结果
     * @property {boolean} [orientation] 设置设备方向功能结果
     */
    /**
     * 设置直播间功能
     * @eapi
     * @param {Features} params 相关功能的键以及要设置的参数（可以提供一个键或者多个）
     * @returns {Promise<FeaturesResp>} 功能设置结果（根据参数提供的键会有对应的字段）
     */
    setLiveRoomFeatures(params) {
      return extsdk.core.callEvent(MODULE_NAME$w, "setLiveRoomFeatures", params);
    },

    /**
     * @edata
     * @typedef {Object} UrlParams
     * @property {string} url 链接
     */
    /**
     * 使用外部浏览器打开指定URL
     * @eapi
     * @since 2.12.0
     * @param {UrlParams} params 请求参数
     * @returns {Promise<void>} 返回结果
     */
    openExternalUrl(params) {
      return extsdk.core.callEvent(MODULE_NAME$w, "openExternalUrl", params);
    },
  },
};

const DEV = 'dev';

var system = {
  buildEnv() {
    try {
      return process.env.HYEXT_BUILD_ENV || DEV;
    } catch (err) {
      return DEV
    }
  },
  isBuildDev() {
    return this.buildEnv() === DEV
  },
};

class DebugStart {
  constructor() {
    this._debuger = null;
    this._extInfo = {};
    this._getInitParam = () => { };
  }

  /**
   * @param {Object} opt 
   * @param {Object} opt.extInfo 小程序新
   * @param {Function} opt.initParamFun 获取初始化参数
   * @returns 
   */
  init(opt) {
    const WS_URL = process.env.HYEXT_BUILD_ENV === "production" ? 'wss://extlog.huya.com/mqtt' : 'wss://extlog-webtest.huya.com/mqtt';
    const MAX_TEMP_LEN = 100; // 最新日志缓存上限
    const { extInfo, initParamFun } = opt || {};
    const extUuid = extInfo?.extUuid;

    // 禁止上报
    if (!extUuid || system.isBuildDev()) return;

    // 缓存
    if (extInfo) {
      this._extInfo = extInfo;
    }

    // 缓存获取参数方法
    if (initParamFun) {
      this._getInitParam = initParamFun;
    }

    // 提前实例化，用于存储更多的日志
    const debuger = new Debuger({
      deubg: false,
      url: WS_URL,
      maxTempLen: MAX_TEMP_LEN,
      onConnect: (topic) => {
        HYExtContext$2.context.showToast(`成功链接远程日志: ${topic}`).catch(_ => { });
      },
    });

    // 要监听的接口
    debuger.hookAPI(console, ['log', 'info', 'warn', 'error']);
    debuger.hookAPI(sysLogger, ['debug', 'info', 'warn']); // logger 默认不会 print
    debuger.hookAPI(extsdk.logger, ['debug', 'info', 'warn']); // logger 默认不会 print

    // 全局报错
    extsdk.error.onError((err) => {
      debuger.sendMessage({ level: 'error', msg: [err] });
    });

    this._debuger = debuger;
  }

  async start(opt) {
    if (!this._debuger) return false;

    // 是否开启远程日志 remotelog == 1
    const { remotelog } = await this._getInitParam();
    if (!remotelog) {
      this._debuger.distroy();
      return false
    }

    // init socket
    initSocket({
      size: 5000,
      defaultExpires: 1000 * 3600 * 24,
      enableCache: true,
      reconnect: true,
      sync: {},
      ...(opt || {})
    });

    // initClient
    this._debuger.initClient(this._extInfo);
    return true
  }
}

var debugStart = new DebugStart();

/**
 * RN端同步获取基础参数
 */
class Params {
  constructor() { }

  /**
   * 同步获取ExtInfo
   * dev 时获取不到
   */
  getExtInfo() {
    const HYRNSentry = NativeModules?.HYRNSentry;
    const { extVersion, extUuid, extType, extName, extVersionId, extTechType } = HYRNSentry || {};

    return {
      extUuid,
      extType,
      extVersion,
      extName,
      extVersionId,
      extTechType
    }
  }

  /**
   * 获取一些基础信息，包括用户信息
   * @returns 
   */
  getBaseInfo() {
    const HYRNSentry = NativeModules?.HYRNSentry;
    const { room, gid, suid, spid, appVersion } = HYRNSentry || {};
    return {
      suid,
      spid,
      room,
      gid,
      osversion: appVersion
    }
  }

  /**
   * 同步获取SDKInfo
   */
  getSDKInfo() {
    const isExt = !!NativeModules?.HYExtLocalMessageCenter; // 是否是直播端APP
    const { version } = extsdk.system.getConfig();
    const env = system.buildEnv();
    const os = Platform$1.OS === 'android' ? 'adr' : 'ios';
    const platform = isExt ? 'app' : 'live';

    return {
      os,
      platform,
      version,
      env,
    }
  }

  /**
   * 异步获取初始化参数
   */
  async getInitParam() {
    try {
      const HYExtEnv = NativeModules?.HYExtEnv;
      if (!HYExtEnv || !HYExtEnv.getInitialParam) return {}
      return await HYExtEnv.getInitialParam()
    } catch (err) {
      return {}
    }
  }

}

var baseParams = new Params();

(function () {
  try {
    debugStart.init({
      extInfo: baseParams.getExtInfo(),
      initParamFun: baseParams.getInitParam.bind(baseParams)
    });
  } catch (err) {
    console.warn('OnlineDebug init fail', err);
  }
})();

var debuger = {
  start() {
    debugStart.start({
      storageBackend: AsyncStorage,
    }).then(succ => {
      // 启动失败
      if (!succ) return;

      // 修复 RN 构建后 console.log 被覆盖对情况
      setTimeout(() => {
        debugStart._debuger?.hookAPI(console, ['log']);
      }, 1);
    }).catch(err => console.warn(err));
  },
};

var baseProcess = {

  getPath(moduleName, api) {
    return `${moduleName || ''}.${api}`.replace(/(^\.|\.$)/g, '')
  },

  getTime() {
    return Math.floor(Date.now() / 1000);
  },

  checkList(path, list) {
    try {
      const api = path ? path.toLowerCase() : '';
      return api && list && list.length && list.indexOf(api) > -1
    } catch (err) {
      return false
    }
  },

  _genParamsStr(params) {
    try {
      if (!params) return params
      return Object.values(baseUtil.toObject(params)).map((t) => baseUtil.toStr(t)).join('|')
    } catch (err) {
      return params
    }
  },

  /**
   * 生成日志唯一Key
   */
  genLogKey(log) {
    const { metricName, name, dim } = log || {};
    const data = dim || {};

    // 要校验的key，固定顺序
    return [
      (metricName || name).replace('hyext.sdk.', ''),
      data.sdk_path,
      data.status,
      this._genParamsStr(data.params),
      data.res,
      data.code
    ].join(':')
  }
};

/** 参数错误 */
const M_WARN_INFO = 'hyext.sdk.api.warn';
/** Reject */
const M_API_REJECT = 'hyext.sdk.error.rejectstatus';
/** API */
const M_API_CALL = 'hyext.sdk.api.status';
/** sendWup */
const M_SEND_WUP = 'hyext.sdk.sendwup.status';
/** API统计 */
const M_API_STATS = 'hyext.sdk.api.stats'; // 受采样率和次数限制，只记录接口调用成功/失败

/** API 状态 */
const API_STATUS = {
  CALL: 'call',
  WARN: 'warn',
  RESOLVE: 'resolve',
  REJECT: 'reject',
  BLOCKED: 'blocked'
};

/** 日志收集频率，单位s */
const FEQ_COLLECT = 5;

/** 日志屏蔽缓存时长，单位s */
const FEQ_TEMP = 20;

/** 屏蔽最多告警次数 */
const B_MAX_WARN_CNT = 1;

const B_LEVEL = {
  PASS: 0,
  WARN: 1,
  BLOCK: 2,
};

class Blocker {
  constructor() {
    this._debug = false;
    this._logs = {};
    this._feq = FEQ_TEMP;
    this._onblock = null;
    this._rate = 50;
    this._pass = true; // 统一采样开关，只随机一次，决定本次会话是否上报

    // 白名单
    this._whiteList = {
      name: [M_API_REJECT],
      status: [],
      api: [],
    };
    // 上报一次限制白名单，名单内不受一次上报限制
    this._onceWhiteList = {
      name: [M_SEND_WUP],
      status: [],
      api: []
    };

    this.setRate(50); // 提前触发
  }

  setDebug(flag) {
    this._debug = flag;
  }

  _log(...params) {
    this._debug && console.log('[GReporter Blocker]', ...params);
  }

  /**
   * 设置屏蔽监听
   * @param {Function} callback 
   */
  onBlock(callback) {
    if (baseUtil.isFun(callback)) {
      this._onblock = callback;
    }
  }

  /**
   * 设置缓存时长
   * @param {number} feq 缓存时长 
   */
  setFeq(feq) {
    if (baseUtil.isNumber(feq)) {
      this._feq = feq;
    }
  }

  /**
   * 设置采样率
   * @param {number} rate 采样率
   */
  setRate(rate) {
    if (!rate && rate !== 0) return '' // 放过 rate = 0 || rate = '0' 的情况
    this._rate = baseUtil.toNumber(rate, this._rate);
    this._pass = this._rate === 100 || Math.random() * 100 < this._rate;
    this._log(`set rate: ${this._rate}, pass: ${this._pass}`);
  }

  /**
   * 添加白名单
   * @param {"api"|"status"|"name"} type 
   * @param {Array.<*>} list 
   */
  addWhite(type, list) {
    const temp = this._whiteList[type];
    if (!temp || !list || !list.length) return;
    temp.push(...list);
  }

  /**
   * 日志检查
   */
  _filterList(log, config) {
    // metricName
    const { dim, name } = log || {};
    const { sdk_path: api, status } = dim || {};

    // 检查白名单状态
    if (status && baseProcess.checkList(status, config?.status)) return true

    // 检查白名单API
    if (api && baseProcess.checkList(api, config?.api)) return true

    // 检查白名单 name 即 metricName
    if (name && baseProcess.checkList(name, config?.name)) return true

    return false
  }

  /**
   * 采样率校验
   */
  _rateLimit(log) {
    return !this._pass
  }

  /**
   * 次数限制校验
   * @param {number} dis 时间间隔
   * @param {number} cnt 重复次数
   * @param {number} warn 告警次数
   */
  _contLimit(dis, cnt, warn) {
    // 高频上报：1s 内重复上报超过 10条
    if (dis <= 1 && cnt >= 10) return `high freq: ${cnt} in 1s`
    // 频繁上报：1s 1条 多次 触发报错
    const nWarn = (warn || 0) + 1;
    if (dis > 1 && dis <= 10 && cnt >= (10 / FEQ_COLLECT)) {
      // 告警累计达到最大次数直接报错
      if (nWarn >= B_MAX_WARN_CNT) return `too many: ${cnt} in ${dis}s`
      return B_LEVEL.WARN
    }
    return B_LEVEL.PASS
  }

  /**
   * 清除没用的缓存
   */
  _clearLogs() {
    this._log(`clear logs`, this._logs);
    const now = baseProcess.getTime();
    Object.keys(this._logs).map(key => {
      const { block, fst, warn } = this._logs[key] || {};
      // 没warn 没block 且 缓存超时 可移除
      if (!warn && !block && fst && (now - fst) >= this._feq) {
        this._log(`cleared log`, key);
        delete this._logs[key];
      } else if (block) {
        // 缓存优化
        this._logs[key] = { block };
      }
    });
  }

  /**
   * 是否已经屏蔽
   */
  isBlocked(key) {
    const { block } = this._logs[key] || {};
    return !!block
  }

  /**
   * 日志屏蔽检查
   */
  check(log) {
    try {
      // 日志忽略（白名单）
      if (this._filterList(log, this._whiteList)) {
        this._log(`hit white list`, log);
        return false
      }

      // 采样限制
      if (this._rateLimit(log)) {
        this._log(`hit rate limit`);
        return true;
      }

      const { its } = log || {};
      const itss = its || baseProcess.getTime();
      const key = baseProcess.genLogKey(log);
      const { fst, cont, warn, block } = this._logs[key] || {};

      // 屏蔽不再上报
      if (block) {
        this._log(block);
        return true
      }

      // 没第一次上报记录，设置记录
      if (!fst) {
        // 不在一次上报白名单内，只上报一次
        const block = !this._filterList(log, this._onceWhiteList) ? 'hit once' : false;
        this._logs[key] = { fst: itss, cont: 1, block };
        return false;
      }

      // 多次上报，限制上报次数
      const dis = itss - fst; // 时间间隔，单位s
      const cnt = cont + 1; // 重复次数
      const limit = this._contLimit(dis, cnt, warn);

      // 屏蔽判断
      if (limit === B_LEVEL.WARN) { // 命中警警告 累加警告
        this._logs[key].fst = itss;
        this._logs[key].cont = 1;
        this._logs[key].warn = (warn || 0) + 1;
        return false;
      } else if (limit) { // 命中屏蔽

        this._logs[key] = { block: limit };
        this._onblock && this._onblock(log, limit);
        this._log(`blocked`, limit);
        return true;
      }

      // 缓存计数
      if (dis >= this._feq) {
        // 避免当前日志被清理
        this._logs[key].fst = itss;
        this._logs[key].cont = 1;

        // 清理没用的日志
        this._clearLogs();
      } else {  // 缓存未超时计数累加
        this._logs[key].cont = cnt;
      }
      return false;
    } catch (err) {
      return false
    }
  }
}

var blocker = new Blocker();

/**
 * 日志合并
 */
class LogCollecter {
  constructor() {
    this._mLogs = null;
    this._aLogs = [];
    this._timer = null;
  }

  /**
   * 日志 黑名单 不做收集
   */
  _black(log) {
    const { dim } = log || {};
    const { sdk_path } = dim || {};
    const black = ['log'];
    return baseProcess.checkList(sdk_path, black)
  }

  /**
   * 设置上报方法
   */
  setReport(report) {
    this._report = report;
    this.clearLogs();
    return this
  }

  /**
   * 添加一般日志（不合并）
   * @param {*} log 
   */
  addLog(log) {
    if (log && !this._black(log)) {
      // 屏蔽检查
      // if (blocker.isBlocked(baseProcess.genLogKey(log))) return this
      this._aLogs.push(log);
    }
    return this
  }

  /**
   * 添加合并日志（合并计数）
   */
  mergeLog(log) {
    try {
      if (!log || this._black(log)) return this;
      const key = baseProcess.genLogKey(log);

      // 已屏蔽
      if (blocker.isBlocked(key)) return this;

      this._mLogs = this._mLogs || {};
      const { field: oField } = this._mLogs[key] || {};
      const { call_cont: oCont } = oField || {};
      const field = log.field || {};
      field.call_cont = (oCont || 0) + 1;
      this._mLogs[key] = {
        ...log,
        field,
      };
    } catch (err) {
      console.warn('merge log fail', err);
    }
    return this
  }


  /**
   * 上报一般日志
   * @param {boolean} holdAll 暂缓上报所有
   */
  clearAddLogs(holdAll) {
    try {
      const len = this._aLogs.length;
      if (!this._report || !len) return this;
      const temp = [...this._aLogs];
      this._aLogs = [];
      // hold: i < len - 1 暂缓上报 最后一条一起上报
      temp.forEach((log, i) => {
        this._report(log, holdAll || i < len - 1);
      });
    } catch (err) {
      console.warn('clear add logs fail', err);
    }

    return this;
  }

  /**
   * 上报合并日志
   * @param {boolean} holdAll 暂缓上报所有
   */
  clearMergeLogs(holdAll) {
    if (!this._report || !this._mLogs) return this
    try {
      const temp = { ...this._mLogs };
      this._mLogs = null;
      const keys = Object.keys(temp);
      const len = keys.length;
      if (!len) return this
      // hold: i < len - 1 暂缓上报 最后一条一起上报
      keys.forEach((key, i) => {
        this._report(temp[key], holdAll || i < len - 1);
      });
    } catch (err) {
      console.warn('clear merge logs fail', err);
    }
    return this;
  }

  /**
   * 上报所有日志
   * @param {*} holdAll 
   */
  clearLogs(holdAll) {
    this.clearMergeLogs(holdAll);
    this.clearAddLogs(holdAll);
  }

  /**
   * 循环收集
   */
  startLoop(immedit) {
    try {
      // 已开启循环 或 未配置收集上报 或 没有任何缓存日志
      if (this._timer || !this._report || (!this._mLogs && !this._aLogs.length)) {
        return this;
      }

      immedit && this.clearLogs(); // 确保延迟触发
      this._timer = setTimeout(() => this.clearLoop().startLoop(true), FEQ_COLLECT * 1000);
    } catch (_) {
      this.clearLoop();
    }
    return this;
  }

  /**
   * 清除循环
   */
  clearLoop() {
    try {
      if (this._timer) {
        clearTimeout(this._timer);
        this._timer = null;
      }
    } catch (_) {
      // console.warn(_)
    }
    return this;
  }
}

var collecter = new LogCollecter();

/** sentry */
// export const M_SENTRY_STATUS = 'hyext.sdk.sentry.loadstatus';
const M_SENTRY_EMIT = 'hyext.sdk.sentry.emit';

blocker.addWhite('name', [M_SENTRY_EMIT]);

/** senty日志上报 */
var sentryLog = {
  addLog(module, dim) {
    // sentry 上报无用，关闭
    module = module || {};
    collecter.addLog({
      metricName: M_SENTRY_EMIT,
      dim: {
        "module_name": module.moduleName,
        "entry_name": module.entryName,
        "busi_version": module.busiVersion,
        "base_version": module.baseVersion,
        "app_version": module.appVersion,
        "os_version": module.osVersion,
        "device_type": module.deviceType,
        "ext_name": module.extName,
        "ext_uuid": module.extUuid,
        "ext_type": module.extType,
        "ext_version_id": module.extVersionId,
        "ext_tech_type": module.extTechType,
        "room": module.room,
        "gid": module.gid,
        "suid": module.suid,
        "spid": module.spid,
        "framework": module.framework,
        ...(dim || {})
      },
    }).clearAddLogs();
  }
};

const HYRNSentry$1 = NativeModules?.HYRNSentry;
const isApp = NativeModules?.HYExtLocalMessageCenter;

/**
 * Sentry 报错监控上报
 */
const sentry = {
  _inited: false,

  _getDSN() {
    const DSNS = process.env.HYEXT_BUILD_ENV === 'production' ? {
      // app: 'https://7c11c7e248634907be99de22b91a3a56@bee-wpm.huya.com/121',
      // zs: 'https://aa329612944a49be818a00621fc08178@bee-wpm.huya.com/123',
      app: 'https://58d2edf3956d416ba87361a708d00ced@bee-wpm.huya.com/173',
      zs: 'https://010c8bcb8d554d6f972674a85c50e3bd@bee-wpm.huya.com/175',
    } : process.env.HYEXT_BUILD_ENV === 'test' ? {
      // app: 'https://b313bf57a97e4ba387069b68a02b492b@bee-wpm.huya.com/122',
      // zs: 'https://00584ae1210c40a793209152c54e9c3f@bee-wpm.huya.com/124',
      app: 'https://27d0d12b92ec4fbc87ca9002cb3a4245@bee-wpm.huya.com/174',
      zs: 'https://830d6383bc8f4753b78b277d44238057@bee-wpm.huya.com/176',
    } : {
    };
    return !isApp ? DSNS.zs : DSNS.app;
  },

  _init() {
    if (this._inited) throw new Error('already inited');
    if (!HYRNSentry$1) throw new Error('HYRNSentry is undefined');
    const dsn = this._getDSN();
    if (!dsn) throw new Error('DSN is undefined');
    const NativeHYRNSentry = HYRNSentry$1 || {};
    const str = NativeHYRNSentry.extUuid + "@" + NativeHYRNSentry.extVersion;
    Sentry.init({
      dsn, release: str, dist: 'release', environment: NativeHYRNSentry.environment, integrations: [
        new RewriteFrames({
          iteratee: (frame) => {
            if (frame.filename) {
              frame.filename = frame.filename
                .replace(/^file:\/\//, "")
                .replace(/^address at /, "")
                .replace(/^.*\/[^.]+(\.app|CodePush|.*(?=\/))/, "");
              if (frame.filename !== "[native code]" &&
                frame.filename !== "native") {
                if (NativeHYRNSentry.baseMoudleName && NativeHYRNSentry.baseDownloadUrl && frame.filename.indexOf(NativeHYRNSentry.baseMoudleName) != -1) {
                  frame.filename = NativeHYRNSentry.baseDownloadUrl;
                } else if (NativeHYRNSentry.busiDownloadUrl) {
                  frame.filename = NativeHYRNSentry.busiDownloadUrl;
                }
              }
            }
            return frame;
          },
        }),
      ],
      beforeSend(event, hint) {
        // 监控所有sentry的报错
        const { originalException } = hint || {};
        const { message } = originalException || {};
        sentryLog.addLog(NativeHYRNSentry, { msg: message });
        return event;
      }
    });
    Sentry.setTag("module-name", NativeHYRNSentry.moduleName);
    Sentry.setTag("entry-name", NativeHYRNSentry.entryName);
    Sentry.setTag("busi-version", NativeHYRNSentry.busiVersion);
    Sentry.setTag("base-version", NativeHYRNSentry.baseVersion);
    Sentry.setTag("app-version", NativeHYRNSentry.appVersion);
    Sentry.setTag("os-version", NativeHYRNSentry.osVersion);
    Sentry.setTag("device-type", NativeHYRNSentry.deviceType);
    Sentry.setTag("ext-name", NativeHYRNSentry.extName);
    Sentry.setTag("ext-uuid", NativeHYRNSentry.extUuid);
    Sentry.setTag("ext-type", NativeHYRNSentry.extType);
    Sentry.setTag("ext-version", NativeHYRNSentry.extVersion);
    Sentry.setTag("ext-version-id", NativeHYRNSentry.extVersionId);
    Sentry.setTag("ext-tech-type", NativeHYRNSentry.extTechType);
    Sentry.setTag("platform", Platform$1.OS);

    NativeHYRNSentry.room && Sentry.setTag("room", NativeHYRNSentry.room);
    NativeHYRNSentry.gid && Sentry.setTag("gid", NativeHYRNSentry.gid);
    NativeHYRNSentry.suid && Sentry.setTag("suid", NativeHYRNSentry.suid);
    NativeHYRNSentry.spid && Sentry.setTag("spid", NativeHYRNSentry.spid);
    NativeHYRNSentry.framework && Sentry.setTag("framework", NativeHYRNSentry.framework);

    this._inited = true;
    console.info('init sentry dsn:', dsn);
  },

  init() {
    try {
      this._init();
    } catch (err) {
      // console.warn('init sentry fail:', err)
    }
  },

  hookRejcetError() {
    try {
      require('promise/setimmediate/rejection-tracking').enable({
        onUnhandled: (id, e = {}) => {
          Sentry.captureException(e);
        }
      });
    } catch (err) {
      console.warn('hook unhandled reject fail:', err);
    }
  },

  hookError() {
    try {
      const defaultErrorHandler = global.ErrorUtils.getGlobalHandler();
      global.ErrorUtils.setGlobalHandler((e, isFatal) => {
        this.init();
        Sentry.captureException(e);
        defaultErrorHandler(e, isFatal);
      });
    } catch (err) {
      console.warn('hook global error fail:', err);
    }
  },

  setup() {
    try {
      // sentryLog.addLog(HYRNSentry, { status: SentryStatus.start })
      this._init();
      this.hookError();
      this.hookRejcetError();
      // sentryLog.addLog(HYRNSentry, { status: SentryStatus.succ })
    } catch (err) {
      // sentryLog.addLog(HYRNSentry, { status: SentryStatus.fail, msg: message || err })
    }
  }
};

sentry.setup();

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};

var GConfig = {
    /**
     * Debug
     */
    Debug: false,
    /**
     * 上报间隔
     */
    ReportFreq: 1000,
    /**
     * 打开上报
     */
    OpenReport: true,
    /**
     * 上报域名
     */
    RepotHost: "https://metric.huya.com",
    /**
     * 平台定义上报方法
     */
    PlatformRequest: undefined,
    /**
     * 基础信息
     */
    BaseInfo: { ua: "", uid: 0 },
    /**
     * 默认上报 Dim 数据
     */
    DefDimInfo: {},
    /**
     * 默认上报 Field 数据
     */
    DefFieldInfo: {},
};

var util = {
    isNum: function (val) {
        return typeof val === "number" && !isNaN(val) && isFinite(val);
    },
    isEmpty: function (val) {
        return val === undefined || val === null || val === "";
    },
    /**
     * 恢复默认数据
     */
    reAssign: function (target, defData) {
        if (!target || !defData)
            return;
        for (var key in defData) {
            if (this.isEmpty(target[key])) {
                target[key] = defData[key];
            }
        }
        return target;
    },
    toNumber: function (v, defVal, onError) {
        if (this.isEmpty(v))
            return defVal;
        try {
            var res = Number(v);
            if (isNaN(res))
                throw new Error("val is NaN"); // 不是数字
            if (!isFinite(res))
                throw new Error("val is Infinity"); // 无穷，除不尽
            return res;
        }
        catch (e) {
            onError && onError(e, v);
            return defVal;
        }
    },
    toString: function (v, defVal, onError) {
        if (this.isEmpty(v))
            return defVal;
        if (typeof v === "string")
            return v;
        try {
            if (typeof v === "object") {
                return JSON.stringify(v);
            }
            return String(v);
        }
        catch (e) {
            onError && onError(e, v);
            return defVal;
        }
    },
    /**
     * 统一转换对象参数类型
     */
    changeProps: function (obj, fun) {
        if (!obj || !fun)
            return obj;
        var temp = {};
        for (var key in obj) {
            temp[key] = fun(obj[key], key);
        }
        return temp;
    },
};

var Logger = /** @class */ (function () {
    function Logger(data) {
        this.addData(data);
        this.createAt = Math.round(Date.now() / 1000);
    }
    Logger.prototype.addData = function (data) {
        var _a = data || {}, metricName = _a.metricName, dim = _a.dim, field = _a.field, extdesc = _a.extdesc;
        this.metricName = metricName || this.metricName || "";
        this.extDesc = extdesc || this.extDesc || "";
        this.dimInfo = Object.assign(this.dimInfo || {}, dim || {});
        this.fieldInfo = Object.assign(this.fieldInfo || {}, field || {});
    };
    Logger.prototype.prefixDim = function (data) {
        if (!data)
            return;
        util.reAssign(this.dimInfo, data);
    };
    Logger.prototype.prefixField = function (data) {
        if (!data)
            return;
        util.reAssign(this.fieldInfo, data);
    };
    Logger.prototype.toJSON = function (debug) {
        // dim 只能传string 强转
        var dim = util.changeProps(this.dimInfo, function (prop, key) {
            return util.toString(prop, "", function (e) {
                return debug.warn("dim." + key + " to str fail:", e.message, prop);
            });
        });
        // field 只能传number 强转
        var field = util.changeProps(this.fieldInfo, function (prop, key) {
            return util.toNumber(prop, 0, function (e) {
                return debug.warn("field." + key + " to num fail:", e.message, prop);
            });
        });
        return {
            name: this.metricName,
            its: this.createAt,
            dim: dim,
            field: field,
            exlog: {
                extdesc: this.extDesc,
            },
        };
    };
    return Logger;
}());

function unwrapExports (x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}

function createCommonjsModule(fn, basedir, module) {
	return module = {
	  path: basedir,
	  exports: {},
	  require: function (path, base) {
      return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
    }
	}, fn(module, module.exports), module.exports;
}

function commonjsRequire () {
	throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
}

var classCallCheck = createCommonjsModule(function (module) {
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}

module.exports = _classCallCheck;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});

var _classCallCheck = /*@__PURE__*/unwrapExports(classCallCheck);

var _global$1 = createCommonjsModule(function (module) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
  ? window : typeof self != 'undefined' && self.Math == Math ? self
  // eslint-disable-next-line no-new-func
  : Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
});

var _core = createCommonjsModule(function (module) {
var core = module.exports = { version: '2.6.12' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
});

var _aFunction = function (it) {
  if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  return it;
};

// optional / simple context binding

var _ctx = function (fn, that, length) {
  _aFunction(fn);
  if (that === undefined) return fn;
  switch (length) {
    case 1: return function (a) {
      return fn.call(that, a);
    };
    case 2: return function (a, b) {
      return fn.call(that, a, b);
    };
    case 3: return function (a, b, c) {
      return fn.call(that, a, b, c);
    };
  }
  return function (/* ...args */) {
    return fn.apply(that, arguments);
  };
};

var _isObject = function (it) {
  return typeof it === 'object' ? it !== null : typeof it === 'function';
};

var _anObject = function (it) {
  if (!_isObject(it)) throw TypeError(it + ' is not an object!');
  return it;
};

var _fails = function (exec) {
  try {
    return !!exec();
  } catch (e) {
    return true;
  }
};

// Thank's IE8 for his funny defineProperty
var _descriptors = !_fails(function () {
  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});

var document = _global$1.document;
// typeof document.createElement is 'object' in old IE
var is = _isObject(document) && _isObject(document.createElement);
var _domCreate = function (it) {
  return is ? document.createElement(it) : {};
};

var _ie8DomDefine = !_descriptors && !_fails(function () {
  return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
});

// 7.1.1 ToPrimitive(input [, PreferredType])

// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
var _toPrimitive = function (it, S) {
  if (!_isObject(it)) return it;
  var fn, val;
  if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
  if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
  if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
  throw TypeError("Can't convert object to primitive value");
};

var dP = Object.defineProperty;

var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  _anObject(O);
  P = _toPrimitive(P, true);
  _anObject(Attributes);
  if (_ie8DomDefine) try {
    return dP(O, P, Attributes);
  } catch (e) { /* empty */ }
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  if ('value' in Attributes) O[P] = Attributes.value;
  return O;
};

var _objectDp = {
	f: f
};

var _propertyDesc = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};

var _hide = _descriptors ? function (object, key, value) {
  return _objectDp.f(object, key, _propertyDesc(1, value));
} : function (object, key, value) {
  object[key] = value;
  return object;
};

var hasOwnProperty = {}.hasOwnProperty;
var _has = function (it, key) {
  return hasOwnProperty.call(it, key);
};

var PROTOTYPE = 'prototype';

var $export = function (type, name, source) {
  var IS_FORCED = type & $export.F;
  var IS_GLOBAL = type & $export.G;
  var IS_STATIC = type & $export.S;
  var IS_PROTO = type & $export.P;
  var IS_BIND = type & $export.B;
  var IS_WRAP = type & $export.W;
  var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
  var expProto = exports[PROTOTYPE];
  var target = IS_GLOBAL ? _global$1 : IS_STATIC ? _global$1[name] : (_global$1[name] || {})[PROTOTYPE];
  var key, own, out;
  if (IS_GLOBAL) source = name;
  for (key in source) {
    // contains in native
    own = !IS_FORCED && target && target[key] !== undefined;
    if (own && _has(exports, key)) continue;
    // export native or passed
    out = own ? target[key] : source[key];
    // prevent global pollution for namespaces
    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
    // bind timers to global for call from export context
    : IS_BIND && own ? _ctx(out, _global$1)
    // wrap global constructors for prevent change them in library
    : IS_WRAP && target[key] == out ? (function (C) {
      var F = function (a, b, c) {
        if (this instanceof C) {
          switch (arguments.length) {
            case 0: return new C();
            case 1: return new C(a);
            case 2: return new C(a, b);
          } return new C(a, b, c);
        } return C.apply(this, arguments);
      };
      F[PROTOTYPE] = C[PROTOTYPE];
      return F;
    // make static versions for prototype methods
    })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
    if (IS_PROTO) {
      (exports.virtual || (exports.virtual = {}))[key] = out;
      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
      if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
    }
  }
};
// type bitmap
$export.F = 1;   // forced
$export.G = 2;   // global
$export.S = 4;   // static
$export.P = 8;   // proto
$export.B = 16;  // bind
$export.W = 32;  // wrap
$export.U = 64;  // safe
$export.R = 128; // real proto method for `library`
var _export = $export;

// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
_export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });

var $Object = _core.Object;
var defineProperty$1 = function defineProperty(it, key, desc) {
  return $Object.defineProperty(it, key, desc);
};

var defineProperty = defineProperty$1;

var createClass = createCommonjsModule(function (module) {
function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;

    defineProperty(target, descriptor.key, descriptor);
  }
}

function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  return Constructor;
}

module.exports = _createClass;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});

var _createClass = /*@__PURE__*/unwrapExports(createClass);

var Console = /*#__PURE__*/function () {
  function Console() {
    _classCallCheck(this, Console);
  }

  _createClass(Console, [{
    key: "setConfig",
    value: function setConfig(config) {
      var _ref = config || {},
          Debug = _ref.Debug;

      this.debug = !!Debug;
    }
  }, {
    key: "_debug",
    value: function _debug(type) {
      if (this.debug) {
        var _console;

        for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
          params[_key - 1] = arguments[_key];
        }

        // @ts-ignore
        (_console = console)[type].apply(_console, ["[GReporter]"].concat(params));
      }
    }
  }, {
    key: "log",
    value: function log() {
      for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        params[_key2] = arguments[_key2];
      }

      this._debug.apply(this, ["info"].concat(params));
    }
  }, {
    key: "warn",
    value: function warn() {
      for (var _len3 = arguments.length, params = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
        params[_key3] = arguments[_key3];
      }

      this._debug.apply(this, ["warn"].concat(params));
    }
  }]);

  return Console;
}();

var $JSON = _core.JSON || (_core.JSON = { stringify: JSON.stringify });
var stringify$1 = function stringify(it) { // eslint-disable-line no-unused-vars
  return $JSON.stringify.apply($JSON, arguments);
};

var stringify = stringify$1;

/* eslint-disable */
function toXCodeArray(str) {
  var x = [];

  for (var i = 0; i < str.length; i++) {
    var c = str.charCodeAt(i);
    if (c < 0x80) x.push(c);else if (c < 0x800) {
      x.push(0xc0 | c >> 6, 0x80 | c & 0x3f);
    } else if (c < 0xd800 || c >= 0xe000) {
      x.push(0xe0 | c >> 12, 0x80 | c >> 6 & 0x3f, 0x80 | c & 0x3f);
    } else {
      i++;
      c = 0x10000 + ((c & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);
      x.push(0xf0 | c >> 18, 0x80 | c >> 12 & 0x3f, 0x80 | c >> 6 & 0x3f, 0x80 | c & 0x3f);
    }
  }

  return x;
}

function xEncode(d, k) {
  var data = stringify(d);

  var key = "".concat(k);
  var r = '';
  var t = '';
  var o = '';
  var i = 0;
  var m = 0;
  var mm = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  var c1;
  var c2;
  var c3;
  var e1;
  var e2;
  var e3;
  var e4;
  var dArray = toXCodeArray(data);
  var j;

  for (i = dArray.length - 1, j = 0; i >= 0; i--) {
    t = dArray[i] ^ key.charCodeAt(j) ^ m;
    r = r + String.fromCharCode(t);
    j = ++j % key.length;
    m = t;
  }

  i = 0;

  while (i < r.length) {
    c1 = r.charCodeAt(i++);
    c2 = r.charCodeAt(i++);
    c3 = r.charCodeAt(i++);
    e1 = c1 >> 2;
    e2 = (c1 & 3) << 4 | c2 >> 4;
    e3 = (c2 & 15) << 2 | c3 >> 6;
    e4 = c3 & 63;

    if (isNaN(c2)) {
      e3 = e4 = 64;
    } else if (isNaN(c3)) {
      e4 = 64;
    }

    o = o + mm.charAt(e1) + mm.charAt(e2) + mm.charAt(e3) + mm.charAt(e4);
  }

  return o;
}

function post(url, data) {
  try {
    var xhr = new XMLHttpRequest();
    xhr.open('POST', url);
    xhr.setRequestHeader('Content-Type', 'text/plain');
    xhr.send(data || {});
  } catch (err) {// console.warn('log report fail: ', err);
  }
}

function generateGuid() {
  var s = [];
  var hexDigits = '0123456789abcdef';

  for (var i = 0; i < 36; ++i) {
    s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
  }

  s[14] = '4';
  s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1);
  s[8] = s[13] = s[18] = s[23] = '-';
  return s.join('');
}

var tools = {
  xEncode: xEncode,
  post: post,
  generateGuid: generateGuid
};

var guid = tools.generateGuid();
var Collecter = /** @class */ (function () {
    function Collecter() {
        this.logs = [];
        this.baseInfo = { ua: "", uid: 0 };
        this.comDimInfo = {};
        this.comFieldInfo = {};
        this.console = new Console();
    }
    /** 设置配置 */
    Collecter.prototype.setConfig = function (config) {
        this.console.setConfig(config);
        var _a = config || {}, BaseInfo = _a.BaseInfo, DefDimInfo = _a.DefDimInfo, DefFieldInfo = _a.DefFieldInfo, LogBlocker = _a.LogBlocker;
        if (BaseInfo) {
            Object.assign(this.baseInfo, BaseInfo);
        }
        if (DefDimInfo) {
            Object.assign(this.comDimInfo, DefDimInfo);
        }
        if (DefFieldInfo) {
            Object.assign(this.comFieldInfo, DefFieldInfo);
        }
        if (LogBlocker) {
            this.checkBlock = LogBlocker;
        }
    };
    /**
     * 日志过滤
     */
    Collecter.prototype.filter = function (data) {
        if (this.checkBlock) {
            return this.checkBlock(data, this.logs);
        }
        return false;
    };
    /**
     * 添加日志
     */
    Collecter.prototype.add = function (log) {
        log.prefixDim(this.comDimInfo);
        log.prefixField(this.comFieldInfo);
        var data = log.toJSON(this.console);
        // 上报限制，高频/异常日志忽略上报
        if (!this.filter(data)) {
            this.logs.push(data);
            this.console.log("add log", data);
        }
        return this;
    };
    /**
     * 收集数据
     */
    Collecter.prototype.collect = function () {
        if (!this.logs.length) {
            return null;
        }
        var _a = this.baseInfo, sguid = _a.sguid, ua = _a.ua, uid = _a.uid;
        return {
            ua: ua || "",
            uid: uid || 0,
            sguid: sguid || guid,
            m: this.logs,
        };
    };
    /**
     * 清除日志
     */
    Collecter.prototype.clear = function () {
        this.logs = [];
        return this;
    };
    return Collecter;
}());

var Reporter = /** @class */ (function () {
    function Reporter() {
        this.console = new Console();
    }
    Reporter.prototype.setConfig = function (config) {
        var RepotHost = config.RepotHost, PlatformRequest = config.PlatformRequest, OpenReport = config.OpenReport, ReportFreq = config.ReportFreq;
        this.host = RepotHost;
        this.request = PlatformRequest || tools.post;
        this.openReport = !!OpenReport;
        this.freq = util.isNum(ReportFreq) ? ReportFreq || 0 : 0;
        this.console.setConfig(config);
    };
    Reporter.prototype._report = function (data) {
        if (!this.host) {
            this.console.warn("host is null");
            return;
        }
        if (!this.request) {
            this.console.warn("request is null");
            return;
        }
        try {
            var timestamp = Date.now();
            this.console.log("reporting: ", JSON.stringify(data));
            // 数据加密
            var postData = tools.xEncode(data, timestamp);
            var url = this.host + "?ts=" + timestamp;
            return this.request(url, postData);
        }
        catch (err) {
            this.console.warn("report fail:", err);
        }
    };
    /**
     * 上报
     * @param collecter 日志收集器
     * @param immedit 是否直接上报
     * @param useFreq 是否开启定频
     */
    Reporter.prototype.report = function (collecter, immedit, useFreq) {
        var _this = this;
        // 关闭上报
        if (!this.openReport) {
            this.console.warn("report is closed");
            return;
        }
        // 参数异常
        if (!collecter) {
            this.console.warn("collecter is null");
            return;
        }
        try {
            // 定频 && 上报冷却中
            if (useFreq && this.timer)
                return;
            // 上报
            if (immedit) {
                var data = collecter.collect();
                // 无上报数据
                if (!data)
                    return;
                // 上报数据
                this._report(data);
                collecter.clear();
            }
            // 不定频
            if (!useFreq)
                return;
            // 定频
            this.timer = setTimeout(function () { return _this.clearTimer().report(collecter, true, true); }, this.freq);
        }
        catch (err) {
            this.clearTimer();
            this.console.warn("report fail:", err);
        }
    };
    Reporter.prototype.clearTimer = function () {
        try {
            this.timer && clearTimeout(this.timer);
        }
        catch (err) {
            this.console.warn("report clear fail:", err);
        }
        this.timer = null;
        return this;
    };
    return Reporter;
}());

var GrafanaReporter = /** @class */ (function () {
    function GrafanaReporter() {
        this.collecter = new Collecter();
        this.reporter = new Reporter();
    }
    /**
     * 修改配置信息
     */
    GrafanaReporter.prototype.setConfig = function (config) {
        var conf = __assign(__assign({}, GConfig), (config || {}));
        this.collecter.setConfig(conf);
        this.reporter.setConfig(conf);
    };
    /**
     * 仅收集日志，不上报
     */
    GrafanaReporter.prototype.collectLog = function (params) {
        return this.collecter.add(new Logger(params));
    };
    /**
     * 立即上报（立即上报 + 忽略定频）
     * 清空所有收集的日志，立即上报
     */
    GrafanaReporter.prototype.report = function (params) {
        this.collecter.add(new Logger(params));
        return this.reporter.report(this.collecter, true, false);
    };
    /**
     * 定频上报（立即上报 + 定频）
     * 冷却时间内延迟上报，否则立即上报
     */
    GrafanaReporter.prototype.freqReport = function (params) {
        this.collecter.add(new Logger(params));
        return this.reporter.report(this.collecter, true, true);
    };
    /**
     * 延迟上报（延迟上报 + 定频）
     * 统一延迟定频上报
     */
    GrafanaReporter.prototype.delayReport = function (params) {
        this.collecter.add(new Logger(params));
        return this.reporter.report(this.collecter, false, true);
    };
    return GrafanaReporter;
}());
var GReporter = new GrafanaReporter();

/**
* 仅调用一次
* @param fun 只执行一次的方法
*/
function oncePromise(fun) {
  let tempPromise;
  let calling = false;

  return function (...args) {
    if (calling) return tempPromise;
    calling = true;
    return (tempPromise = fun(...args))
  };
}

// 处理传入参数
const ParamsRender = {
  'sendWup': (params) => {
    const {
      servant,
      funcName,
      reqClassName,
      rspClassName,
      channel,
      useDirectStrategy
    } = (params && params[0]) || {};

    return {
      servant,
      funcName,
      reqClassName,
      rspClassName,
      channel,
      useDirectStrategy
    }
  },
  'setLayout': (params, base) => {
    const {
      visible,
      x,
      y,
      width,
      height,
      alpha
    } = (params && params[0]) || {};
    const { zIndex } = base || {};

    return {
      visible: visible ? 1 : 0,
      x: x || 0,
      y: y || 0,
      width: width || 0,
      height: height || 0,
      alpha: alpha || 0,
      zIndex: zIndex || 0,
    }
  }
};

// 处理返回数据
const ResRender = {
  'sendWup': (res) => {
    return {
      bcode: res?.bcode
    }
  }
};

class BaseRender {
  constructor() {
    this.getBase = () => { };
  }

  regGetBase(fun) {
    if (fun) {
      this.getBase = oncePromise(fun);
    }
  }

  async rParams(key, params) {
    try {
      const fun = ParamsRender[key];
      if (!fun) return null
      const base = await this.getBase();
      return await fun(params, base)
    } catch (err) {
      return null
    }
  }

  async rRes(key, res) {
    try {
      const fun = ResRender[key];
      if (!fun) return null
      return await fun(res)
    } catch (err) {
      return null
    }
  }
}

const dataRender = new BaseRender();

var render = {
  /** 注册获取基础信息的方法 */
  regGetBaseFun(fun) {
    dataRender.regGetBase(fun);
  },

  /**
   * 渲染请求信息
   */
  async renderReq(info, dim, field) {
    const { moduleName, api, params } = info || {};
    const reqI = await dataRender.rParams(api, params);

    return {
      dim: {
        sdk_path: baseProcess.getPath(moduleName, api),
        params: baseUtil.toStr(reqI),
        ...(dim || {})
      },
      field
    }
  },

  /**
   * 警告信息处理
   */
  async renderWarn(data, dim, field) {
    const { moduleName, api, params, err, msg: dataMsg } = data || {};
    const { msg, code } = err || {};
    const reqI = await dataRender.rParams(api, params);

    return {
      dim: {
        sdk_path: baseProcess.getPath(moduleName, api),
        params: baseUtil.toStr(reqI),
        code: baseUtil.toStr(code),
        msg: msg || dataMsg || '',
        ...(dim || {})
      },
      field
    }
  },

  /**
   * 错误信息处理
   */
  async renderErr(error, dim, field) {
    const { moduleName, api, params, err, dur } = error || {};
    const { msg, code } = err;
    const reqI = await dataRender.rParams(api, params);

    return {
      dim: {
        sdk_path: baseProcess.getPath(moduleName, api),
        params: baseUtil.toStr(reqI),
        code: baseUtil.toStr(code),
        msg: msg || '',
        ...(dim || {})
      },
      field: {
        duration: dur,
        ...(field || {})
      }
    }
  },

  /**
   * 信令消息处理
   */
  async renderWup(data, dim, field) {
    const { api, params, res } = data || {};
    const reqI = await dataRender.rParams(api, params);
    const resI = await dataRender.rRes(api, res);
    if (!resI) return null

    return {
      dim: {
        params: baseUtil.toStr(reqI),
        func_name: reqI.funcName,
        bcode: resI.bcode,
        ...(dim || {})
      },
      field
    }
  },

  /**
   * 处理状态数据
   */
  async renderStats(data, dDim, dField) {
    const { moduleName, api, err, dur, res } = data || {};
    const dim = {
      sdk_path: baseProcess.getPath(moduleName, api),
      // params: baseUtil.toStr(params)
      ...(dDim || {})
    };

    const field = {
      duration: dur,
      ...(dField || {})
    };

    if (err) {
      const { code, msg } = err;
      dim.code = baseUtil.toStr(code);
      dim.msg = baseUtil.toStr(msg);
    }

    return {
      dim,
      field,
    }
  }
};

function initReporter() {
  // 屏蔽开发环境
  if (system.isBuildDev()) return;

  // 获取信息
  const initTime = baseProcess.getTime();
  const extInfo = baseParams.getExtInfo();
  const sdkInfo = baseParams.getSDKInfo();
  const baseInfo = baseParams.getBaseInfo();

  extsdk.logger.debug({ initTime, baseInfo, sdkInfo, extInfo });

  // 获取extUuid失败不上报
  if (!extInfo.extUuid) return;

  // baseInfo
  const { suid, gid, ...bInfo } = baseInfo;

  // 基础配置
  GReporter.setConfig({
    Debug: false,
    OpenReport: true,
    BaseInfo: {
      uid: suid,
      ua: `hyext-sdk@${sdkInfo.version}`, // 所属平台的ua
    },
    DefDimInfo: {
      os: sdkInfo.os,
      platform: sdkInfo.platform,
      sdk_version: sdkInfo.version,
      sdk_env: sdkInfo.env,
      ext_id: extInfo.extUuid,
      ext_type: extInfo.extType,
      ext_version: extInfo.extVersion,
      ext_name: extInfo.extName,
    },
    DefFieldInfo: {
      init: initTime,
      call_cont: 1,
      value: 1
    },
    LogBlocker: blocker.check.bind(blocker),
    ReportFreq: 2000
  });

  // 注册获取基础信息的方法
  render.regGetBaseFun(baseParams.getInitParam.bind(baseParams));

  // 监听API调用
  extsdk.event.on(extsdk.event.EVENTS.API_CALL, (data) => {
    render.renderReq(data, {
      status: API_STATUS.CALL,
    }).then((info) => {
      info && GReporter.delayReport({
        metricName: M_API_CALL,
        dim: info.dim
      });
    }).catch(_ => { });
  });

  // 监听调用resolve，只上报sendWup，并做计数合并
  extsdk.event.on(extsdk.event.EVENTS.API_RESOLVE, (data) => {
    render.renderStats(data, {
      status: API_STATUS.RESOLVE,
      ...(bInfo || {})
    }).then(info => {
      info && GReporter.delayReport({
        metricName: M_API_STATS,
        dim: info.dim,
        field: info.field
      });
    }).catch(_ => { });

    if (data?.api !== 'sendWup') return;
    render.renderWup(data).then(info => {
      info && collecter.mergeLog({
        metricName: M_SEND_WUP,
        dim: info.dim,
      }).startLoop();
    }).catch(_ => { });
  });

  // 监听参数错误，并做计数合并
  extsdk.event.on(extsdk.event.EVENTS.ERR_PARAM, (err) => {
    render.renderWarn(err, bInfo).then(info => {
      info && collecter.mergeLog({
        metricName: M_WARN_INFO,
        dim: info.dim
      }).startLoop();
    }).catch(_ => { });
  });

  // 监听reject
  extsdk.event.on(extsdk.event.EVENTS.ERR_REJECT, (err) => {
    render.renderErr(err, bInfo).then(info => {
      info && GReporter.delayReport({
        metricName: M_API_REJECT,
        dim: info.dim,
        field: info.field
      });
    }).catch(_ => { });
  });

  // 获取初始化参数
  baseParams.getInitParam().then(initInfo => {
    // 设置采样
    blocker.setRate(initInfo?.sdkSampleRate);

    // 次数管理配置
    collecter.setReport((data, hold) => hold ? GReporter.collectLog(data) : GReporter.freqReport(data));

    // 开始上报
    collecter.startLoop();

  }).catch(_ => { });
}

(function () {
  try {
    initReporter();
  } catch (err) {
    console.warn('init RN GReport fail:', err);
  }
})();

var reporter = {
  init() {
    try {
      extsdk.logger.getConfig()
        .then(conf => {
          const Debug = conf.printLevel < 1;
          GReporter.setConfig({ BaseInfo: {}, Debug }); // BaseInfo 必须有，GReporter 二次config的bug
          blocker.setDebug(Debug);
        })
        .catch(_ => { });
    } catch (_) {
      // console.warn(_)
    }
  }
};

const eventMap = {
  'MiniApp': 'HYExt',
  'kMiniAppWebSocketOpen': 'kHYExtWebSocketOpen',
  'kMiniAppWebSocketClosed': 'kHYExtWebSocketClosed',
  'kMiniAppWebSocketFailed': 'kHYExtWebSocketFailed',
  'kMiniAppWebSocketMessage': 'kHYExtWebSocketMessage',
};

const modeMap = {
  "MiniAppEBS": "HYExtEBS",
  "MiniAppWebSocket": "HYExtWebSocket",
  "MiniAppStorage": "HYExtStorage",
};

const { modeManager } = extsdk.core.getCommon() || {};

if (modeManager) {
  /**
   * 适配逻辑
   * 注册基础模块获取策略
   */
  modeManager.setGetModeStrategy(moduleName => {
    const newModeName = modeMap[moduleName] || moduleName;
    return NativeModules[newModeName];
  });

  modeManager.setGetNameStrategy(name => {
    return eventMap[name] || name;
  });
}

var taf = {
  async loadTaf() {
    return Taf;
  }
};

// import AsyncStorage from '@react-native-async-storage/async-storage'
const localStorage = (function () {
  try {
    if (AsyncStorage$1) return AsyncStorage$1
    return null
  } catch (err) {
    return null
  }
})();

var adapter = {
  taf,
  abab,
  localStorage
};

var client = {
  isExt: !!NativeModules.HYExtLocalMessageCenter
};

/**
 * 生命周期
 */
class ExtAppState {
  constructor() {
    this._appState = AppState.currentState;
    this.enterForegroundCallback = [];
    this.leaveForegroundCallback = [];

    AppState.addEventListener('change', (nextAppState) => {
      if (this._appState.match(/inactive|background/) && nextAppState === 'active') {
        this.enterForegroundCallback.map(callback => callback());
      }
      else if (this._appState === 'active' && nextAppState.match(/inactive|background/)) {
        this.leaveForegroundCallback.map(callback => callback());
      }
      this._appState = nextAppState;
    });
  }

  onLoad(callback) {
    if (baseUtil.isFun(callback)) {
      callback();
    }
  }

  onEnterForeground(callback) {
    if (baseUtil.isFun(callback)) {
      this.enterForegroundCallback.push(callback);
    }
  }

  onLeaveForeground(callback) {
    if (baseUtil.isFun(callback)) {
      this.leaveForegroundCallback.push(callback);
    }
  }
}

var HYExtAppState$3 = new ExtAppState();

const ExtNative$o = NativeModules.HYExtLiveEvent;
const { nativeEventer: nativeEventer$o } = extsdk.core.getCommon();
const instance$o = new nativeEventer$o('hyExtLiveEvent', ExtNative$o);
instance$o.setIntercept({
  beforeOn: (eventName, callback, options) => {
    ExtNative$o.addEventListener(eventName);
  },
  afterOff: (eventName, callback, options) => {
    if (instance$o.isClean(eventName)) {
      ExtNative$o.removeEventListener(eventName);
    }
  },
  resReducer: res => {
    const { name, params } = res || {};
    const { header, body } = params || {};
    const { event, content } = body || {};
    const msg = baseUtil.toObject(content, content);
    return { name: event, params: msg };
  },
});

var HYExtLiveEvent$1 = {
  on: ExtNative$o ? (event, callback) => {
    return instance$o.on(event, callback);
  } : undefined,

  off: ExtNative$o ? (event, callback) => {
    return instance$o.off(event, callback);
  } : undefined,
};

const ExtNative$n = NativeModules.HYExtDevice;
const { nativeEventer: nativeEventer$n } = extsdk.core.getCommon();
const instance$n = new nativeEventer$n('hyExtDeviceEvent', ExtNative$n);
instance$n.setIntercept({
  beforeOn: (eventName, callback, options) => {
    ExtNative$n.addEventListener(eventName);
  },
  afterOff: (eventName, callback, options) => {
    if (instance$n.isClean(eventName)) {
      ExtNative$n.removeEventListener(eventName);
    }
  }
});

var HYExtDevice$1 = {
  onWebViewContainerLayoutChange(callback) {
    return instance$n.on('onWebViewContainerLayoutChange', callback);
  },

  onBroadcastMessage({ eventName, callback }) {
    return instance$n.on(eventName, callback);
  },

  offBroadcastMessage({ eventName }) {
    return instance$n.off(eventName);
  },
};

const ExtNative$m = NativeModules.HYExtTheme;
const { nativeEventer: nativeEventer$m } = extsdk.core.getCommon();
const themeChangeEvent = 'kHYRNThemeChangeNoti';
const instance$m = new nativeEventer$m('HYExtThemeMessage', ExtNative$m);
instance$m.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance$m.isClean(eventName)) {
      return ExtNative$m.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback, options) => {
    return ExtNative$m.removeEventListener(eventName);
  },
});

var HYExtTheme$1 = {

  onThemeChange: ExtNative$m ? (params) => {
    const { callback } = params || {};
    return instance$m.on(themeChangeEvent, callback);
  } : undefined,

  offThemeChange: ExtNative$m ? () => {
    return instance$m.off(themeChangeEvent);
  } : undefined,
};

const ExtNative$l = NativeModules.HYExtUI;
const { nativeEventer: nativeEventer$l } = extsdk.core.getCommon();
const toastClick = 'toastClick';
const instance$l = new nativeEventer$l('HYExtUIMessage', ExtNative$l);
instance$l.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance$l.isClean(eventName)) {
      return ExtNative$l.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback, options) => {
    return ExtNative$l.removeEventListener(eventName);
  },
});

const HYExtInputBar = NativeModules.HYExtInputBar || {};

var HYExtUI$1 = {
  
  onEntranceToastClick: ExtNative$l ? (params) => {
    const { callback } = params || {};
    return instance$l.on(toastClick, callback);
  } : undefined,

  offEntranceToastClick: ExtNative$l ? (params) => {
    return instance$l.off(toastClick);
  } : undefined,

  showNativeInputBar: HYExtInputBar.showInputBar ? async (params) => {
    const text = await NativeModules.HYExtInputBar.showInputBar(params);
    return { text }
  } : undefined,
};

const ExtNative$k = NativeModules.HYExtEnv;
const KMap = {
  baseBundleLoad: "load_basebundle_start",
  baseBundleLoadEnd: "load_basebundle_end",
  busiBundleLoad: "load_busibundle_start",
  busiBundleLoadEnd: "load_busibundle_end",
  bridgeCreate: "create_bridge_start",
  vcCreate: "create_vc_start",
  rootViewCreate: "create_rootview_start",
  viewAppear: "rn_view_appear",
  bundleLoadType: "bundle_load_type",
  baseDownload: "download_base_start",
  baseDownloadEnd: "download_base_end",
  busiDownload: "download_busi_start",
  busiDownloadEnd: "download_busi_end",
};

const JumpKeys = ['session_id'];

var HYExtEnv$2 = {
  getPerformaceData: (ExtNative$k && ExtNative$k.getPerformaceData) ? async () => {
    const res = await ExtNative$k.getPerformaceData();
    const { data, ...extra } = res || {};
    if (!data) return res;

    const temp = {};
    // 统一字符串转number
    Object.keys(data).map(key => {
      if (JumpKeys.indexOf(key) > -1) {
        temp[key] = baseUtil.toStr(data[key]);
      } else {
        // 统一数据转换，大于5小于13位的时间戳补空位
        const val = data[key];
        const value = `${val}`.length > 5 ? `${val}0000000`.slice(0, 13) : val;
        // 处理某些ios版本key不对
        temp[KMap[key] || key] = baseUtil.toNumber(value);
      }
    });

    return {
      data: temp,
      ...extra
    }
  } : undefined
};

const HYExtVip$1 = NativeModules.HYExtVip;

var HYExtVip$2 = {
  getJWT(params) {
    // APP端没有接入参数
    return HYExtVip$1.getJWT()
  }
};

const ExtNative$j = NativeModules.HYExtPopup;
const NoticeShowEvent = 'popupNoticeShow';
const NoticeHideEvent = 'popupNoticeHide';
const { nativeEventer: nativeEventer$k } = extsdk.core.getCommon();
const instance$k = new nativeEventer$k('HYExtPopupMessage', ExtNative$j);
instance$k.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance$k.isClean(eventName)) {
      return ExtNative$j.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback, options) => {
    if (instance$k.isClean(eventName)) {
      return ExtNative$j.removeEventListener(eventName);
    }
  }
});

var HYExtPopup$1 = {
  onNoticeShow: ExtNative$j && ExtNative$j.addEventListener ? (params) => {
    const { callback } = params || {};
    return instance$k.on(NoticeShowEvent, callback);
  } : undefined,

  offNoticeShow: ExtNative$j && ExtNative$j.removeEventListener ? () => {
    return instance$k.off(NoticeShowEvent);
  } : undefined,

  onNoticeHide: ExtNative$j && ExtNative$j.addEventListener ? (params) => {
    const { callback } = params || {};
    return instance$k.on(NoticeHideEvent, callback);
  } : undefined,

  offNoticeHide: ExtNative$j && ExtNative$j.removeEventListener ? () => {
    return instance$k.off(NoticeHideEvent);
  } : undefined,
};

var HYExtConsts$1 = {
  getInstance() {
    return NativeModules.HYExtConsts || {}
  },
};

var modules = {
  HYExtAppState: HYExtAppState$3,
  HYExtLiveEvent: HYExtLiveEvent$1,
  HYExtDevice: HYExtDevice$1,
  HYExtTheme: HYExtTheme$1,
  HYExtUI: HYExtUI$1,
  HYExtEnv: HYExtEnv$2,
  HYExtVip: HYExtVip$2,
  HYExtPopup: HYExtPopup$1,
  HYExtConsts: HYExtConsts$1
};

const { nativeEventer: nativeEventer$j } = extsdk.core.getCommon();
const ExtNative$i = NativeModules.HYExtDevelperLocalMessage;
const instance$j = new nativeEventer$j('HYExtDevelperLocalMessageMessage', ExtNative$i);
instance$j.setIntercept({
  beforeOn: (eventName, callback, options) => {
    return ExtNative$i.addEventListener(eventName);
  },
  afterOff: (eventName, callback) => {
    return ExtNative$i.removeEventListener(eventName);
  }
});

var DevelperLocalMessage$1 = {
  onDeveloperLocalMessage: ExtNative$i ? async (params) => {
    const { eventName, callback } = params || {};

    // 避免重复触发
    await ExtNative$i.removeEventListener(eventName);
    await instance$j.on(eventName, callback);
  } : undefined,

  offDeveloperLocalMessage: ExtNative$i ? async (params) => {
    const { eventName } = params || {};
    await instance$j.off(eventName);
  } : undefined,

  postDevelperLocalMessage: ExtNative$i ? async (params) => {
    return ExtNative$i.postDevelperLocalMessage(params)
  } : undefined,
};

const { nativeEventer: nativeEventer$i } = extsdk.core.getCommon();
const instance$i = new nativeEventer$i('hyExtObserverEvent', NativeModules.HYExtObserver);
instance$i.setIntercept({
  resReducer: res => {
    if (instance$i.isAndroid()) return res;
    const { event, content } = res || {};
    return { name: event, params: content };
  },
});

const MsgExtNative = NativeModules.HYExtLocalMessageCenter;
const msgInstance = new nativeEventer$i('extLocalMessage', MsgExtNative);
msgInstance.setIntercept({
  resReducer: res => {
    if (instance$i.isAndroid()) return res;
    const { name, params } = res || {};
    const { message } = params || {};
    return { name, params: message };
  },
  beforeOn: (eventName, callback) => {
    if (!msgInstance.isAndroid()) {
      return MsgExtNative.addLocalMessageListener(eventName);
    }
  },
  afterOff: (eventName) => {
    if (!msgInstance.isAndroid()) {
      return MsgExtNative.removeLocalMessageListener(eventName);
    }
  }
});

var HYExtObserver$2 = {
  on(event, callback) {
    return instance$i.on(event, callback);
  },

  off(event, callback) {
    return instance$i.off(event, callback);
  },

  onLocalMessage({ eventName, callback }) {
    return msgInstance.reset(eventName, callback);
  },

  offLocalMessage({ eventName }) {
    return msgInstance.off(eventName);
  },

  postLocalMessage(params) {
    return MsgExtNative.postLocalMessage(params);
  },

  ...DevelperLocalMessage$1
};

const NativeExt = NativeModules.HYExtFs;
const SuccMsg = "offlineFileReady succ";
const ListenEvent = "kOfflineFileReady";

let _emitter = null;
let _eventer = null;

const _initEmitter = function () {
  if (_emitter) return;
  _eventer = new EventManager();
  _emitter = new NativeEventEmitter(NativeExt);
  _emitter.addListener(ListenEvent, evt => _eventer.emit(evt.url, SuccMsg));
};

const waitEventEmit = function (eventName) {
  _initEmitter();
  return new Promise((resolve, reject) => {
    _eventer.once(eventName, res => resolve(res));
  });
};

var HYExtFs$1 = {
  /**
   * 监听离线资源是否下载完成消息
   */
  async offlineFileReady(params) {
    if (!params || !params.url) {
      throw new Error("url is undefined");
    }

    const isReady = await NativeExt.checkOfflineFileReady(params);
    if (isReady) {
      return SuccMsg;
    }

    return await waitEventEmit(params.url);
  }
};

var obj = {
  /**
   * 对象过滤
   * @param {Object} obj 
   * @param {Array<string>} jumpKeys 
   */
  filter(obj, jumpKeys, def = {}) {
    if (!obj) return def;
    const temp = {};
    Object.keys(obj).map(key => {
      if (jumpKeys && jumpKeys.indexOf(key) < 0) {
        temp[key] = obj[key];
      }
    });
    return temp;
  },

  /**
   * 根据path字符串读取对象内容
   * @param {Object} obj Object
   * @param {string} path xx.xx.xx
   */
  readByPath(obj, path) {
    if (!obj || !path || typeof path !== 'string') return undefined;
    const _readVal = (data, keys) => {
      if (!data) return data; // 没有可读数据
      if (!keys || !keys.length) return data; // 读完
      const val = data[keys.shift()];
      return _readVal(val, keys);
    };

    return _readVal(obj, path.split('.'))
  },

  /**
   * 对象序列化
   * @param {Object} obj 
   * @param {Array<string>} order 
   */
  serialize(obj, order) {
    if (!obj) return ''
    if (!order || !order.length) return ''
    return order.map(path => baseUtil.toStr(this.readByPath(obj, path))).join('|')
  }
};

/**
 * Wup信息 序列化
 * @param {Taf.Wup} data 
 * @returns {string}
 */
function wupSerialize(data) {
  return obj.serialize(data, ['status.value', 'iVersion', 'iMessageType', 'iTimeout', 'cPacketType'])
}

/**
 * Wup 消息加密
 * @param {string} serventName 加密方法名
 * @param {Function} func 加密方法
 * @param {any} data 加密数据
 * @returns {string} 加密消息
 */
function wupEncode(serventName, func, data) {
  const wup = new Taf.Wup();
  wup.setServant(serventName);
  wup.setFunc(func);
  wup.writeStruct("tReq", data);
  const outputStream = wup.encode();
  const arrayBuffer = outputStream.getBuffer();
  return base64Util.encode(arrayBuffer);
}

/**
 * @typedef {Object} DecodeInfo
 * @property {Taf.Wup} buffer 读取的流信息
 * @property {Object} rsp 读取结果
 * @property {number} bcode code
 */
/**
 * Wup 消息解析
 * @param {string} base64Str 解析base64字符串
 * @param {Function} ParseClass 解析类
 * @returns {DecodeInfo}
 */
function wupDecode(base64Str, ParseClass, readCode) {
  let wup, rspStruct, code = 0;
  try {
    // base64解码
    const arrayBuffer = base64Util.decode(base64Str);

    // wup解码
    wup = new Taf.Wup();
    wup.decode(arrayBuffer);

    if (readCode) {
      code = wup.readInt32('');
    }

    // key校验
    const key = (wup.newdata.get('tRsp') && 'tRsp') || (wup.newdata.get('tResp') && 'tResp');
    if (!key) {
      throw new Error('Unavailable Response: unfound key tRsp or tResp')
    }

    // 用RspClass解析
    rspStruct = new ParseClass();
    wup.readStruct(key, rspStruct, ParseClass);

    return {
      buffer: wup,
      rsp: rspStruct,
      bcode: code,
    }
  } catch (err) {
    // 返回错误信息
    // err.message = `${err.message}|${wupSerialize(wup)}`;
    err.serialize = `${wupSerialize(wup)}`;
    err.response = {
      buffer: wup,
      rsp: rspStruct,
      rspstr: base64Str,
      bcode: code,
    };
    throw err
  }
}

const ERR_WUP_REQ = { code: 30002, msg: 'wup request fail' };
const ERR_WUP_RSP = { code: 30003, msg: 'wup response fail' };

class WupPretty {
  /**
   * @typedef {Object} WupReq taf请求参数
   * @property {Object} req 请求的jce对象
   * @property {Function} rspClass 响应的jce类
   * @property {string} servant servant/ui
   * @property {string} funcName 方法名
   * @property {number} strategy 策略, 0-加载网络, 2-加载缓存
   * @property {string} reqClassName 请求的jce类名
   * @property {string} rspClassName 响应的jce类名 
   */
  /**
   * @typedef {Object} WupRsp 接口返回数据
   * @property {Object} rsp 返回数据
   * @property {number} [bcode] 返回码
   */
  /**
   * @callback EncoudReq 加密请求
   * @param {WupReq} params 请求数据
   * @returns {Objcet} 返回要发送的数据
   */
  /**
   * @callback SendWupReq 发送Wup消息请求
   * @param {Objcet} params 加密返回的参数
   * @param {Function} RspClass 响应的jce类
   * @returns {string} 返回消息加密串
   */
  /**
   * @callback DecoudRsp 解密请求
   * @param {string} rspStr 请求返回的加密串
   * @param {Function} RspClass 响应的jce类
   * @returns {WupRsp} 返回数据
   */
  /**
   * @typedef {Object} WupPrettyOptions
   * @property {EncoudReq} encoudReq 加密请求
   * @property {Promise<SendWupReq>} sendWupReq 发送Wup消息请求
   * @property {DecoudRsp} decodeRsp 解密请求
   */
  /**
   * @param {WupPrettyOptions} opt 
   */
  constructor(opt) {
    this.opt = Object.assign({}, opt || {});
  }

  /**
   * sendWup 请求
   * @param {WupReq} request 请求参数
   * @param {boolean} unEncode 不需要加密
   * @param {boolean} unDecode 不需要解密
   * @returns {WupRsp} 返回数据
   */
  async sendWup(request) {
    const { encoudReq, decodeRsp, sendWupReq } = this.opt || {};
    const { rspClass, unEncode, unDecode } = request || {};

    let params, rspData;
    try {

      try {
        params = unEncode ? { ...request } : await encoudReq(request);
      } catch (err) {
        // 加密报错
        err.message = err.message || ERR_WUP_REQ.msg;
        err.code = err.code || ERR_WUP_REQ.code;
        throw err
      }

      rspData = await sendWupReq(params, rspClass);

      // 不需要解读返回结构
      if (!unDecode && !rspClass) return {};

      try {
        if (unDecode) return rspData
        return await decodeRsp(rspData, rspClass);
      } catch (err) {
        // 解密报错
        err.message = err.message || ERR_WUP_RSP.msg;
        err.code = err.code || ERR_WUP_RSP.code;
        throw err
      }

    } catch (err) {
      const { funcName, servant, reqClassName, rspClassName, req } = request || {};
      const prefix = `sendwup|${funcName}|${servant}|${reqClassName}|${rspClassName}`;
      err.serialize = `${prefix}|${err.serialize || ''}`;
      err.request = request || {};
      err.response = err.response || rspData;
      extsdk.logger.warn(prefix, `\nrequest:`, err.request, `\nrequest.req:`, baseUtil.toStr(req));
      extsdk.logger.warn(prefix, `\nresponse:`, baseUtil.toStr(err.response));

      // 暂时不放到message中
      delete err.request;
      delete err.response;

      throw err
    }

  }
}

function wupFactory(Advance) {
  const wupPretty = new WupPretty({
    encoudReq: (cfg) => {
      const { req, servant, funcName } = cfg || {};
      const params = { ...(cfg || {}) };
      params.unitPacket = wupEncode(servant, funcName, req);
      return params
    },
    sendWupReq: async (params, RspClass) => {
      try {
        const rspstr = await Advance.sendWup(params);
        return { rspstr }
      } catch (err) {
        try {
          // 尝试解析错误信息，存在服务端提前做了解析，把错误信息吞了，还要重新再解析一下
          const { rsp, bcode } = wupDecode(err.message, RspClass, true);
          // 能解析，重写 err.message
          err.message = baseUtil.toStr({ code: bcode, ...rsp });

          // // message 能解析，则返回
          // return { rsp, bcode }
        } catch (error) {
          // 解析失败，只需求覆盖 message 和 response
          if (error?.response?.buffer !== undefined) {
            err.message = error.message;
            err.response = error.response;
            err.serialize = error.serialize;
          }
          extsdk.logger.warn('sendwup err.message decode fail', error);
        }
        throw err;
      }
    },
    decodeRsp: (rspData, RspClass) => {
      if (rspData.rsp) return rspData
      const { rsp, bcode } = wupDecode(rspData.rspstr, RspClass, true);
      return { rsp, bcode }
    }
  });

  const getWupMsgTp = (uri) => {
    return `onWupMessage_${uri}`
  };

  return {
    /**
     *  
     * 发送taf请求
     * @returns {Promise<object>} 返回请求返回的jce对象
     */
    async sendWup(cfg) {
      return await wupPretty.sendWup(cfg)
    },

    /**
     * 监听taf信令
     * @param {Object} cfg
     * @param {Object} cfg.messageClass 返回的jce对象类型
     * @param {String} cfg.uri 监听uri
     * @param {Function} cfg.callback 回调函数
     * @param {boolean} cfg.unDecode 返回数据不解密
     */
    async onWupMessage(cfg) {
      const { callback, messageClass, unDecode, ...options } = cfg;
      const { uri } = options || {};
      const tp = getWupMsgTp(uri);
      return await Advance.onWupMessage(options, params => {
        if (baseUtil.toStr(params?.uri) === baseUtil.toStr(uri)) {
          if (unDecode) {
            callback && callback({ message: params.message });
          } else {
            TafManager.decode(params.message, messageClass).then(message => {
              callback && callback({ message });
            }).catch(err => {
              extsdk.logger.error(`decode ${uri} message fail`, err);
            });
          }
        }
      }, tp);
    },

    async offWupMessage(cfg) {
      const { uri } = cfg || {};
      const tp = getWupMsgTp(uri);
      return await Advance.offWupMessage(cfg, tp);
    },

    /**
     * 监听信令长链接状态变化
     */
    async onLinkStatusChange(options) {
      const { callback, channelType } = options;
      const params = { ...options, callback: null };
      return await Advance.onLinkStatusChange(params, data => {
        if (data && baseUtil.toStr(data.channelType) === baseUtil.toStr(channelType)) {
          callback(data);
        }
      });
    },
  }
}

const ExtNative$h = NativeModules.HYExtAdvance;

function pingSignalFactory() {
  if (!ExtNative$h || !ExtNative$h.pingSignal) {
    return undefined
  }
  return async function (params) {
    const start = Date.now();
    const opt = { ...(params || {}), 'ping_start': `${start}` };
    const res = (await ExtNative$h.pingSignal(opt)) || {};
    res.timestamp = res.timestamp || {};
    res.timestamp['ping_start'] = start;
    res.timestamp['ping_end'] = Date.now();
    return res;
  }
}

const { nativeEventer: nativeEventer$h } = extsdk.core.getCommon();
const ExtNative$g = NativeModules.HYExtAdvance;
const Module = 'HYExtAdvance';
const instance$h = new nativeEventer$h('hyExtAdvanceEvent', ExtNative$g);
const wupMessage = "onWupMessage";
const onLinkStatusChange = "onLinkStatusChange";
const buyIAPProductCallback$1 = "buyIAPProductCallback";
const selectedUserChange$1 = "giftPanelSelectedUserChange";
const navCompOffsetChange$1 = "nativeCompOffsetChange";

instance$h.setIntercept({
  resReducer: (res) => {
    const { name, params } = res;
    let data = params;
    switch (name) {
      case selectedUserChange$1:
        data = parser.parse(Module, 'onGiftPanelSelectedUserChange', params);
        break
    }
    return { name, params: data }
  },
  beforeOn: (eventName, callback, options, tp) => {
    if (eventName === wupMessage) {
      if (instance$h.isAndroid()) {
        return ExtNative$g.registerUri(eventName, options);
      }
      return ExtNative$g.addEventListener(eventName, options);
    }
    return ExtNative$g.registerEvent(eventName, options);
  },
  afterOff: (eventName, callback, options, tp) => {
    // 购买事件每次都要 remove
    if (eventName === buyIAPProductCallback$1) {
      return ExtNative$g.unregisterEvent(eventName, options);
    }

    if (instance$h.isClean(eventName, tp)) {
      if (eventName === wupMessage) {
        if (instance$h.isAndroid()) {
          return ExtNative$g.unregisterUri(eventName, options);
        }
        // TODO ios 新增接口处理带参数的remove
        return ExtNative$g.removeEventListener(eventName);
      }
      return ExtNative$g.unregisterEvent(eventName, options);
    }
  }
});

const wupApi$1 = wupFactory({
  sendWup(cfg) {
    const strategy = cfg.strategy;
    cfg.req = null;
    cfg.rspClass = null;
    cfg.strategy = null;
    return ExtNative$g.sendWup(cfg, strategy || 0);
  },

  onWupMessage(options, callback, tp) {
    const { uri } = options || {};
    return instance$h.on(wupMessage, callback, uri, tp);
  },

  offWupMessage(options, tp) {
    const { uri } = options || {};
    return instance$h.off(wupMessage, null, uri, tp);
  },

  onLinkStatusChange(options, callback) {
    return instance$h.on(onLinkStatusChange, callback, options);
  },
});

var HYExtAdvance$2 = {
  ...wupApi$1,

  sendGiftToUser(params) {
    if (Platform$1.OS == 'android') {
      params.uid = params.uid.toString();
    }
    return ExtNative$g.sendGiftToUser(params);
  },

  pingSignal: pingSignalFactory(),

  onGiftPanelSelectedUserChange(params) {
    const { callback, ...options } = params || {};
    return instance$h.on(selectedUserChange$1, callback, options);
  },

  offGiftPanelSelectedUserChange() {
    return instance$h.off(selectedUserChange$1);
  },

  onNativeCompOffsetChange(params) {
    const { callback, ...options } = params || {};
    const cb = (data) => {
      const { key, ...param } = data || {};
      if (!key || (options.key === key)) {
        callback && callback(param);
      }
    };
    return instance$h.on(navCompOffsetChange$1, cb, options);
  },

  offNativeCompOffsetChange(params) {
    const { callback, ...options } = params || {};
    return instance$h.off(navCompOffsetChange$1, callback, options);
  },

  buyIAPProductWithParams: (ExtNative$g && ExtNative$g.buyIAPProductWithParams) ? (params) => {
    const { callback, ...options } = params || {};
    instance$h.once(buyIAPProductCallback$1, callback, options);
    return ExtNative$g.buyIAPProductWithParams(options)
  } : undefined,
};

const PlayerVideoEvents = ["canplay", "pause", "playing", "ended", "timeupdate", "waiting", "loadedmetadata"];
const PlayerEvents = ["videoFrameReduceStart", "videoFrameGrowEnd"];
const supportEvents$1 = [...PlayerVideoEvents, ...PlayerEvents];

const { nativeEventer: nativeEventer$g } = extsdk.core.getCommon();
const ExtNative$f = NativeModules.HYExtPlayer;
const instance$g = new nativeEventer$g('hyExtPlayerEvent', ExtNative$f);
instance$g.setIntercept({
  supportEvents: supportEvents$1,
  resReducer: res => {
    if (instance$g.isAndroid()) return res;
    const { vodStatus } = res || {};
    if (vodStatus) {
      return { name: vodStatus, params: null };
    }
    return res;
  },
  beforeOn: (eventName, callback, options) => {
    if (instance$g.isAndroid()) {
      return ExtNative$f.addVodStateObserver(eventName);
    }
    if (!instance$g.isClean(eventName)) {
      return;
    }
    if (PlayerVideoEvents.indexOf(eventName) > -1) {
      return ExtNative$f.registerVodStatus(eventName);
    }
    if (PlayerEvents.indexOf(eventName) > -1) {
      return ExtNative$f.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback) => {
    if (!instance$g.isClean(eventName)) {
      return;
    }
    if (instance$g.isAndroid()) {
      // ExtNative.removeVodStateObserver(eventName);
      return;
    }
    if (PlayerVideoEvents.indexOf(eventName) > -1) {
      return ExtNative$f.unregisterVodStatus(eventName);
    }
    if (PlayerEvents.indexOf(eventName) > -1) {
      return ExtNative$f.removeEventListener(eventName);
    }
  }
});


var HYExtPlayer$1 = {

  on(event, callback) {
    return instance$g.on(event, callback);
  },

  off(event, callback) {
    return instance$g.off(event, callback);
  }
};

const supportEvents = ["matchStatusChange", "perspectiveChange"];
const { nativeEventer: nativeEventer$f } = extsdk.core.getCommon();
const ExtNative$e = NativeModules.HYExtOb;
const instance$f = new nativeEventer$f('hyExtObEvent', ExtNative$e);
instance$f.setIntercept({
  supportEvents,
  beforeOn: (eventName, callback, options) => {
    if (instance$f.isClean(eventName)) {
      if (!instance$f.isAndroid()) {
        return ExtNative$e.addEventListener(eventName);
      }
    }
  },
  afterOff: (eventName, callback) => {
    if (instance$f.isClean(eventName)) {
      if (!instance$f.isAndroid()) {
        return ExtNative$e.removeEventListener(eventName);
      }
    }
  }
});

var HYExtOb = {
  on(event, callback) {
    return instance$f.on(event, callback);
  },

  off(event, callback) {
    return instance$f.off(event, callback);
  }
};

const ExtNative$d = NativeModules.HYExtLink;
const { nativeEventer: nativeEventer$e } = extsdk.core.getCommon();
const onAudioChange$1 = 'audioChange';
const instance$e = new nativeEventer$e('hyExtLinkEvent', ExtNative$d);
const events$5 = {
  on(eventName, callback, options) {
    instance$e.reset(eventName, callback, options);
    return ExtNative$d.addEventListener(eventName, options);
  },
  off(eventName, callback, options) {
    instance$e.off(eventName);
    return ExtNative$d.removeEventListener(eventName);
  }
};

var HYExtLink$3 = {

  updateAudioPlay(params) {
    if (Platform.OS == 'android') {
      for (let streamInfo of params) {
        if (streamInfo && streamInfo.uid) {
          streamInfo.uid = streamInfo.uid.toString();
        }
      }
    }
    return ExtNative$d.updateAudioPlay(params);
  },

  async onAudioStreamNameChange(callback) {
    return Promise.resolve({});
  },

  async offAudioStreamNameChange(callback) {
    return Promise.resolve({});
  },

  onAudioChange(params) {
    const { callback, ...rest } = params || {};
    return events$5.on(onAudioChange$1, callback, rest);
  },

  offAudioChange(params) {
    const { callback } = params || {};
    return events$5.off(onAudioChange$1, callback);
  },
};

const HYExtBackend$3 = NativeModules.HYExtBackend;
var HYExtBackend$4 = {
  async commonQuery(param) {
    const responseJson = await HYExtBackend$3.commonQuery(param);
    return JSON.parse(responseJson)
  },

  async commonOperate(params) {
    const data = { ...(params || {}) };
    data.param = JSON.stringify(data.param);
    const responseJson = await HYExtBackend$3.commonOperate(data);
    return baseUtil.toObject(responseJson, responseJson);
  }
};

const HYExtEnv$1 = NativeModules.HYExtEnv;
const HYExtAction$1 = NativeModules.HYExtAction;

var HYExtPanel$1 = {
  async disposal() {
    const extInfo = await HYExtEnv$1.getExtInfo();
    const { extType } = extInfo || {};
    return await HYExtAction$1.localControlPanelLoad({ load: false, extType });
  }
};

// 监听事件别名
const EventNames$1 = {
  onAppear: 'onAppear',
  onDisappear: 'onDisappear',
  barrageChange: 'barrageChange',
  giftChange: 'giftChange',
  onLayoutChange: 'onLayoutChange',
  shareLiveNotice: 'shareLive',
  vipEnterBannerNotice: 'vipEnter',
  openGuardianNotice: 'openGuard',
  openNobleNotice: 'openNoble',
};

const ExtNative$c = NativeModules.HYExtContext;
const { nativeEventer: nativeEventer$d } = extsdk.core.getCommon();
const instance$d = new nativeEventer$d('hyExtContextEvent', ExtNative$c);
instance$d.setIntercept({
  resReducer: data => {
    if (!instance$d.isAndroid()) return data;
    const { params } = data || {};
    const { roomId, startTime, endTime } = params || {};
    if (roomId) {
      data.params.roomId = parseInt(roomId);
    }
    if (startTime) {
      data.params.startTime = parseInt(startTime);
    }
    if (endTime) {
      data.params.endTime = parseInt(endTime);
    }
    return data;
  }
});

// 封装事件绑定
const events$4 = {
  async on(eventName, callback, options) {
    instance$d.on(eventName, callback, options);
    if (instance$d.isAndroid()) {
      await ExtNative$c.postEventFilterOption(eventName, options || null);
    } else {
      await ExtNative$c.addEventListener(eventName, options || null);
    }
  },

  async off(eventName, callback) {
    if (instance$d.isClean(eventName)) {
      return;
    }
    instance$d.off(eventName, callback);
    if (instance$d.isAndroid()) {
      await ExtNative$c.postEventFilterOption(eventName, null);
    } else if (instance$d.isClean(eventName)) {
      await ExtNative$c.removeEventListener(eventName);
    }
  },

  async reset(eventName, callback, options) {
    if (!instance$d.isClean(eventName)) {
      instance$d.off(eventName);
      if (!instance$d.isAndroid()) {
        await ExtNative$c.removeEventListener(eventName);
      }
    }
    await this.on(eventName, callback, options);
  }
};

var HYExtContext$1 = {
  async on(event, callback) {
    return await events$4.on(event, callback);
  },

  async off(event, callback) {
    return await events$4.off(event, callback);
  },

  onAppear(callback) {
    return events$4.on(EventNames$1.onAppear, callback);
  },

  onDisappear(callback) {
    return events$4.on(EventNames$1.onDisappear, callback);
  },

  onBarrageChange(options, callback) {
    return events$4.reset(EventNames$1.barrageChange, callback, options);
  },

  offBarrageChange() {
    return events$4.off(EventNames$1.barrageChange);
  },

  onGiftChange(options, callback) {
    return events$4.reset(EventNames$1.giftChange, callback, options);
  },

  offGiftChange() {
    return events$4.off(EventNames$1.giftChange);
  },

  onLayoutChange(callback) {
    return events$4.on(EventNames$1.onLayoutChange, callback);
  },

  onShareLiveNotice(params) {
    const { callback } = params || {};
    return events$4.on(EventNames$1.shareLiveNotice, callback);
  },

  offShareLiveNotice() {
    return events$4.off(EventNames$1.shareLiveNotice);
  },

  onOpenGuardianNotice(params) {
    const { callback } = params || {};
    return events$4.on(EventNames$1.openGuardianNotice, callback);
  },

  offOpenGuardianNotice() {
    return events$4.off(EventNames$1.openGuardianNotice);
  },

  onOpenNobleNotice(params) {
    const { callback } = params || {};
    return events$4.on(EventNames$1.openNobleNotice, callback);
  },

  offOpenNobleNotice() {
    return events$4.off(EventNames$1.openNobleNotice);
  },

  onVipEnterBannerNotice(params) {
    const { callback } = params || {};
    return events$4.on(EventNames$1.vipEnterBannerNotice, callback);
  },

  offVipEnterBannerNotice() {
    return events$4.off(EventNames$1.vipEnterBannerNotice);
  },

};

const HYRNSentry = NativeModules.HYRNSentry;

/**
 * 生命周期
 */
function lifeFactory(module) {
  const { extType: clientExtType } = HYRNSentry || {};
  return {
    onAppear(callback) {
      return module.onAppear((res) => {
        const { extType } = res || {};
        if (!extType || extType === clientExtType) {
          callback && callback(res);
        }
      })
    },

    onDisappear(callback) {
      return module.onDisappear((res) => {
        const { extType } = res || {};
        if (!extType || extType === clientExtType) {
          callback && callback(res);
        }
      })
    }
  }
}

const lifeAPI$1 = lifeFactory(HYExtContext$1);

/**
 * 生命周期
 */
var HYExtAppState$2 = {
  ...lifeAPI$1
};

const { nativeEventer: nativeEventer$c } = extsdk.core.getCommon();
const ExtNative$b = NativeModules.HYExtDC;
const instance$c = new nativeEventer$c('hyExtDCEvent', ExtNative$b);
instance$c.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance$c.isClean(eventName)) {
      return ExtNative$b.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback, options) => {
    if (instance$c.isClean(eventName)) {
      return ExtNative$b.removeEventListener(eventName);
    }
  }
});

const downLoadEvent$1 = 'onDownload';

var HYExtDC$2 = {
  registerListener({ callback }) {
    instance$c.on(downLoadEvent$1, callback);
  },

  unregisterListener({ callback }) {
    instance$c.off(downLoadEvent$1, callback);
  }
};

const ExtNative$a = NativeModules.HYExtStream;
const { nativeEventer: nativeEventer$b } = extsdk.core.getCommon();
const instance$b = new nativeEventer$b('hyExtStreamEvent', ExtNative$a);
const currentStreamNameChange$1 = 'onCurrentStreamNameChange';
instance$b.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance$b.isClean(eventName)) {
      return ExtNative$a.addEventListener(eventName, options || {});
    }
  },
  afterOff: (eventName, callback, options) => {
    if (instance$b.isClean(eventName)) {
      return ExtNative$a.removeEventListener(eventName, options || {});
    }
  }
});

var HYExtStream$2 = {
  onCurrentStreamNameChange(param) {
    const { callback } = param || {};
    return instance$b.on(currentStreamNameChange$1, callback);
  },

  offCurrentStreamNameChange() {
    return instance$b.off(currentStreamNameChange$1);
  },
};

var modulesExt = {
  HYExtObserver: HYExtObserver$2,
  HYExtFs: HYExtFs$1,
  HYExtAdvance: HYExtAdvance$2,
  HYExtPlayer: HYExtPlayer$1,
  HYExtOb,
  HYExtLink: HYExtLink$3,
  HYExtBackend: HYExtBackend$4,
  HYExtPanel: HYExtPanel$1,
  HYExtContext: HYExtContext$1,
  HYExtAppState: HYExtAppState$2,
  HYExtDC: HYExtDC$2,
  HYExtStream: HYExtStream$2,
};

const { nativeEventer: nativeEventer$a } = extsdk.core.getCommon();
const ExtNative$9 = NativeModules.HYExtDevelperLocalMessage;
const instance$a = new nativeEventer$a('HYExtDevelperLocalMessageMessage', ExtNative$9);
instance$a.setIntercept({
  beforeOn: (eventName, callback, options) => {
    return ExtNative$9.addEventListener(eventName);
  },
  afterOff: (eventName, callback) => {
    return ExtNative$9.removeEventListener(eventName);
  }
});

var DevelperLocalMessage = {
  onDeveloperLocalMessage: ExtNative$9 ? async (params) => {
    const { eventName, callback } = params || {};
    // 避免重复触发
    await ExtNative$9.removeEventListener(eventName);
    await instance$a.on(eventName, callback);
  } : undefined,

  offDeveloperLocalMessage: ExtNative$9 ? async (params) => {
    const { eventName } = params || {};
    await instance$a.off(eventName);
  } : undefined,

  postDevelperLocalMessage: ExtNative$9 ? async (params) => {
    return ExtNative$9.postDevelperLocalMessage(params)
  } : undefined,
};

const ExtNative$8 = NativeModules.HYExtObserver;
const { nativeEventer: nativeEventer$9 } = extsdk.core.getCommon();
const instance$9 = new nativeEventer$9('hyExtObserverEvent', ExtNative$8);
instance$9.setIntercept({
  resReducer: res => {
    if (instance$9.isAndroid()) return res;
    const { event, content } = res || {};
    return { name: event, params: content };
  },
});

var HYExtObserver$1 = {
  on(event, callback) {
    return instance$9.on(event, callback);
  },

  off(event, callback) {
    return instance$9.off(event, callback);
  },

  async onLocalMessage({ eventName, callback }) {
    instance$9.reset(eventName, callback);
    await ExtNative$8.onLocalMessage(eventName);
  },

  async offLocalMessage({ eventName }) {
    instance$9.off(eventName);
    await ExtNative$8.offLocalMessage(eventName);
  },

  async postLocalMessage({ eventName, message }) {
    return await ExtNative$8.postLocalMessage(eventName, message);
  },

  ...DevelperLocalMessage
};

const { nativeEventer: nativeEventer$8 } = extsdk.core.getCommon();
const ExtNative$7 = NativeModules.HYExtAdvance;
const instance$8 = new nativeEventer$8('hyExtAdvanceEvent', ExtNative$7);
const buyIAPProductCallback = "buyIAPProductCallback";
const selectedUserChange = "giftPanelSelectedUserChange";
const navCompOffsetChange = "nativeCompOffsetChange";
const wupMessag = "onWupMessage";

instance$8.setIntercept({
  beforeOn: (eventName, callback, options) => {
    return ExtNative$7.addEventListener(eventName, options);
  },
  afterOff: (eventName, callback, options, tp) => {
    if (eventName === buyIAPProductCallback) {
      return ExtNative$7.removeEventListener(eventName, options);
    }
    if (instance$8.isClean(eventName, tp)) {
      return ExtNative$7.removeEventListener(eventName, options);
    }
  }
});

const wupApi = wupFactory({
  sendWup(cfg) {
    return ExtNative$7.sendWup(cfg);
  },

  onWupMessage(options, callback, tp) {
    return instance$8.on(wupMessag, callback, options, tp);
  },

  offWupMessage(options, tp) {
    return instance$8.off(wupMessag, null, options, tp);
  },

  onLinkStatusChange(options, callback) {
    return instance$8.on("onLinkStatusChange", callback, options);
  },
});

var HYExtAdvance$1 = {
  ...wupApi,

  showLogin() {
    return ExtNative$7.showLogin(); // 助手端不接参数，需要单独调用
  },

  pingSignal: pingSignalFactory(),

  onGiftPanelSelectedUserChange(params) {
    const { callback, ...options } = params || {};
    return instance$8.on(selectedUserChange, callback, options);
  },

  offGiftPanelSelectedUserChange() {
    return instance$8.off(selectedUserChange);
  },

  onNativeCompOffsetChange(params) {
    const { callback, ...options } = params || {};
    const cb = (data) => {
      const { key, ...param } = data || {};
      if (!key || (options.key === key)) {
        callback && callback(param);
      }
    };
    return instance$8.on(navCompOffsetChange, cb, options);
  },

  offNativeCompOffsetChange(params) {
    const { callback, ...options } = params || {};
    return instance$8.off(navCompOffsetChange, callback, options);
  },

  buyIAPProductWithParams: (ExtNative$7 && ExtNative$7.buyIAPProductWithParams) ? (params) => {
    const { callback, ...options } = params || {};
    instance$8.once(buyIAPProductCallback, callback, options);
    return ExtNative$7.buyIAPProductWithParams(options);
  } : undefined,
};

const ExtNative$6 = NativeModules.HYExtStream;
const { nativeEventer: nativeEventer$7 } = extsdk.core.getCommon();
const instance$7 = new nativeEventer$7('hyExtStreamEvent', ExtNative$6);
const wbLayoutChange = 'WBLayoutChange';
const streamEvents = [wbLayoutChange];
const currentStreamNameChange = 'onCurrentStreamNameChange';

instance$7.setIntercept({
  beforeOn: (eventName, callback, options) => {
    // 非 streamEvents
    if (streamEvents.indexOf(eventName) < 0 && instance$7.isClean(eventName)) {
      return ExtNative$6.addEventListener(eventName, options || {});
    }
  },
  afterOff: (eventName, callback, options) => {
    // 非 streamEvents
    if (streamEvents.indexOf(eventName) < 0 && instance$7.isClean(eventName)) {
      return ExtNative$6.removeEventListener(eventName, options || {});
    }
  }
});

const events$3 = {
  on(eventName, callback, options) {
    instance$7.reset(eventName, callback, options);
    return ExtNative$6.addStreamEvent(eventName, options);
  },
  off(eventName, callback, options) {
    instance$7.off(eventName);
    return ExtNative$6.removeStreamEvent(eventName);
  }
};

var HYExtStream$1 = {
  onWBLayoutChange(param) {
    const { callback, wbId, wbName } = param;
    const options = { wbId, wbName };
    return events$3.on(wbLayoutChange, callback, options);
  },

  offWBLayoutChange(callback) {
    return events$3.off(wbLayoutChange, callback);
  },

  onCurrentStreamNameChange(param) {
    const { callback } = param || {};
    return instance$7.on(currentStreamNameChange, callback);
  },

  offCurrentStreamNameChange() {
    return instance$7.off(currentStreamNameChange);
  },
};

const { nativeEventer: nativeEventer$6 } = extsdk.core.getCommon();
const HYExtLink$1 = NativeModules.HYExtLink;
const instance$6 = new nativeEventer$6('hyExtLinkEvent', HYExtLink$1);
const onAudioStreamNameChange = 'onAudioStreamNameChange';
const onInviteNotice = 'onInviteNotice';
const onAudioChange = 'audioChange';
const events$2 = {
  on(eventName, callback, options) {
    instance$6.reset(eventName, callback, options);
    return HYExtLink$1.addLinkEvent(eventName, options);
  },
  off(eventName, callback, options) {
    instance$6.off(eventName);
    return HYExtLink$1.removeLinkEvent(eventName);
  }
};

var HYExtLink$2 = {
  onAudioStreamNameChange(param) {
    const { callback } = param || {};
    return events$2.on(onAudioStreamNameChange, callback);
  },

  offAudioStreamNameChange() {
    return events$2.off(onAudioStreamNameChange);
  },

  onInviteNotice(param) {
    const { callback } = param || {};
    return events$2.on(onInviteNotice, callback);
  },

  offInviteNotice() {
    return events$2.off(onInviteNotice);
  },

  onAudioChange(params) {
    const { callback, ...rest } = params || {};
    return events$2.on(onAudioChange, callback, rest);
  },

  offAudioChange() {
    return events$2.off(onAudioChange);
  }
};

const ExtNative$5 = NativeModules.HYExtReg;
const { nativeEventer: nativeEventer$5 } = extsdk.core.getCommon();
const instance$5 = new nativeEventer$5('hyExtRegEvent', ExtNative$5);
const events$1 = {
  on(eventName, callback, options) {
    instance$5.reset(eventName, callback, options);
    return ExtNative$5.addRegEvent(eventName, options);
  },
  off(eventName, callback, options) {
    instance$5.off(eventName);
    return ExtNative$5.removeRegEvent(eventName);
  }
};
const facialLandmark = "facialLandmark";
const humanSkeleton = "humanSkeleton";
const speechRecognition = "speechRecognition";
const gestureRecognition = "gestureRecognition";

var HYExtReg$1 = {
  onFacialLandmarkDetection(params) {
    const { callback } = params || {};
    return events$1.on(facialLandmark, callback);
  },

  offFacialLandmarkDetection() {
    return events$1.off(facialLandmark);
  },

  onHumanSkeletonDetection(params) {
    const { callback } = params || {};
    return events$1.on(humanSkeleton, callback);
  },

  offHumanSkeletonDetection() {
    return events$1.off(humanSkeleton);
  },

  onSpeechRecognition(params) {
    const { hostwords, callback } = params || {};
    return events$1.on(speechRecognition, callback, hostwords);
  },

  offSpeechRecognition() {
    return events$1.off(speechRecognition);
  },

  onGestureRecognition(params) {
    const { callback } = params || {};
    return events$1.on(gestureRecognition, callback);
  },

  offGestureRecognition() {
    return events$1.off(gestureRecognition);
  },
};

const HYExtBackend$1 = NativeModules.HYExtBackend;
var HYExtBackend$2 = {
  async commonQuery(param) {
    const responseJson = await HYExtBackend$1.commonQuery(param);
    return JSON.parse(responseJson);
  },

  async commonOperate(params) {
    const responseJson = await HYExtBackend$1.commonOperate(params);
    return baseUtil.toObject(responseJson, responseJson);
  }
};

// 监听事件别名
const EventNames = {
  onAppear: 'onAppear',
  onDisappear: 'onDisappear',
  barrageChange: 'barrageChange',
  giftChange: 'giftChange',
  onLayoutChange: 'onLayoutChange',
  shareLiveNotice: 'shareLiveNotice',
  vipEnterBannerNotice: 'vipEnterBannerNotice',
  openGuardianNotice: 'openGuardianNotice',
  subscriberChange: 'subscriberChange',
  openNobleNotice: 'openNobleNotice'
};

const ExtNative$4 = NativeModules.HYExtContext;
const { nativeEventer: nativeEventer$4 } = extsdk.core.getCommon();
const instance$4 = new nativeEventer$4('hyExtContextEvent', ExtNative$4);

// 封装事件绑定
const events = {
  async on(eventName, callback, options) {
    if (!instance$4.isClean(eventName)) {
      instance$4.off(eventName);
      if (!instance$4.isAndroid()) {
        await ExtNative$4.removeEventListener(eventName);
      }
    }
    instance$4.on(eventName, callback, options);
    if (instance$4.isAndroid()) {
      await ExtNative$4.postEventFilterOption(eventName, options || null);
    } else {
      await ExtNative$4.addEventListener(eventName, options || null);
    }
  },

  async off(eventName, callback) {
    if (instance$4.isClean(eventName)) {
      return;
    }
    instance$4.off(eventName, callback);
    if (instance$4.isAndroid()) {
      await ExtNative$4.removeEventFilterOption(eventName);
    } else {
      await ExtNative$4.removeEventListener(eventName);
    }
  }
};

var HYExtContext = {
  async on(event, callback) {
    return await events.on(event, callback);
  },

  async off(event, callback) {
    return await events.off(event, callback);
  },

  onAppear(callback) {
    return events.on(EventNames.onAppear, callback);
  },

  onDisappear(callback) {
    return events.on(EventNames.onDisappear, callback);
  },

  onBarrageChange(options, callback) {
    return events.on(EventNames.barrageChange, callback, options);
  },

  offBarrageChange() {
    return events.off(EventNames.barrageChange);
  },

  onGiftChange(options, callback) {
    return events.on(EventNames.giftChange, callback, options);
  },

  offGiftChange() {
    return events.off(EventNames.giftChange);
  },

  onSubscriberChange(options, callback) {
    return events.on(EventNames.subscriberChange, callback, options);
  },

  offSubscriberChange() {
    return events.off(EventNames.subscriberChange);
  },

  onLayoutChange(callback) {
    return events.on(EventNames.onLayoutChange, callback);
  },

  onShareLiveNotice(params) {
    const { callback } = params || {};
    return events.on(EventNames.shareLiveNotice, callback);
  },

  offShareLiveNotice() {
    return events.off(EventNames.shareLiveNotice);
  },

  onOpenGuardianNotice(params) {
    const { callback } = params || {};
    return events.on(EventNames.openGuardianNotice, callback);
  },

  offOpenGuardianNotice() {
    return events.off(EventNames.openGuardianNotice);
  },

  onOpenNobleNotice(params) {
    const { callback } = params || {};
    return events.on(EventNames.openNobleNotice, callback);
  },

  offOpenNobleNotice() {
    return events.off(EventNames.openNobleNotice);
  },

  onVipEnterBannerNotice(params) {
    const { callback } = params || {};
    return events.on(EventNames.vipEnterBannerNotice, callback);
  },

  offVipEnterBannerNotice() {
    return events.off(EventNames.vipEnterBannerNotice);
  },
};

const lifeAPI = lifeFactory(HYExtContext);

/**
 * 生命周期
 */
var HYExtAppState$1 = {
  ...lifeAPI
};

const ExtNative$3 = NativeModules.HYExtGame;
const { nativeEventer: nativeEventer$3 } = extsdk.core.getCommon();
const instance$3 = new nativeEventer$3('hyExtGameEvent', ExtNative$3);

var HYExtGame$1 = {
  onCommand: (opt) => {
    const { callback } = opt || {};
    return instance$3.on('onCommand', callback)
  },
  on: (opt) => {
    const { eventName, callback } = opt || {};
    return instance$3.on(eventName, callback);
  },
  off: (opt) => {
    const { eventName, callback } = opt || {};
    return instance$3.off(eventName, callback);
  },
  stop(params) {
    // rn 暂不支持带参数的 stop
    return ExtNative$3.stop();
  }
};

const { nativeEventer: nativeEventer$2 } = extsdk.core.getCommon();
const ExtNative$2 = NativeModules.HYExtInteract;
const instance$2 = new nativeEventer$2('HYExtInteractMessage', ExtNative$2);
instance$2.setIntercept({
  beforeOn: (eventName, callback, options) => {
    return ExtNative$2.addEventListener(eventName);
  },
  afterOff: (eventName, callback) => {
    if (instance$2.isClean(eventName)) {
      return ExtNative$2.removeEventListener(eventName);
    }
  }
});

var HYExtInteract$1 = {
  on(params) {
    const { eventName, callback } = params || {};
    return instance$2.on(eventName, callback);
  },

  off(params) {
    const { eventName, callback } = params || {};
    return instance$2.off(eventName, callback);
  },
};

const { nativeEventer: nativeEventer$1 } = extsdk.core.getCommon();
const ExtNative$1 = NativeModules.HYExtDC;
const instance$1 = new nativeEventer$1('hyExtDCEvent', ExtNative$1);
instance$1.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance$1.isClean(eventName)) {
      return ExtNative$1.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback, options) => {
    if (instance$1.isClean(eventName)) {
      return ExtNative$1.removeEventListener(eventName);
    }
  }
});

const downLoadEvent = 'onDownload';

var HYExtDC$1 = {
  registerListener({ callback }) {
    instance$1.on(downLoadEvent, callback);
  },

  unregisterListener({ callback }) {
    instance$1.off(downLoadEvent, callback);
  }
};

const ExtNative = NativeModules.HYExtLeaf;
const { nativeEventer } = extsdk.core.getCommon();
const instance = new nativeEventer('hyExtLeafEvent', ExtNative);
instance.setIntercept({
  beforeOn: (eventName, callback, options) => {
    if (instance.isClean(eventName)) {
      return ExtNative.addEventListener(eventName);
    }
  },
  afterOff: (eventName, callback, options) => {
    if (instance.isClean(eventName)) {
      return ExtNative.removeEventListener(eventName);
    }
  }
});

var HYExtLeaf$1 = {
  on: (params) => {
    const { eventName, callback } = params || {};
    return instance.on(eventName, callback);
  },

  off: (params) => {
    const { eventName } = params || {};
    return instance.off(eventName);
  }
};

var modulesLive = {
  HYExtObserver: HYExtObserver$1,
  HYExtAdvance: HYExtAdvance$1,
  HYExtStream: HYExtStream$1,
  HYExtLink: HYExtLink$2,
  HYExtReg: HYExtReg$1,
  HYExtBackend: HYExtBackend$2,
  HYExtContext,
  HYExtAppState: HYExtAppState$1,
  HYExtGame: HYExtGame$1,
  HYExtInteract: HYExtInteract$1,
  HYExtDC: HYExtDC$1,
  HYExtLeaf: HYExtLeaf$1,
};

if (process.env.HYEXT_BUILD_ENV !== "dev") {
  try {
    // 重写 console.error
    console.error = (...params) => sysLogger.error(...params);
  } catch (err) {
    console.warn('cover console error fail:', err);
  }
}

function bailout(taskList, onBailout) {
  return function bailoutRunner(...args) {
    let result;
    for (let i = 0; i < taskList.length; i++) {
      const task = taskList[i];
      result = task.apply(null, args);
      if (onBailout(result)) return result // 提前结束
    }
    return result // 正常结束
  }
}

const ValidateStatus = {
  Pass: 1,
  Fail: -1,
  UserPass: 2
};

function isObject(v) {
  return typeof v === 'object' && v !== null && !Array.isArray(v)
}

function isArray(v) {
  return Array.isArray(v)
}

function isEmpty(v) {
  return v === '' || v === null || v === undefined
}

function createValidateFnByAst(ast) {
  // Taking AST be a reference for validation regular.
  return function validateByAst(args) {
    const stack = [];
    const blockStack = []; // 为了遍历MutiType节点的时候stack不继续收集node所用

    function traverse(node, value) {
      const nodeType = node.type.toLowerCase();
    
      !blockStack.length && stack.push({ node, value });

      // 节点不是可选 或 可选值不为空的 才进行 type check
      if (!node.optional || (node.optional && !isEmpty(value))) {
        const isMutiType = nodeType === '__polytype__' || nodeType === 'enum';

        if (!isMutiType && !typeCheck(nodeType, value)) {
          return false
        }

        if (isMutiType) {
          // 一对多的关系，value只要匹配ast节点的任意一条分支，就当是验证通过。
          if (node.properties) {
            blockStack.push(node);

            let matched = false;
            for (let i = 0; i < node.properties.length; i++) {
              const child = node.properties[i];
              const result = traverse(child, value);
              if (result === true) {
                matched = true;
                break
              }
            }

            blockStack.pop();

            if (!matched) { return false }
          }
        } else if (nodeType === 'array' || nodeType === 'object') {
          if (node.properties) {
            for (let i = 0; i < node.properties.length; i++) {
              const child = node.properties[i];
              const key = nodeType === 'object' ? child.name : (child.index = i);
              const result = traverse(child, value[key]);
              if (result === false) return false
            }
          }
        }
      }

      !blockStack.length && stack.pop();

      return true
    }

    const pass = traverse(ast, args);
    return {
      pass: pass ? ValidateStatus.Pass : ValidateStatus.Fail,
      msg: pass ? '通过' : tracingStackError(stack)
    }
  }
}

function tracingStackError(stack) {
  const lastStackItem = stack[stack.length - 1];
  return (
    `InvalidParameterType: Expected ` +
    generateVisitPath(stack.map(item => item.node)) +
    ` to be a ${formatNodeType(lastStackItem.node)}` +
    ` instead of ${toRealType(lastStackItem.value, true)}`
  )
}

function formatNodeType(node) {
  const type = node.type.toLowerCase();

  const makeTypeGroup = (enumNode) => {
    let typeGroup = '';
    if (enumNode.properties) {
      const maxIndex = enumNode.properties.length;
      const startIndex = 0;
      typeGroup = enumNode.properties.reduce((acc, node, i) => {
        acc += (i !== startIndex && i !== maxIndex ? '|' : '') + node.name;
        return acc
      }, typeGroup);
    }
    return typeGroup
  };

  switch(type) {
    case '__polytype__':
      return node.rawType
    case 'enum':
      return makeTypeGroup(node)
    default:
      return type
  }
}

function generateVisitPath(stack) {
  let str = '';
  let lastNodeType = '';

  for (let i = 0; i < stack.length; i++) {
    const item = stack[i];
    const type = item.type.toLowerCase();

    if (type === 'array') {
      if (lastNodeType === 'object') {
        str += `.${item.name}[$index]`;
      } else if (lastNodeType === 'array') {
        str = str.replace('$index', item.index);
        str += '[$index]';
      } else {
        if (stack.length === 0) {
          str += item.name;
        } else {
          str += `${item.name}[$index]`;
        }
      }
    } else if (type === 'object') {
      if (lastNodeType === 'object') {
        str += `.${item.name}`;
      } else if (lastNodeType === 'array') {
        str = str.replace('$index', item.index);
      } else {
        str += item.name;
      }
    } else {
      if (lastNodeType === 'array') {
        str = str.replace('$index', item.index);
      } else if (lastNodeType === 'object') {
        str += `.${item.name}`;
      } else {
        str += item.name;
      }
    }

    lastNodeType = type;
  }

  return str
}

function typeCheck(nodeType, value) {
  if (nodeType === '*' || nodeType === 'any') return true

  if (nodeType === 'object' && isObject(value)) {
    return true
  } else if (nodeType === 'array' && isArray(value)) {
    return true
  } else if (
    nodeType !== 'object' &&
    nodeType !== 'array' &&
    !isObject(value) &&
    !isArray(value)
  ) {
    if (nodeType === 'void') {
      nodeType = 'undefined';
    }
    return judge(nodeType, value)
  } else {
    return false
  }
}

function toRealType(v, shouldStringify) {
  if (v === null) return 'null'
  if (typeof v === 'number' && isNaN(v)) return 'NaN'
  if (shouldStringify && typeof v === 'object') return JSON.stringify(v)
  return typeof v
}

function judge(nodeType, value) {
  // 先对特殊值执行判断
  const valueType = toRealType(value);

  if (nodeType === 'null' && valueType !== 'null') return false
  if (nodeType === 'object' && valueType === 'null') return false
  if (nodeType === 'number' && valueType === 'NaN') return false

  return nodeType === valueType
}

var validationConfig = {
  "ar.getEffectList": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "sceneName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAR",
    apiName: "getEffectList",
    level: 0,
  },
  "ar.loadUnity": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "sceneName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAR",
    apiName: "loadUnity",
    level: 0,
  },
  "ar.switchArEffect": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "resourceType", type: "number" },
            { name: "resourceId", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAR",
    apiName: "switchArEffect",
    level: 0,
  },
  "ar.getDanceEffectList": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "sceneName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAR",
    apiName: "getDanceEffectList",
    level: 0,
  },
  "ar.switchDanceEffect": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "danceId", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAR",
    apiName: "switchDanceEffect",
    level: 0,
  },
  "action.localControlEntrance": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "extType", type: "string" },
            { name: "visible", type: "boolean" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAction",
    apiName: "localControlEntrance",
    level: 0,
  },
  "action.localControlPanelLoad": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "extType", type: "string" },
            { name: "load", type: "boolean" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAction",
    apiName: "localControlPanelLoad",
    level: 0,
  },
  "action.localControlPanelVisible": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "extType", type: "string" },
            { name: "visible", type: "boolean" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAction",
    apiName: "localControlPanelVisible",
    level: 0,
  },
  "action.showEntrance": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "extTypes", type: "string" },
            { name: "countDown", type: "number", optional: true },
            { name: "cornerMarkId", type: "string", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAction",
    apiName: "showEntrance",
    level: 0,
  },
  "action.hideEntrance": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "extTypes", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAction",
    apiName: "hideEntrance",
    level: 0,
  },
  "advance.showLogin": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [{ name: "type", type: "number" }],
          type: "Object",
          optional: true,
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "showLogin",
    level: 0,
  },
  "advance.addActionEventWithExtraInfo": {
    ast: {
      name: "args",
      properties: [
        { name: "prod", type: "string" },
        { name: "eid", type: "string" },
        { name: "label", type: "string", optional: true },
        {
          name: "extraInfo",
          properties: [{ name: "prop", type: "Object" }],
          type: "Object",
          optional: true,
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "addActionEventWithExtraInfo",
    level: 0,
  },
  "advance.openUrl": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [{ name: "url", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "openUrl",
    level: 0,
  },
  "advance.sendWup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "req", type: "Object" },
            {
              name: "rspClass",
              properties: [
                { name: "function", type: "function" },
                { name: "Object", type: "Object" },
              ],
              type: "__polytype__",
              rawType: "function|Object",
            },
            { name: "servant", type: "string" },
            { name: "funcName", type: "string" },
            { name: "strategy", type: "number", optional: true },
            { name: "reqClassName", type: "string", optional: true },
            { name: "rspClassName", type: "string", optional: true },
            { name: "channel", type: "number", optional: true },
            { name: "retryCount", type: "number", optional: true },
            { name: "totalTimeout", type: "number", optional: true },
            { name: "unitPacket", type: "any", optional: true },
            { name: "useDirectStrategy", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "sendWup",
    level: 1,
  },
  "advance.onWupMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "messageClass",
              properties: [
                { name: "Object", type: "Object" },
                { name: "function", type: "function" },
              ],
              type: "__polytype__",
              rawType: "Object|function",
            },
            { name: "uri", type: "string" },
            { name: "useDirectStrategy", type: "boolean", optional: true },
            {
              name: "callback",
              properties: [
                {
                  name: "wupMessage",
                  properties: [{ name: "message", type: "Object" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "onWupMessage",
    level: 0,
  },
  "advance.onLinkStatusChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "channelType", type: "number" },
            {
              name: "callback",
              properties: [
                {
                  name: "linkStatusResp",
                  properties: [{ name: "connected", type: "boolean" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
            { name: "useDirectStrategy", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "onLinkStatusChange",
    level: 1,
  },
  "advance.registerGroup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "group", type: "string", optional: true },
            {
              name: "groupIds",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
              optional: true,
            },
            { name: "channelType", type: "number", optional: true },
            { name: "useDirectStrategy", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "registerGroup",
    level: 0,
  },
  "advance.unRegisterGroup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "groupIds",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
              optional: true,
            },
            { name: "channelType", type: "number", optional: true },
            { name: "useDirectStrategy", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "unRegisterGroup",
    level: 0,
  },
  "advance.sendGift": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "giftId", type: "number" },
            { name: "giftCount", type: "number" },
            { name: "useSelectMic", type: "boolean", optional: true },
            { name: "sourceType", type: "string", optional: true },
            { name: "mapParam", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "sendGift",
    level: 0,
  },
  "advance.sendGiftToUser": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "giftId", type: "number" },
            { name: "giftCount", type: "number" },
            { name: "uid", type: "number" },
            { name: "sourceType", type: "string", optional: true },
            { name: "mapParam", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "sendGiftToUser",
    level: 0,
  },
  "advance.getLocalItem": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "key", type: "string" },
            { name: "bindUid", type: "boolean" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "getLocalItem",
    level: 0,
  },
  "advance.setLocalItem": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "key", type: "string" },
            { name: "value", type: "string" },
            { name: "bindUid", type: "boolean" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "setLocalItem",
    level: 0,
  },
  "advance.addEffect": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "fileName", type: "string" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "addEffect",
    level: 0,
  },
  "advance.pingSignal": {
    ast: {
      name: "args",
      properties: [{ name: "params", type: "Object", optional: true }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "pingSignal",
    level: 0,
  },
  "advance.getLinkStatus": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "useDirectStrategy", type: "boolean" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "getLinkStatus",
    level: 0,
  },
  "advance.buyIAPProductWithParams": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "buyWay", type: "string" },
            { name: "name", type: "string" },
            { name: "price", type: "string" },
            { name: "product_id", type: "string" },
            { name: "appId", type: "string" },
            {
              name: "callback",
              properties: [
                {
                  name: "res",
                  properties: [{ name: "payresult", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "buyIAPProductWithParams",
    level: 0,
  },
  "advance.setGiftPanelSelectedUser": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "uid", type: "number", optional: true },
            { name: "all", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "setGiftPanelSelectedUser",
    level: 0,
  },
  "advance.onGiftPanelSelectedUserChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  properties: [
                    { name: "all", type: "boolean", optional: true },
                    {
                      name: "user",
                      properties: [
                        { name: "uid", type: "number" },
                        { name: "avatarUrl", type: "string" },
                        { name: "nick", type: "string" },
                      ],
                      type: "Object",
                      optional: true,
                    },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "onGiftPanelSelectedUserChange",
    level: 0,
  },
  "advance.getNativeCompOffset": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "key", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "getNativeCompOffset",
    level: 0,
  },
  "advance.onNativeCompOffsetChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "key", type: "string" },
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  properties: [
                    {
                      name: "list",
                      type: "Array",
                      properties: [
                        {
                          name: "NavCompLayoutInfo",
                          properties: [
                            { name: "top", type: "number" },
                            { name: "left", type: "number" },
                            { name: "width", type: "number" },
                            { name: "height", type: "number" },
                            { name: "props", type: "any" },
                          ],
                          type: "Object",
                        },
                      ],
                    },
                    { name: "key", type: "string" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "onNativeCompOffsetChange",
    level: 0,
  },
  "advance.offNativeCompOffsetChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "key", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "offNativeCompOffsetChange",
    level: 0,
  },
  "advance.addGidToOftenUsed": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "gid", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "addGidToOftenUsed",
    level: 0,
  },
  "advance.offWupMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "uri", type: "string" },
            { name: "useDirectStrategy", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAdvance",
    apiName: "offWupMessage",
    level: 0,
  },
  onLoad: {
    ast: {
      name: "args",
      properties: [{ name: "callback", type: "function" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAppState",
    apiName: "onLoad",
    level: 0,
  },
  onUnload: {
    ast: {
      name: "args",
      properties: [{ name: "callback", type: "function" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAppState",
    apiName: "onUnload",
    level: 0,
  },
  onEnterForeground: {
    ast: {
      name: "args",
      properties: [{ name: "callback", type: "function" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAppState",
    apiName: "onEnterForeground",
    level: 0,
  },
  onLeaveForeground: {
    ast: {
      name: "args",
      properties: [{ name: "callback", type: "function" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAppState",
    apiName: "onLeaveForeground",
    level: 0,
  },
  onAppear: {
    ast: {
      name: "args",
      properties: [{ name: "callback", type: "function" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAppState",
    apiName: "onAppear",
    level: 0,
  },
  onDisappear: {
    ast: {
      name: "args",
      properties: [{ name: "callback", type: "function" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtAppState",
    apiName: "onDisappear",
    level: 0,
  },
  "backend.commonQuery": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "key", type: "string" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtBackend",
    apiName: "commonQuery",
    level: 0,
  },
  "backend.commonOperate": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "key", type: "string" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtBackend",
    apiName: "commonOperate",
    level: 0,
  },
  "context.on": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        {
          name: "callback",
          properties: [{ name: "content", type: "any" }],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "on",
    level: 0,
  },
  "context.off": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        {
          name: "callback",
          properties: [{ name: "content", type: "any" }],
          type: "function",
          optional: true,
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "off",
    level: 0,
  },
  "context.showToast": {
    ast: {
      name: "args",
      properties: [{ name: "message", type: "string" }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "showToast",
    level: 0,
  },
  "context.onLayoutChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "callback",
          properties: [
            {
              name: "info",
              properties: [
                { name: "screenWidth", type: "number" },
                { name: "screenHeight", type: "number" },
                { name: "isLandscape", type: "boolean" },
              ],
              type: "Object",
            },
          ],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onLayoutChange",
    level: 0,
  },
  "context.sendGift": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "giftId", type: "number" },
            { name: "giftCount", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "sendGift",
    level: 0,
  },
  "context.onGiftChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "options",
          properties: [
            { name: "sendNick", type: "string", optional: true },
            { name: "itemName", type: "string", optional: true },
            { name: "minSendItemCount", type: "number", optional: true },
            { name: "minSendItemComboHits", type: "number", optional: true },
          ],
          type: "Object",
        },
        {
          name: "callback",
          properties: [
            {
              name: "giftInfo",
              properties: [
                { name: "sendNick", type: "string" },
                { name: "senderAvatarUrl", type: "string" },
                { name: "itemId", type: "number" },
                { name: "itemName", type: "string" },
                { name: "sendItemCount", type: "number" },
                { name: "sendItemComboHits", type: "number" },
                { name: "roomId", type: "number" },
                { name: "unionId", type: "string" },
                { name: "customText", type: "string" },
                { name: "nobleLevel", type: "number" },
                { name: "totalPay", type: "number" },
                { name: "nobleAttrType", type: "number" },
              ],
              type: "Object",
            },
          ],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onGiftChange",
    level: 0,
  },
  "context.onBarrageChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "options",
          properties: [
            { name: "sendNick", type: "string", optional: true },
            { name: "nobleLevel", type: "number", optional: true },
            { name: "fansLevel", type: "number", optional: true },
            { name: "content", type: "string", optional: true },
          ],
          type: "Object",
        },
        {
          name: "callback",
          properties: [
            {
              name: "barrageInfo",
              properties: [
                { name: "sendNick", type: "string" },
                { name: "senderAvatarUrl", type: "string" },
                { name: "senderGender", type: "number" },
                { name: "nobleLevel", type: "number" },
                { name: "fansLevel", type: "number" },
                { name: "content", type: "string" },
                { name: "unionId", type: "string" },
                { name: "badgeName", type: "string" },
              ],
              type: "Object",
            },
          ],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onBarrageChange",
    level: 0,
  },
  "context.onOpenGuardianNotice": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "notice",
                  properties: [
                    { name: "openDays", type: "number" },
                    { name: "lastGuardianLevel", type: "number" },
                    { name: "openGuardianLevel", type: "number" },
                    { name: "presenterNick", type: "string" },
                    { name: "roomId", type: "number" },
                    { name: "unionId", type: "string" },
                    { name: "userAvatarUrl", type: "string" },
                    { name: "userNick", type: "string" },
                    { name: "guardType", type: "number" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onOpenGuardianNotice",
    level: 0,
  },
  "context.onOpenNobleNotice": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "notice",
                  properties: [
                    { name: "startTime", type: "number" },
                    { name: "endTime", type: "number" },
                    { name: "openFlag", type: "number" },
                    { name: "months", type: "number" },
                    { name: "nobleLevel", type: "number" },
                    { name: "nobleAttrType", type: "number" },
                    { name: "nobleName", type: "string" },
                    { name: "roomId", type: "number" },
                    { name: "unionId", type: "string" },
                    { name: "userAvatarUrl", type: "string" },
                    { name: "userNick", type: "string" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onOpenNobleNotice",
    level: 0,
  },
  "context.onVipEnterBannerNotice": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "notice",
                  properties: [
                    { name: "badgeName", type: "string" },
                    { name: "fansLevel", type: "number" },
                    { name: "nobleLevel", type: "number" },
                    { name: "nobleAttrType", type: "number" },
                    { name: "nobleName", type: "string" },
                    { name: "unionId", type: "string" },
                    { name: "roomId", type: "number" },
                    { name: "userAvatarUrl", type: "string" },
                    { name: "userNick", type: "string" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onVipEnterBannerNotice",
    level: 0,
  },
  "context.onShareLiveNotice": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "notice",
                  properties: [
                    { name: "actionUrl", type: "string" },
                    { name: "content", type: "string" },
                    { name: "imageUrl", type: "string" },
                    { name: "presenterUnionId", type: "string" },
                    { name: "roomId", type: "number" },
                    { name: "shareType", type: "number" },
                    { name: "sharerNick", type: "string" },
                    { name: "sharerUnionId", type: "string" },
                    { name: "subtitle", type: "string" },
                    { name: "title", type: "string" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onShareLiveNotice",
    level: 0,
  },
  "context.setSendBarrageTag": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [{ name: "tag", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "setSendBarrageTag",
    level: 0,
  },
  "context.setDisplayBarrageTags": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "tags",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "setDisplayBarrageTags",
    level: 0,
  },
  "context.share": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "platform", type: "string" },
            { name: "title", type: "string" },
            { name: "content", type: "string" },
            { name: "shareUrl", type: "string" },
            { name: "imageUrl", type: "string" },
            { name: "imageData", type: "string", optional: true },
            { name: "miniprogramUrl", type: "string", optional: true },
            { name: "mediaType", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "share",
    level: 0,
  },
  "context.onSubscriberChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "options",
          properties: [{ name: "userNick", type: "string" }],
          type: "Object",
        },
        {
          name: "callback",
          properties: [
            {
              name: "subscriberInfo",
              properties: [
                {
                  name: "subscriberList",
                  type: "Array",
                  properties: [
                    {
                      name: "SubscriberInfo",
                      properties: [{ name: "userNick", type: "string" }],
                      type: "Object",
                    },
                  ],
                },
              ],
              type: "Object",
            },
          ],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "onSubscriberChange",
    level: 0,
  },
  "context.getLiveRoomFeatures": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [{ name: "FeatureKey", type: "string" }],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "getLiveRoomFeatures",
    level: 0,
  },
  "context.setLiveRoomFeatures": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "barrage",
              properties: [{ name: "enable", type: "boolean" }],
              type: "Object",
              optional: true,
            },
            {
              name: "effect",
              properties: [
                { name: "giftEffectEnable", type: "boolean" },
                { name: "nobleEffectEnable", type: "boolean" },
              ],
              type: "Object",
              optional: true,
            },
            {
              name: "player",
              properties: [
                { name: "status", type: "string" },
                { name: "displayMode", type: "string" },
              ],
              type: "Object",
              optional: true,
            },
            {
              name: "ui",
              properties: [{ name: "activated", type: "boolean" }],
              type: "Object",
              optional: true,
            },
            {
              name: "stream",
              properties: [
                { name: "videoStreamStatus", type: "string" },
                { name: "audioStreamStatus", type: "string" },
              ],
              type: "Object",
              optional: true,
            },
            {
              name: "orientation",
              properties: [
                { name: "value", type: "string" },
                { name: "locked", type: "boolean", optional: true },
              ],
              type: "Object",
              optional: true,
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "setLiveRoomFeatures",
    level: 0,
  },
  "context.openExternalUrl": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "url", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtContext",
    apiName: "openExternalUrl",
    level: 0,
  },
  "device.setOrientation": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "orientation", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "setOrientation",
    level: 0,
  },
  "device.openWebView": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "url", type: "string" },
            {
              name: "layout",
              properties: [
                { name: "x", type: "number", optional: true },
                { name: "y", type: "number", optional: true },
                { name: "width", type: "number" },
                { name: "height", type: "number" },
              ],
              type: "Object",
            },
            {
              name: "closeBtn",
              properties: [
                { name: "url", type: "string" },
                { name: "x", type: "number" },
                { name: "y", type: "number" },
                { name: "width", type: "number" },
                { name: "height", type: "number" },
              ],
              type: "Object",
              optional: true,
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "openWebView",
    level: 0,
  },
  "device.closeWebView": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "webviewId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "closeWebView",
    level: 0,
  },
  "device.setWebViewLayout": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "webviewId", type: "string" },
            { name: "x", type: "number" },
            { name: "y", type: "number" },
            { name: "width", type: "number" },
            { name: "height", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "setWebViewLayout",
    level: 0,
  },
  "device.postBroadcastMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "eventName", type: "string" },
            { name: "message", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "postBroadcastMessage",
    level: 0,
  },
  "device.onWebViewContainerLayoutChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "callback",
          properties: [
            {
              name: "info",
              properties: [
                { name: "containerWidth", type: "number" },
                { name: "containerHeight", type: "number" },
                { name: "isLandscape", type: "boolean" },
              ],
              type: "Object",
            },
          ],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "onWebViewContainerLayoutChange",
    level: 0,
  },
  "device.onBroadcastMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "eventName", type: "string" },
            {
              name: "callback",
              properties: [{ name: "message", type: "string" }],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "onBroadcastMessage",
    level: 0,
  },
  "device.offBroadcastMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "eventName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "offBroadcastMessage",
    level: 0,
  },
  "device.startLocalServer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "path", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "startLocalServer",
    level: 0,
  },
  "device.stopLocalServer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "serverId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtDevice",
    apiName: "stopLocalServer",
    level: 0,
  },
  "feedback.reportMetric": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "namespace", type: "string" },
            { name: "metricName", type: "string" },
            { name: "dimensions", type: "Object" },
            { name: "fields", type: "Object" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFeedback",
    apiName: "reportMetric",
    level: 0,
  },
  "feedback.openFeedbackForm": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "type", type: "string" },
            { name: "content", type: "string" },
            { name: "param", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFeedback",
    apiName: "openFeedbackForm",
    level: 0,
  },
  "fs.offlineFileReady": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "url", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "offlineFileReady",
    level: 0,
  },
  "fs.downloadBatchRes": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [
            {
              name: "BatchRes",
              properties: [
                { name: "url", type: "string" },
                { name: "md5", type: "string" },
                { name: "unzip", type: "boolean" },
                { name: "offline", type: "boolean", optional: true },
                { name: "pathType", type: "number", optional: true },
                { name: "sourceName", type: "string", optional: true },
                { name: "encryptUrl", type: "string", optional: true },
                { name: "encryptMd5", type: "string", optional: true },
              ],
              type: "Object",
            },
          ],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "downloadBatchRes",
    level: 0,
  },
  "fs.removeRes": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "encryptMd5", type: "string", optional: true },
            { name: "unzip", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "removeRes",
    level: 0,
  },
  "fs.isResExists": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "fileName", type: "string" },
            { name: "unzip", type: "boolean", optional: true },
            { name: "pathType", type: "number", optional: true },
            { name: "url", type: "string", optional: true },
            { name: "encryptUrl", type: "string", optional: true },
            { name: "encryptMd5", type: "string", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "isResExists",
    level: 0,
  },
  "fs.uploadFileExtra": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "url", type: "string" },
            { name: "fileKey", type: "string" },
            { name: "params", type: "Object", optional: true },
            { name: "compress", type: "boolean" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "uploadFileExtra",
    level: 0,
  },
  "fs.downloadBatchSharedRes": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [
            {
              name: "BatchSharedRes",
              properties: [
                { name: "url", type: "string" },
                { name: "md5", type: "string" },
                { name: "unzip", type: "boolean" },
              ],
              type: "Object",
            },
          ],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "downloadBatchSharedRes",
    level: 0,
  },
  "fs.isSharedResExists": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "url", type: "string" },
            { name: "md5", type: "string" },
            { name: "unzip", type: "boolean" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "isSharedResExists",
    level: 0,
  },
  "fs.cleanRes": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "reserveMD5List",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtFs",
    apiName: "cleanRes",
    level: 0,
  },
  "link.startPublishAudio": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "streamName", type: "string", optional: true }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "startPublishAudio",
    level: 0,
  },
  "link.setMicVolume": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "volume", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "setMicVolume",
    level: 0,
  },
  "link.updateAudioPlay": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [
            {
              name: "UpdateAudioPlayParams",
              properties: [
                { name: "unionId", type: "string", optional: true },
                { name: "uid", type: "number", optional: true },
                { name: "streamName", type: "string", optional: true },
                { name: "volume", type: "number" },
              ],
              type: "Object",
              optional: true,
            },
          ],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "updateAudioPlay",
    level: 0,
  },
  "link.onAudioStreamNameChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "streamNameChangeInfo",
                  properties: [{ name: "streamName", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "onAudioStreamNameChange",
    level: 0,
  },
  "link.inviteLinkMic": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "inviteMessage", type: "string" },
            {
              name: "roomIds",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
            {
              name: "extTypes",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
            { name: "extraData", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "inviteLinkMic",
    level: 0,
  },
  "link.onInviteNotice": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "params",
                  properties: [
                    { name: "noticeType", type: "string" },
                    { name: "roomId", type: "string" },
                    { name: "extraData", type: "string" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "onInviteNotice",
    level: 0,
  },
  "link.onAudioChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  type: "Array",
                  properties: [
                    {
                      name: "AudioChangeInfo",
                      properties: [
                        { name: "speakerId", type: "number" },
                        { name: "volume", type: "number" },
                      ],
                      type: "Object",
                    },
                  ],
                },
              ],
              type: "function",
            },
            { name: "interval", type: "number", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLink",
    apiName: "onAudioChange",
    level: 0,
  },
  "liveEvent.on": {
    ast: {
      name: "args",
      properties: [
        { name: "eventName", type: "string" },
        {
          name: "callback",
          properties: [{ name: "content", type: "Object" }],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLiveEvent",
    apiName: "on",
    level: 0,
  },
  "liveEvent.off": {
    ast: {
      name: "args",
      properties: [
        { name: "eventName", type: "string" },
        {
          name: "callback",
          properties: [{ name: "content", type: "Object" }],
          type: "function",
          optional: true,
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtLiveEvent",
    apiName: "off",
    level: 0,
  },
  "observer.on": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        {
          name: "callback",
          properties: [{ name: "content", type: "string" }],
          type: "function",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "on",
    level: 0,
  },
  "observer.off": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        {
          name: "callback",
          properties: [{ name: "content", type: "string" }],
          type: "function",
          optional: true,
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "off",
    level: 0,
  },
  "observer.emit": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        { name: "message", type: "string" },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "emit",
    level: 0,
  },
  "observer.onLocalMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "eventName", type: "string" },
            {
              name: "callback",
              properties: [{ name: "message", type: "string" }],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "onLocalMessage",
    level: 0,
  },
  "observer.offLocalMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "eventName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "offLocalMessage",
    level: 0,
  },
  "observer.postLocalMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "eventName", type: "string" },
            { name: "message", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "postLocalMessage",
    level: 0,
  },
  "observer.postDevelperLocalMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "eventName", type: "string" },
            { name: "message", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "postDevelperLocalMessage",
    level: 0,
  },
  "observer.onDeveloperLocalMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "eventName", type: "string" },
            {
              name: "callback",
              properties: [{ name: "message", type: "string" }],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "onDeveloperLocalMessage",
    level: 0,
  },
  "observer.offDeveloperLocalMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "eventName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtObserver",
    apiName: "offDeveloperLocalMessage",
    level: 0,
  },
  "order.reportText": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [{ name: "text", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtOrder",
    apiName: "reportText",
    level: 0,
  },
  "panel.setLayout": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "visible", type: "boolean" },
            { name: "x", type: "number" },
            { name: "y", type: "number" },
            { name: "width", type: "number" },
            { name: "height", type: "number" },
            { name: "animate", type: "boolean", optional: true },
            { name: "duration", type: "number", optional: true },
            { name: "alpha", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: [
      (args) => {
        const errMsg = (key, val, range) =>
          `InvalidParameter: Unexpected value of args[0].${key} ${val} is out of range [${range.join(
            ", "
          )}]`;
        const isValidate = (val, range) => val >= range[0] && val <= range[1];
        const config = [
          { name: "width", range: [0, 1] },
          { name: "height", range: [0, 1] },
        ];
        const param = args[0] || {};
        const errParam = config.findIndex(
          ({ name, range }) => !isValidate(param[name], range)
        );
        if (errParam > -1) {
          const info = config[errParam];
          return {
            pass: -1,
            msg: errMsg(info.name, param[info.name], info.range),
          }
        }
        return {
          pass: 1,
          msg: "通过",
        }
      },
    ],
    nativeModuleName: "HYExtPanel",
    apiName: "setLayout",
    level: 1,
  },
  "panel.setPopupCloseBtn": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "enable", type: "boolean" },
            { name: "x", type: "number", optional: true },
            { name: "y", type: "number", optional: true },
            { name: "width", type: "number", optional: true },
            { name: "height", type: "number", optional: true },
            { name: "imgUrl", type: "string", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPanel",
    apiName: "setPopupCloseBtn",
    level: 1,
  },
  "panel.setPanelDimensions": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "width", type: "number" },
            { name: "height", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPanel",
    apiName: "setPanelDimensions",
    level: 0,
  },
  "player.tapped": {
    ast: {
      name: "args",
      properties: [{ name: "params", type: "Object", optional: true }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "tapped",
    level: 0,
  },
  "player.doubleTapped": {
    ast: {
      name: "args",
      properties: [{ name: "params", type: "Object", optional: true }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "doubleTapped",
    level: 0,
  },
  "player.on": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        { name: "callback", type: "function" },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "on",
    level: 0,
  },
  "player.off": {
    ast: {
      name: "args",
      properties: [
        { name: "topic", type: "string" },
        { name: "callback", type: "function", optional: true },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "off",
    level: 0,
  },
  "player.switchLine": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "line", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "switchLine",
    level: 0,
  },
  "player.playVideo": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "url", type: "string" },
            { name: "startTime", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "playVideo",
    level: 0,
  },
  "player.fastForward": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "time", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "fastForward",
    level: 0,
  },
  "player.fastBackward": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "time", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "fastBackward",
    level: 0,
  },
  "player.setViewport": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "x", type: "number" },
            { name: "y", type: "number" },
            { name: "scale", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "setViewport",
    level: 0,
  },
  "player.addViewport": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "x", type: "number" },
            { name: "y", type: "number" },
            { name: "scale", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "addViewport",
    level: 0,
  },
  "player.setBufferTime": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "time", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "setBufferTime",
    level: 0,
  },
  "player.playLive": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "streamName", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "playLive",
    level: 0,
  },
  "player.setVolume": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "volume", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPlayer",
    apiName: "setVolume",
    level: 0,
  },
  "popup.setMode": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "mode", type: "string" },
            { name: "key", type: "string", optional: true },
            { name: "width", type: "number", optional: true },
            { name: "height", type: "number", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPopup",
    apiName: "setMode",
    level: 0,
  },
  "popup.onNoticeShow": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  properties: [{ name: "noticeKey", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPopup",
    apiName: "onNoticeShow",
    level: 0,
  },
  "popup.onNoticeHide": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  properties: [{ name: "noticeKey", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtPopup",
    apiName: "onNoticeHide",
    level: 0,
  },
  "reg.onSpeechRecognition": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "hotwords",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
            {
              name: "callback",
              properties: [
                {
                  name: "recognition",
                  properties: [{ name: "data", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onSpeechRecognition",
    level: 0,
  },
  "reg.onGestureRecognition": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "recognition",
                  properties: [{ name: "key", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onGestureRecognition",
    level: 0,
  },
  "reg.onHumanSkeletonDetection": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "recognition",
                  properties: [
                    {
                      name: "canvas",
                      properties: [
                        { name: "width", type: "number" },
                        { name: "height", type: "number" },
                      ],
                      type: "Object",
                    },
                    {
                      name: "keypoints",
                      type: "Array",
                      properties: [
                        {
                          name: "KeypointInfo",
                          properties: [
                            { name: "x", type: "number" },
                            { name: "y", type: "number" },
                            { name: "score", type: "number" },
                            { name: "id", type: "string" },
                          ],
                          type: "Object",
                        },
                      ],
                    },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onHumanSkeletonDetection",
    level: 0,
  },
  "reg.onFacialLandmarkDetection": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "recognition",
                  properties: [
                    {
                      name: "canvas",
                      properties: [
                        { name: "width", type: "number" },
                        { name: "height", type: "number" },
                      ],
                      type: "Object",
                    },
                    {
                      name: "faces",
                      type: "Array",
                      properties: [
                        {
                          name: "FaceInfo",
                          properties: [
                            {
                              name: "faceRect",
                              properties: [
                                { name: "x", type: "number" },
                                { name: "y", type: "number" },
                                { name: "width", type: "number" },
                                { name: "height", type: "number" },
                              ],
                              type: "Object",
                            },
                            { name: "pitch", type: "number" },
                            { name: "yaw", type: "number" },
                            { name: "roll", type: "number" },
                            {
                              name: "landmarks106",
                              type: "Array",
                              properties: [
                                {
                                  name: "Landmark",
                                  properties: [
                                    { name: "x", type: "number" },
                                    { name: "y", type: "number" },
                                  ],
                                  type: "Object",
                                },
                              ],
                            },
                          ],
                          type: "Object",
                        },
                      ],
                    },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onFacialLandmarkDetection",
    level: 0,
  },
  "reg.onHumanContourDetection": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "recognition",
                  properties: [
                    {
                      name: "canvas",
                      properties: [
                        { name: "width", type: "number" },
                        { name: "height", type: "number" },
                      ],
                      type: "Object",
                    },
                    {
                      name: "contourPoints",
                      type: "Array",
                      properties: [
                        {
                          name: "ContourPointInfo",
                          properties: [
                            { name: "x", type: "number" },
                            { name: "y", type: "number" },
                          ],
                          type: "Object",
                        },
                      ],
                    },
                    { name: "contourCount", type: "number" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onHumanContourDetection",
    level: 0,
  },
  "reg.onCVRecognition": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "keys",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
            {
              name: "callback",
              properties: [
                {
                  name: "recognitions",
                  type: "Array",
                  properties: [
                    {
                      name: "CVRecognition",
                      properties: [
                        { name: "cvRecKey", type: "string" },
                        { name: "cvRecValue", type: "Object" },
                      ],
                      type: "Object",
                    },
                  ],
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onCVRecognition",
    level: 0,
  },
  "reg.offCVRecognition": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "keys",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "offCVRecognition",
    level: 0,
  },
  "reg.queryCVRecognition": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "keys",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "queryCVRecognition",
    level: 0,
  },
  "reg.onSpeechKeywordRecognition": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            {
              name: "hotwords",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
            {
              name: "callback",
              properties: [
                {
                  name: "recognition",
                  properties: [{ name: "data", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "onSpeechKeywordRecognition",
    level: 0,
  },
  "reg.textToSpeech": {
    ast: {
      name: "args",
      properties: [
        {
          name: "param",
          properties: [
            { name: "text", type: "string" },
            { name: "tone", type: "number" },
            { name: "type", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtReg",
    apiName: "textToSpeech",
    level: 0,
  },
  "revenue.requestOpenCoinConsume": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "purchaseOrderId", type: "string" },
            { name: "preOrderNonce", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: [
      (args) => {
        const errMsg = (key, val) =>
          `InvalidParameter: Unexpected value of args[0].${key} ${val} is empty`;
        const isEmpty = (val) => val === "" || val === null || val === undefined;
        const config = [{ name: "purchaseOrderId" }, { name: "preOrderNonce" }];
        const param = args[0] || {};
        const errParam = config.findIndex(({ name }) => isEmpty(param[name]));
        if (errParam > -1) {
          const info = config[errParam];
          return {
            pass: -1,
            msg: errMsg(info.name, param[info.name]),
          }
        }
        return {
          pass: 1,
          msg: "通过",
        }
      },
    ],
    nativeModuleName: "HYExtRevenue",
    apiName: "requestOpenCoinConsume",
    level: 1,
  },
  "stream.setViewerLatencyMode": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "mode", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "setViewerLatencyMode",
    level: 0,
  },
  "stream.addExtraWhiteBoard": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "param", type: "Object", optional: true },
            { name: "width", type: "number" },
            { name: "height", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addExtraWhiteBoard",
    level: 0,
  },
  "stream.removeExtraWhiteBoard": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "wbId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "removeExtraWhiteBoard",
    level: 0,
  },
  "stream.sendToExtraWhiteBoard": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "wbId", type: "string" },
            { name: "data", type: "string", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "sendToExtraWhiteBoard",
    level: 0,
  },
  "stream.setStreamResolution": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "width", type: "number" },
            { name: "height", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "setStreamResolution",
    level: 0,
  },
  "stream.setStreamerLatencyMode": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "mode", type: "number" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "setStreamerLatencyMode",
    level: 0,
  },
  "stream.addLayers": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [
            {
              name: "LayerInfoParam",
              properties: [
                { name: "type", type: "string" },
                { name: "layerName", type: "string", optional: true },
                { name: "offsetX", type: "number" },
                { name: "offsetY", type: "number" },
                { name: "canvasWidth", type: "number" },
                { name: "canvasHeight", type: "number" },
                { name: "weight", type: "number", optional: true },
                { name: "force", type: "boolean", optional: true },
                { name: "param", type: "Object", optional: true },
              ],
              type: "Object",
            },
          ],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addLayers",
    level: 0,
  },
  "stream.updateLayers": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [
            {
              name: "UpdateLayerParam",
              properties: [
                { name: "layerId", type: "string" },
                { name: "offsetX", type: "number" },
                { name: "offsetY", type: "number" },
                { name: "canvasWidth", type: "number" },
                { name: "canvasHeight", type: "number" },
                { name: "weight", type: "number", optional: true },
                { name: "force", type: "boolean", optional: true },
                { name: "param", type: "Object", optional: true },
              ],
              type: "Object",
            },
          ],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "updateLayers",
    level: 0,
  },
  "stream.removeLayers": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          type: "Array",
          properties: [
            {
              name: "LayerId",
              properties: [{ name: "layerId", type: "string" }],
              type: "Object",
            },
          ],
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "removeLayers",
    level: 0,
  },
  "stream.addZone": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "elem", type: "any" },
            {
              name: "options",
              properties: [{ name: "screenColor", type: "string" }],
              type: "Object",
              optional: true,
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addZone",
    level: 0,
  },
  "stream.addWhiteBoard": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "param", type: "Object", optional: true },
            { name: "width", type: "number" },
            { name: "height", type: "number" },
            { name: "x", type: "number" },
            { name: "y", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addWhiteBoard",
    level: 0,
  },
  "stream.addImageLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "frameRate", type: "number", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addImageLayer",
    level: 0,
  },
  "stream.removeImageLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "layerId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "removeImageLayer",
    level: 0,
  },
  "stream.enableFaceEffect": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "enable", type: "boolean" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "enableFaceEffect",
    level: 0,
  },
  "stream.addExeWhiteBoard": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "sharedhandle", type: "string" },
            { name: "x", type: "number" },
            { name: "y", type: "number" },
            { name: "width", type: "number" },
            { name: "height", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addExeWhiteBoard",
    level: 0,
  },
  "stream.onExtraWhiteBoardMessage": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [{ name: "data", type: "string" }],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "onExtraWhiteBoardMessage",
    level: 0,
  },
  "stream.addTextLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "layerId", type: "string", optional: true },
            { name: "text", type: "string" },
            { name: "fontFamily", type: "string", optional: true },
            { name: "fontSize", type: "number", optional: true },
            { name: "fontColor", type: "string", optional: true },
            { name: "useBackground", type: "boolean", optional: true },
            { name: "backgroundColor", type: "string", optional: true },
            { name: "alpha", type: "number", optional: true },
            { name: "bold", type: "boolean", optional: true },
            { name: "italic", type: "boolean", optional: true },
            { name: "underline", type: "boolean", optional: true },
            { name: "scroll", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addTextLayer",
    level: 0,
  },
  "stream.removeTextLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "layerId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "removeTextLayer",
    level: 0,
  },
  "stream.createWB": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "type", type: "string" },
            { name: "wbName", type: "string" },
            { name: "offsetX", type: "number" },
            { name: "offsetY", type: "number" },
            { name: "canvasWidth", type: "number" },
            { name: "canvasHeight", type: "number" },
            { name: "x", type: "number", optional: true },
            { name: "y", type: "number", optional: true },
            { name: "width", type: "number" },
            { name: "height", type: "number" },
            { name: "force", type: "boolean", optional: true },
            { name: "param", type: "Object", optional: true },
            { name: "combinable", type: "boolean", optional: true },
            { name: "editable", type: "boolean", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "createWB",
    level: 1,
  },
  "stream.deleteWB": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "wbId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "deleteWB",
    level: 0,
  },
  "stream.onWBLayoutChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "wbId", type: "string" },
            { name: "wbName", type: "string", optional: true },
            {
              name: "callback",
              properties: [
                {
                  name: "layoutInfo",
                  properties: [
                    {
                      name: "data",
                      properties: [
                        { name: "offsetX", type: "number" },
                        { name: "offsetY", type: "number" },
                        { name: "canvasWidth", type: "number" },
                        { name: "canvasHeight", type: "number" },
                      ],
                      type: "Object",
                    },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "onWBLayoutChange",
    level: 0,
  },
  "stream.updateWB": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "wbId", type: "string" },
            { name: "wbName", type: "string" },
            { name: "offsetX", type: "number" },
            { name: "offsetY", type: "number" },
            { name: "canvasWidth", type: "number" },
            { name: "canvasHeight", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "updateWB",
    level: 0,
  },
  "stream.onLayerLayoutChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "layerId", type: "string" },
            {
              name: "callback",
              properties: [
                {
                  name: "layoutInfo",
                  properties: [
                    { name: "layerId", type: "string" },
                    { name: "type", type: "string" },
                    { name: "layerName", type: "string" },
                    { name: "offsetX", type: "number" },
                    { name: "offsetY", type: "number" },
                    { name: "canvasWidth", type: "number" },
                    { name: "canvasHeight", type: "number" },
                    { name: "weight", type: "number" },
                    { name: "param", type: "Object" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "onLayerLayoutChange",
    level: 0,
  },
  "stream.setStreamCanvasLayout": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "width", type: "number" },
            { name: "height", type: "number" },
            { name: "x", type: "number" },
            { name: "y", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "setStreamCanvasLayout",
    level: 0,
  },
  "stream.addLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "layerId", type: "string" },
            { name: "type", type: "string" },
            { name: "layerName", type: "string" },
            { name: "offsetX", type: "number" },
            { name: "offsetY", type: "number" },
            { name: "canvasWidth", type: "number" },
            { name: "canvasHeight", type: "number" },
            { name: "weight", type: "number" },
            { name: "param", type: "Object" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addLayer",
    level: 0,
  },
  "stream.updateLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "LayerInfoParam",
              properties: [
                { name: "type", type: "string" },
                { name: "layerName", type: "string", optional: true },
                { name: "offsetX", type: "number" },
                { name: "offsetY", type: "number" },
                { name: "canvasWidth", type: "number" },
                { name: "canvasHeight", type: "number" },
                { name: "weight", type: "number", optional: true },
                { name: "force", type: "boolean", optional: true },
                { name: "param", type: "Object", optional: true },
              ],
              type: "Object",
            },
            {
              name: "LayerId",
              properties: [{ name: "layerId", type: "string" }],
              type: "Object",
            },
          ],
          type: "__polytype__",
          rawType: "LayerInfoParam|LayerId",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "updateLayer",
    level: 0,
  },
  "stream.removeLayer": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "layerId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "removeLayer",
    level: 0,
  },
  "stream.addEffect": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "fileName", type: "string" },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "addEffect",
    level: 0,
  },
  "stream.removeEffect": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "md5", type: "string" },
            { name: "fileName", type: "string" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "removeEffect",
    level: 0,
  },
  "stream.getStreamingInfo": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "keys",
              type: "Array",
              properties: [{ name: "string", type: "string" }],
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "getStreamingInfo",
    level: 0,
  },
  "stream.setWBEditMode": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "enable", type: "boolean" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "setWBEditMode",
    level: 0,
  },
  "stream.onLayerStatusChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "layerId", type: "string" },
            {
              name: "callback",
              properties: [
                {
                  name: "statusInfo",
                  properties: [
                    { name: "layerId", type: "string" },
                    { name: "type", type: "string" },
                    { name: "layerName", type: "string" },
                    { name: "status", type: "string" },
                    { name: "param", type: "Object" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "onLayerStatusChange",
    level: 0,
  },
  "stream.offLayerStatusChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "layerId", type: "string" },
            {
              name: "callback",
              properties: [
                {
                  name: "statusInfo",
                  properties: [
                    { name: "layerId", type: "string" },
                    { name: "type", type: "string" },
                    { name: "layerName", type: "string" },
                    { name: "status", type: "string" },
                    { name: "param", type: "Object" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "offLayerStatusChange",
    level: 0,
  },
  "stream.getLayerInfo": {
    ast: {
      name: "args",
      properties: [{ name: "params", type: "Object", optional: true }],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "getLayerInfo",
    level: 0,
  },
  "stream.onCurrentStreamNameChange": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  properties: [{ name: "streamName", type: "string" }],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtStream",
    apiName: "onCurrentStreamNameChange",
    level: 0,
  },
  "ui.setOpenPlatformBadgeStatus": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "visible", type: "boolean" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "setOpenPlatformBadgeStatus",
    level: 0,
  },
  "ui.openH5MiniappPopup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "url", type: "string" },
            { name: "name", type: "string" },
            { name: "titlelbar", type: "boolean" },
            {
              name: "layout",
              properties: [
                { name: "width", type: "number" },
                { name: "height", type: "number" },
              ],
              type: "Object",
            },
            {
              name: "dragHandleLayout",
              properties: [
                { name: "x", type: "number" },
                { name: "y", type: "number" },
                { name: "width", type: "number" },
                { name: "height", type: "number" },
              ],
              type: "Object",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "openH5MiniappPopup",
    level: 0,
  },
  "ui.setEntranceText": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "text", type: "string" },
            { name: "toast", type: "string", optional: true },
            { name: "toastAction", type: "string", optional: true },
            { name: "toastActionID", type: "string", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "setEntranceText",
    level: 0,
  },
  "ui.setGesturePenetration": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "enable", type: "boolean" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "setGesturePenetration",
    level: 0,
  },
  "ui.onEntranceToastClick": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            {
              name: "callback",
              properties: [
                {
                  name: "info",
                  properties: [
                    { name: "toastActionID", type: "string" },
                    { name: "toastAction", type: "string" },
                  ],
                  type: "Object",
                },
              ],
              type: "function",
            },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "onEntranceToastClick",
    level: 0,
  },
  "ui.triggerVideoClick": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "button", type: "number" },
            { name: "clientX", type: "number" },
            { name: "clientY", type: "number" },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "triggerVideoClick",
    level: 0,
  },
  "ui.showNativeInputBar": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "text", type: "string", optional: true },
            { name: "placeholder", type: "string", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtUI",
    apiName: "showNativeInputBar",
    level: 0,
  },
  "hyv.openVideo": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "vid", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtVideo",
    apiName: "openVideo",
    level: 0,
  },
  "view.createSubView": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "position", type: "string" },
            {
              name: "layout",
              properties: [
                { name: "width", type: "number" },
                { name: "ratio", type: "number" },
                { name: "top", type: "number" },
                { name: "left", type: "number" },
              ],
              type: "Object",
            },
            { name: "level", type: "number", optional: true },
            { name: "weight", type: "number", optional: true },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "createSubView",
    level: 0,
  },
  "view.destroySubView": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "subViewId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "destroySubView",
    level: 0,
  },
  "view.hideSubView": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "subViewId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "hideSubView",
    level: 0,
  },
  "view.showSubView": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "subViewId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "showSubView",
    level: 0,
  },
  "view.createPopup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [
            { name: "width", type: "number" },
            { name: "height", type: "number" },
            {
              name: "config",
              properties: [
                { name: "handleX", type: "number" },
                { name: "handleY", type: "number" },
                { name: "handleWidth", type: "number" },
                { name: "handleHeight", type: "number" },
              ],
              type: "Object",
              optional: true,
            },
            { name: "param", type: "Object", optional: true },
          ],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "createPopup",
    level: 0,
  },
  "view.destroyPopup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "popupId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "destroyPopup",
    level: 0,
  },
  "view.hidePopup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "popupId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "hidePopup",
    level: 0,
  },
  "view.showPopup": {
    ast: {
      name: "args",
      properties: [
        {
          name: "params",
          properties: [{ name: "popupId", type: "string" }],
          type: "Object",
        },
      ],
      type: "Array",
    },
    validate: undefined,
    nativeModuleName: "HYExtView",
    apiName: "showPopup",
    level: 0,
  },
};

function createValiator(configMap) {
  const validation = {};

  for (let key in configMap) {
    const config = configMap[key];
    const id = getApiValidationId(
      config.nativeModuleName.toLowerCase(),
      config.apiName
    ); // nativeModuleName 用小写
    let validateFnQueue = [];
    if (config.ast !== null) {
      validateFnQueue.push(createValidateFnByAst(config.ast));
    }
    if (Array.isArray(config.validate) && config.validate.length) {
      validateFnQueue = validateFnQueue.concat(config.validate);
    }
    if (validateFnQueue.length > 0) {
      validation[id] = {
        level: config.level,
        validateFn: bailout(validateFnQueue, handleBailout)
      };
    }
  }

  return {
    ValidateStatus,
    validate(moduleName, apiName, args) {
      const id = getApiValidationId(moduleName.toLowerCase(), apiName);
      const config = validation[id];

      const result =
        config && typeof config.validateFn === 'function'
          ? config.validateFn(args)
          : passWithoutValidation();

      // 对齐checker接口
      return {
        pass:
          result.pass === ValidateStatus.Pass ||
          result.pass === ValidateStatus.UserPass,
        msg: result.msg,
        level: config && config.level || 0
      }
    }
  }
}

function getApiValidationId(moduleName, apiName) {
  return `${moduleName}.${apiName}`
}

// 验证函数的返回值需要实现 { pass, reason }
function handleBailout(rsp) {
  return rsp.pass === ValidateStatus.Fail
}

function passWithoutValidation() {
  return {
    pass: ValidateStatus.UserPass,
    msg: '没有配置验证函数，默认通过'
  }
}

var Validator = createValiator(validationConfig);

checker.registAPIChecker((m, a) => (...args) => {
  return Validator.validate(m, a, args)
});

var rspConfig = {
  "HYExtAdvance": {
    "currentChannelInfo": {
      "type": "object",
      "props": [
        { "type": "string", "name": "aSid" },
        { "type": "string", "name": "topSid" },
        { "type": "string", "name": "subSid" },
        { "type": "number", "name": "presenterId" },
        { "type": "number", "name": "currentUid" },
        { "type": "number", "name": "durationAfterJoinSuccess" },
        { "type": "string", "name": "gameId" },
        { "type": "number", "name": "subscribeState" },
        { "type": "number", "name": "isLiving" }
      ]
    },
    "getCurrentUserInfo": {
      "type": "object",
      "props": [
        { "type": "number", "name": "imid" },
        { "type": "number", "name": "uid" },
        { "type": "string", "name": "status" },
        { "type": "number", "name": "err_code" },
        { "type": "number", "name": "userLevel" },
        { "type": "number", "name": "userCurrentExp" },
        { "type": "number", "name": "nextLevelExp" },
        { "type": "number", "name": "dailyExp" },
        {
          "type": "object",
          "name": "nobleInfo",
          "props": [
            { "type": "number", "name": "uid" },
            { "type": "number", "name": "validDate" },
            { "type": "number", "name": "nobleLevel" },
            {
              "type": "object",
              "name": "channelInfo",
              "props": [
                { "type": "number", "name": "tid" },
                { "type": "number", "name": "sid" },
                { "type": "number", "name": "pid" },
                { "type": "number", "name": "guardLevel" },
                { "type": "number", "name": "fansLevel" },
              ]
            }
          ]
        }
      ]
    },
    "getTid": {
      "type": "object",
      "props": [
        {
          "type": "object",
          "name": "tId",
          "props": [
            { "type": "number", "name": "lUid" },
            { "type": "string", "name": "sGuid" },
            { "type": "string", "name": "sHuYaUA" },
            { "type": "number", "name": "iTokenType" }
          ]
        }
      ]
    },
    "getGiftPanelSelectedUser": {
      "type": "object",
      "props": [
        {
          "type": "object",
          "name": "user",
          "props": [
            { "type": "number", "name": "uid" },
          ]
        }
      ]
    },
    "onGiftPanelSelectedUserChange": {
      "type": "object",
      "props": [
        {
          "type": "object",
          "name": "user",
          "props": [
            { "type": "number", "name": "uid" },
          ]
        }
      ]
    },
    "getJoinMicUserList": {
      "type": "array",
      "props": [
        {
          "type": "object",
          "props": [
            { "type": "number", "name": "uid" },
            { "type": "number", "name": "status" },
            { "type": "number", "name": "seatType" },
            { "type": "number", "name": "pos" }
          ]
        }
      ]
    },
  }
};

parser.registTypeConfig(rspConfig);

var config = {
  "HYExtContext.sendGift": {
    id: 308,
  },
  "HYExtContext.leadSubscribe": {
    id: 306,
  },
  "HYExtObserver.onLocalMessage": {
    id: 503,
  },
  "HYExtPanel.setLayout": {
    id: 900,
  },
  "HYExtAdvance.currentChannelInfo": {
    id: 2600,
  },
  "HYExtAdvance.sendGift": {
    id: 2611,
  },
  "HYExtAdvance.sendGiftToUser": {
    id: 2612,
  },
  "HYExtFs.uploadFileExtra": {
    id: 2806,
  },
};

errUtil.registErrProcess((err, path) => {
  if (!err || !path) return err;

  // 处理 errcode，声明 error 避免污染 err
  const { errcode: ecode, _in, userInfo } = err;

  // app 端 errcode 存到了 userInfo 里
  const { errcode: ucode, ...oUserInfo } = userInfo || {};
  const errcode = ucode || ecode;
  err.errcode = errcode;

  // userInfo 过滤后回归
  if (userInfo) {
    err.userInfo = oUserInfo;
  }

  // 内部报错
  if (_in) {
    delete err._in;
    return err;
  }

  // 不处理的报错，非number，或 1000 以上
  if (!baseUtil.isNumber(errcode) || errcode >= 1000) return err;

  // 获取 pathID 并前缀 id，后三位补位000
  const { id } = config[path] || {};
  if (id) {
    err.errcode = parseInt(`${id}${`000${errcode}`.slice(-3)}`);
  }
  return err;
});

extsdk.core.injectAdapters(adapter);
extsdk.core.injectModules(modules);
extsdk.core.injectModules(client.isExt ? modulesExt : modulesLive);
debuger.start();
reporter.init();

const MODULE_NAME$v = 'HYExtAR';

var HYExtAR = {
  /**
   * AR特效
   * @namespace ar
   */
  ar: {
    /**
     * @edata
     * @typedef {Object} SupportResp
     * @property {boolean} isSupport 是否支持
     */
    /**
     * 是否支持Unity
     * @eapi
     * @returns {Promise<SupportResp>} 查询结果
     */
    isSupportUnity() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'isSupportUnity');
    },

    /**
     * 是否支持AR
     * @eapi
     * @returns {Promise<SupportResp>} 查询结果
     */
    isSupportAR() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'isSupportAR');
    },

    /**
     * @edata
     * @typedef {Object} SceneReq 场景参数
     * @property {string} sceneName 场景名, U3D_SCENE_SPECTRUM2D_VALUE-动感舞台, U3D_SCENE_AR_VALUE-AR主播
     */
    /**
     * @edata
     * @typedef {Object} SceneRespEffectInfo 特效信息
     * @property {number} type 类型
     * @property {number} u3dResourceId u3dResourceId
     * @property {number} u3dResourceType u3dResourceType
     * @property {string} thumb thumb
     */
    /**
     * 获取特效列表数据
     * @eapi
     * @param {SceneReq} params 参数
     * @returns {Promise<Array.<SceneRespEffectInfo>>} 调用结果 
     */
    getEffectList(params) {
      return extsdk.core.callEvent(MODULE_NAME$v, 'getEffectList', params);
    },

    /**
     * 启动activity
     * @eapi
     * @param {SceneReq} params 启动参数
     * @returns {Promise<void>} 调用结果 
     */
    loadUnity(params) {
      return extsdk.core.callEvent(MODULE_NAME$v, 'loadUnity', params);
    },

    /**
     * 退出Unity
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    unloadUnity() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'unloadUnity');
    },

    /**
     * @edata
     * @typedef {Object} SwitchReq 切换参数
     * @property {number} resourceType resourceType
     * @property {number} resourceId resourceId
     */
    /**
     * 切换AR特效
     * @eapi
     * @param {SwitchReq} params 切换参数
     * @returns {Promise<void>} 调用结果
     */
    switchArEffect(params) {
      return extsdk.core.callEvent(MODULE_NAME$v, 'switchArEffect', params);
    },

    /**
     * @edata
     * @typedef {Object} SceneResp
     * @property {string} sceneName 场景名
     */
    /**
     * 获取当前场景名
     * @eapi
     * @returns {Promise<SceneResp>} 调用结果
     */
    getCurrentScene() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'getCurrentScene');
    },

    /**
     * 重置AR平面
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    resetPlane() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'resetPlane');
    },

    /**
     * @edata
     * @typedef {Object} RunningResp
     * @property {boolean} isRunning 是否在运行
     */
    /**
     * 判断U3D是否正在运行
     * @eapi
     * @returns {Promise<RunningResp>} 查询结果
     */
    isRunning() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'isRunning');
    },

    /**
     * @edata
     * @typedef {Object} ArEffectInfo AR特效信息
     * @property {number} resourceType resourceType
     * @property {number} resourceId resourceId 
     */
    /**
     * 获取当前AR特效
     * @eapi
     * @returns {Promise<ArEffectInfo>} 调用结果
     */
    getCurrentArEffect() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'getCurrentArEffect');
    },

    /**
     * @edata
     * @typedef {Object} DanceEffect 伴舞特效信息
     * @property {number} danceId 伴舞特效Id
     */
    /**
     * 获取当前伴舞特效
     * @eapi
     * @since 2.12.1
     * @returns {Promise<DanceEffect>} 调用结果
     */
    getCurrentDanceEffect() {
      return extsdk.core.callEvent(MODULE_NAME$v, 'getCurrentDanceEffect');
    },

    /**
     * @edata
     * @typedef {Object} DanceEffectInfo
     * @property {number} danceId 伴舞特效ID
     * @property {string} thumb thumb
     */
    /**
     * @edata
     * @typedef {Object} DanceEffectParams 伴舞特效信息
     * @property {string} sceneName 场景名, U3D_SCENE_SPECTRUM2D_VALUE-动感舞台, U3D_SCENE_AR_VALUE-AR主播
     */
    /**
     * 获取伴舞特效列表数据
     * @eapi
     * @since 2.12.1
     * @param {DanceEffectParams} params 参数
     * @returns {Promise<Array.<DanceEffectInfo>>} 调用结果
     */
    getDanceEffectList(params) {
      return extsdk.core.callEvent(MODULE_NAME$v, 'getDanceEffectList', params);
    },

    /**
     * @edata
     * @typedef {Object} SwitchDanceEffectParams 切换伴舞特效参数
     * @property {number} danceId 伴舞特效ID
     */
    /**
     * 切换伴舞特效
     * @eapi
     * @since 2.12.1
     * @param {SwitchDanceEffectParams} params 切换参数
     * @returns {Promise<void>} 调用结果
     */
    switchDanceEffect(params) {
      return extsdk.core.callEvent(MODULE_NAME$v, 'switchDanceEffect', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$u = 'HYExtAction';

var HYExtAction = {

  /**
   * @namespace action
   */
  action: {
    /**
     * @typedef {any} Enum 
     */
    /**
     * 小程序入口控制参数
     * @edata
     * @typedef {Object} EntranceReq
     * @property {string} extType 小程序类型, web_video_com-虎牙主站面板, web_popup-虎牙主站浮窗, app_panel-虎牙直播APP面板, app_popup-虎牙直播APP浮窗, zs_anchor_panel-虎牙助手面板, zs_anchor_popup-虎牙助手浮窗, pc_anchor_panel-PC主播端面板, pc_panel-PC观众端面板, pc_popup-PC观众端浮窗 
     * @property {boolean} visible 入口是否显示
     * @property {Object} [param] 自定义参数
     */
    /** 
     * 小程序入口控制
     * @eapi
     * @param {EntranceReq} params 输入参数
     * @returns {Promise<any>} 
     */
    localControlEntrance(params) {
      return extsdk.core.callEvent(MODULE_NAME$u, 'localControlEntrance', params);
    },

    /**
     * @edata
     * @typedef {Object} PanelLoadReq
     * @property {string} extType 小程序类型, web_video_com-虎牙主站面板, web_popup-虎牙主站浮窗, app_panel-虎牙直播APP面板, app_popup-虎牙直播APP浮窗, zs_anchor_panel-虎牙助手面板, zs_anchor_popup-虎牙助手浮窗, pc_anchor_panel-PC主播端面板, pc_panel-PC观众端面板, pc_popup-PC观众端浮窗 
     * @property {boolean} load 是否加载（仅适用于浮窗类型的小程序，是否加载）
     * @property {Object} [param] 自定义参数
     */
    /**
     * 本地控制小程序面板加载
     * @eapi
     * @param {PanelLoadReq} params 输入参数
     * @returns {Promise<any>} 
     */
    localControlPanelLoad(params) {
      return extsdk.core.callEvent(MODULE_NAME$u, 'localControlPanelLoad', params);
    },

    /**
     * 本地控制小程序面板可见 参数
     * @edata
     * @typedef {Object} PanelVisibleReq
     * @property {string} extType 小程序类型, web_video_com-虎牙主站面板, app_panel-虎牙直播APP面板, zs_anchor_panel-虎牙助手面板, pc_anchor_panel-PC主播端面板, pc_panel-PC观众端面板
     * @property {boolean} visible 是否可见
     * @property {Object} [param] 自定义参数
     */
    /**
     * 本地控制小程序面板可见
     * @summary 仅适用于面板类型的小程序
     * @eapi
     * @param {PanelVisibleReq} params 输入参数
     * @returns {Promise<any>} 调用参数
     */
    localControlPanelVisible(params) {
      return extsdk.core.callEvent(MODULE_NAME$u, 'localControlPanelVisible', params);
    },

    /**
     * @edata
     * @typedef {Object} ShowEntranceReq
     * @property {string} extTypes 要显示入口的小程序类型枚举值，以逗号分隔, web_video_com-虎牙主站面板(默认), app_panel-虎牙直播APP面板
     * @property {number} [countDown] 入口显示的倒计时，单位是秒
     * @property {string} [cornerMarkId] 入口显示的角标, -无, fire-火, new-新
     */
    /**
     * 显示客户端小程序入口
     * @summary 当小程序入口的显示受产品约束控制时，才需要用此API控制
     * - 该接口触发后，失效为1小时，如需要继续使用请再次触发，延续展示时长
     * @eapi
     * @param {ShowEntranceReq} params 参数
     * @returns {Promise<any>} 显示入口是否成功
     */
    showEntrance(params) {
      return extsdk.core.callEvent(MODULE_NAME$u, 'showEntrance', params);
    },

    /**
     * 隐藏客户端小程序入口参数
     * @edata
     * @typedef {Object} HideEntranceReq
     * @property {string} extTypes 要隐藏入口的小程序类型枚举值，以逗号分隔, web_video_com-虎牙主站面板, app_panel-虎牙直播APP面板
     */
    /**
     * 隐藏客户端小程序入口
     * @summary 当小程序入口的显示受产品约束控制时，才需要用此API控制
     * @eapi
     * @param {HideEntranceReq} params 参数
     * @returns {Promise<any>} 隐藏入口是否成功
     */
    hideEntrance(params) {
      return extsdk.core.callEvent(MODULE_NAME$u, 'hideEntrance', params);
    },
  }
};

/** @ignore */
const MODULE_NAME$t = 'HYExtAdvance';


var HYExtAdvance = {
  /**
   * 高级模块
   * @namespace advance
   */
  advance: {
    /**
     * 直播间信息
     * @edata
     * @typedef {Object} RespChannelInfo
     * @property {string} aSid aSid
     * @property {string} topSid 顶级频道
     * @property {string} subSid 子频道
     * @property {number} presenterId 主播uid
     * @property {string} presenterName 当前用户昵称
     * @property {number} currentUid 当前用户uid
     * @property {string} currentLogoUrl 当前用户头像
     * @property {string} presenterLogoUrl 主播头像
     * @property {number} durationAfterJoinSuccess 观看时长，秒
     * @property {string} gameId 品类ID
     * @property {number} subscribeState 当前主播订阅状态, 0-未订阅, 1-已订阅
     * @property {number} isLiving 是否正在直播, 0-不在直播, 1-正在直播
     */
    /**
     * 当前直播间信息
     * @eapi
     * @returns {Promise<RespChannelInfo>} 返回直播间信息
     */
    currentChannelInfo() {
      return extsdk.core.callEvent(MODULE_NAME$t, 'currentChannelInfo');
    },

    /**
     * @edata
     * @typedef {Object} LoginParams
     * @property {number} type 登录类型, 0-全屏登录, 1-半屏登录(默认)
     */
    /**
     * 跳转登陆界面
     * @eapi
     * @param {LoginParams} [param] 参数
     * @returns {Promise<void>} 返回是否跳转成功
     */
    showLogin(param = { type: 1 }) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'showLogin', param);
    },

    /**
     * 频道信息
     * @edata
     * @typedef {Object} ChannelInfo 
     * @property {number} tid 顶级频道
     * @property {number} sid 子频道
     * @property {number} pid 主播id
     * @property {string} presenterNick 主播昵称
     * @property {boolean} isGuard 是否对应主播的守护
     * @property {number} guardLevel 守护等级
     * @property {boolean} isFans 是否对应主播的粉丝
     * @property {number} fansLevel 粉丝等级
     * @property {string} fansName 粉丝名称
     */
    /**
     * 贵族信息
     * @edata
     * @typedef {Object} NobleInfo
     * @property {boolean} isNoble 是否是贵族
     * @property {number} uid 用户uid
     * @property {number} validDate 贵族有效期的时间戳
     * @property {string} nobleName 贵族名称
     * @property {number} nobleLevel 贵族等级, 6-大帝, 5-君王, 4-公爵
     * @property {string} nobleNick 用户昵称
     * @property {ChannelInfo} channelInfo 频道信息
     */
    /**
     * 详细用户信息
     * @edata
     * @typedef {Object} MainUserInfo
     * @property {number} imid imid
     * @property {number} uid 用户uid
     * @property {string} status status
     * @property {number} err_code 错误码
     * @property {string} udbToken udbToken
     * @property {string} ticketType ticketType
     * @property {string} avatarUrl 头像路径
     * @property {string} sex 性别 "女"、"男"
     * @property {string} name 用户昵称
     * @property {number} userLevel 用户等级
     * @property {string} sign 签名
     * @property {number} userCurrentExp 当前经验值
     * @property {number} nextLevelExp 下个等级经验值
     * @property {number} dailyExp 日经验
     * @property {NobleInfo} nobleInfo 贵族信息
     * @property {boolean} isThirdPartyLogin 是否第三方登录 
     * @property {number} udbAnonymousUid 【仅观众端支持】匿名uid
     */
    /**
     * 当前登陆用户相关信息
     * @eapi
     * @returns {Promise<MainUserInfo>} 返回当前登陆用户相关信息
     */
    getCurrentUserInfo() {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getCurrentUserInfo');
    },

    /**
     * 额外信息
     * @edata
     * @typedef {Object} ExtraDataInfo
     * @property {Object} prop 上报数据
     */
    /**
     * 数据埋点上报接口
     * @eapi
     * @param {string} prod prod
     * @param {string} eid eid
     * @param {string} [label] label
     * @param {ExtraDataInfo} [extraInfo] extraInfo
     * @returns {Promise<void>}
     */
    addActionEventWithExtraInfo(prod, eid, label, extraInfo) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'addActionEventWithExtraInfo', prod, eid, label, extraInfo);
    },

    /**
     * @edata
     * @typedef {Object} ReqUrlInfo 外链信息
     * @property {string} url 要打开的url
     */
    /**
     * 打开指定的Url
     * @eapi
     * @param {ReqUrlInfo} param 参数
     * @returns {Promise<void>} 返回打开结果
     */
    openUrl(param) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'openUrl', param);
    },

    /**
     * @edata
     * @typedef {Object} TidInfo 用户凭证
     * @property {number} lUid 用户uid
     * @property {string} sGuid guid
     * @property {string} sToken token
     * @property {string} sHuYaUA ua
     * @property {string} sCookie cookie
     * @property {number} iTokenType token type
     * @property {string} sDeviceInfo 设备信息
     */
    /**
     * @edata
     * @typedef {Object} TidResp
     * @property {TidInfo} tId 用户凭证
     */
    /**
     * 获取用户凭证
     * @eapi
     * @returns {Promise<TidResp>} 返回结果
     */
    getTid() {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getTid');
    },

    /**
     * SendWupResp
     * @edata
     * @typedef {Object} SendWupResp 发送Wup消息回调
     * @property {Object} rsp 响应数据
     * @property {number} bcode 响应code
     */
    /**
     * WupReq
     * @edata
     * @typedef {Object} WupReq taf请求参数
     * @property {Object} req 请求的jce对象
     * @property {Function|Object} rspClass 响应的jce类
     * @property {string} servant servant/ui
     * @property {string} funcName 方法名
     * @property {number} [strategy] 策略, 0-加载网络, 2-加载缓存
     * @property {string} [reqClassName] 请求的jce类名
     * @property {string} [rspClassName] 响应的jce类名
     * @property {number} [channel] 通道
     * @property {number} [retryCount] 重试次数
     * @property {number} [totalTimeout] 总超时时间，单位s 
     * @property {any} [unitPacket] unitPacket
     * @property {boolean} [useDirectStrategy] 使用直连策略
     */
    /**
     * 发送taf请求
     * @eapi
     * @param {WupReq} params 请求参数
     * @returns {Promise<SendWupResp>} 请求返回的jce对象
     */
    sendWup(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'sendWup', params);
    },

    /**
     * WupMessage
     * @edata
     * @typedef {Object} WupMessage Wup消息
     * @property {Object} message jce对象
     */
    /**
     * Wup消息回调
     * @edata
     * @callback WupMessageCallback Wup消息回调
     * @param {WupMessage} wupMessage 回调参数
     */
    /**
     * 监听信息传参
     * @edata
     * @typedef {Object} WupMessageReq 监听信息
     * @property {Object|Function} messageClass 返回的jce对象类型
     * @property {string} uri 监听uri
     * @property {boolean} [useDirectStrategy] 使用直连策略
     * @property {WupMessageCallback} callback 回调函数
     */
    /**
     * 监听taf信令
     * @eapi
     * @param {WupMessageReq} params 监听信息
     * @returns {Promise<void>} 监听结果
     */
    onWupMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'onWupMessage', params);
    },

    /**
     * @edata
     * @typedef {Object} LinkStatusResp 信令长链接变化回调参数
     * @property {boolean} connected 通道是否已连接
     */
    /**
     * @edata
     * @callback LinkStatusChange 信令长链接变化回调
     * @param {LinkStatusResp} linkStatusResp 回调参数
     */
    /**
     * @edata
     * @typedef {Object} LinkStatusReq 监听信息
     * @property {number} channelType 要监听的通道类型
     * @property {LinkStatusChange} callback 回调函数
     * @property {boolean} [useDirectStrategy] 启用直连策略
     */
    /**
     * 监听信令连接状态变化
     * @eapi
     * @param {LinkStatusReq} params 监听参数
     * @returns {Promise<void>} 监听结果
     */
    onLinkStatusChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$t, 'onLinkStatusChange', params);
    },

    /**
     * @edata
     * @typedef {Object} RegisteInfo 注册组信息
     * @property {string} [group] 组ID
     * @property {Array.<string>} [groupIds] 组ID列表
     * @property {number} [channelType] 通道类型
     * @property {boolean} [useDirectStrategy] 使用直连策略
     */
    /**
     * 注册广播组
     * @eapi
     * @param {RegisteInfo} params 注册组信息
     * @returns {Promise<void>} 注册广播组结果
     */
    registerGroup(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'registerGroup', params);
    },

    /**
     * @edata
     * @typedef {Object} UnRegisteInfo 注销组信息
     * @property {Array.<string>} [groupIds] 组ID列表
     * @property {number} [channelType] 通道类型
     * @property {boolean} [useDirectStrategy] 使用直连策略
     */
    /**
     * 注销广播组
     * @eapi
     * @param {UnRegisteInfo} params 要注销的组信息
     * @returns {Promise<void>} 注销广播组结果
     */
    unRegisterGroup(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'unRegisterGroup', params);
    },


    /**
     * 礼物信息
     * @edata
     * @typedef {Object} ReqSendGiftInfo
     * @property {number} giftId 礼物Id
     * @property {number} giftCount 礼物个数
     * @property {boolean} [useSelectMic] 向已选上麦用户送礼
     * @property {string} [sourceType] 来源
     * @property {Object} [mapParam] 普通透传参数
     */
    /**
     * 【高级】当前用户送礼
     * @summary 与hyExt.context.sendGift的区别是，这个接口不会弹出二次确认弹窗，直接送出礼物
     * @eapi
     * @param {ReqSendGiftInfo} params 送礼信息
     * @returns {Promise<void>}
     */
    sendGift(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'sendGift', params);
    },

    /**
     * 发送礼物信息
     * @edata
     * @typedef {Object} SendGiftTUInfo
     * @property {number} giftId 发送礼物Id
     * @property {number} giftCount 发送礼物个数
     * @property {number} uid 用户的uid
     * @property {string} [sourceType] 来源
     * @property {Object} [mapParam] 普通透传参数
     */
    /**
     * 在交友直播间中指定用户送礼
     * @summary 这个接口不会弹出二次确认弹窗，直接送出礼物
     * - 仅适用于交友直播间
     * @eapi
     * @param {SendGiftTUInfo} params 礼物信息
     * @returns {Promise<void>} 
     */
    sendGiftToUser(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'sendGiftToUser', params);
    },

    /**
     * 上麦用户信息
     * @edata
     * @typedef {Object} MicUserInfo
     * @property {number} uid 用户的uid
     * @property {string} userNick 用户昵称
     * @property {string} userAvatarUrl 用户头像地址
     * @property {number} status 上麦状态, 1-上麦中, 2-等待中
     * @property {number} seatType 身份, 0-纯交友：全部麦位, 1-陪玩派单：老板麦位, 2-陪玩派单：接待麦位, 3-交友电台：守护麦位, 4-交友电台：高级守护麦位
     * @property {number} pos 麦序（从1开始，仅适用于上麦状态是上麦中的用户）
     * @property {string} seatName 座位名字，仅适用于上麦状态是上麦中的用户
     */
    /**
     * 获取交友直播间上麦用户信息
     * @eapi
     * @returns {Promise<Array.<MicUserInfo>>} 上麦用户信息列表
     * @reject {Error} 错误信息
     */
    getJoinMicUserList() {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getJoinMicUserList');
    },

    /**
     * @edata
     * @typedef {Object} GetLocalItemReq 获取本地设置参数
     * @property {string} key 键
     * @property {boolean} bindUid 是否要跟主播的身份绑定
     */
    /**
     * @edata
     * @typedef {Object} SetLocalItemResp 本地设置信息
     * @property {string} value 值
     */
    /**
     * 读取本地设置
     * @eapi
     * @param {GetLocalItemReq} params 读取参数
     * @returns {Promise<SetLocalItemResp>} 调用结果
     */
    getLocalItem(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getLocalItem', params);
    },

    /**
     * @edata
     * @typedef {Object} SetLocalItemReq 修改本地设置信息
     * @property {string} key 键
     * @property {string} value 值
     * @property {boolean} bindUid 是否要跟主播的身份绑定
     */
    /**
     * 修改本地设置
     * @eapi
     * @param {SetLocalItemReq} params 调用参数
     * @returns {Promise<void>} 调用结果
     */
    setLocalItem(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'setLocalItem', params);
    },

    /**
     * @edata
     * @typedef {Object} AddEffectReq
     * @property {string} md5 资源的md5
     * @property {string} fileName 文件名
     * @property {Object} [param] 额外参数
     */
    /**
     * 高级增加特效
     * @summary 这个接口增加的特效和助手本身的效果不互斥
     * @eapi
     * @param {AddEffectReq} params 输入参数 
     * @returns {Promise<void>} 调用结果
     */
    addEffect(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'addEffect', params);
    },

    /**
     * @edata
     * @typedef {Object} PingSignalInfo 网络情况信息
     * @property {number} ping_start 请求开始
     * @property {number} huyacef_handle_start 信令客户端收到业务请求	
     * @property {number} signal_ap_start 信令服务收到sdk请求，服务端时间戳，跟其他时间戳有差异
     * @property {number} signal_ap_end	信令服务响应sdk请求，服务端时间戳，跟其他时间戳有差异
     * @property {number} huyacef_handle_end 信令客户端收到服务端回包回调业务时间点
     * @property {number} ping_end 请求结束
     */
    /**
     * @edata
     * @typedef {Object} PingSignalRsp 网络情况信息
     * @property {PingSignalInfo} timestamp 各个阶段时间戳信息
     */
    /**
     * 探测信令通道网络情况
     * @eapi
     * @since 2.14.0
     * @param {Object} [params] 参数
     * @returns {Promise<PingSignalRsp>} 调用结果
     */
    pingSignal(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'pingSignal', params);
    },

    /**
     * @edata
     * @typedef {Object} LinkStatusRsp 链接状态信息
     * @property {boolean} connected 通道是否已连接
     */
    /**
     * @edata
     * @typedef {Object} LinkStatusParams 参数
     * @property {boolean} useDirectStrategy 使用直连策略
     */
    /**
     * 获取信令通道链接状态
     * @eapi
     * @since 3.1.2
     * @param {LinkStatusParams} params 参数
     * @returns {Promise<LinkStatusRsp>} 返回结果
     */
    getLinkStatus(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getLinkStatus', params);
    },


    /**
     * 充钱完成后的回调信息
     * @edata
     * @typedef {Object} BuyIAPProdResult 
     * @property {string} payresult 支付结果, 取值说明: '1' 成功; '0' 失败;
     */
    /**
     * 充钱完成后的回调
     * @edata
     * @callback BuyIAPProdCallback
     * @param {BuyIAPProdResult} res 回调信息
     */
    /**
     * 支付参数
     * @edata
     * @typedef {Object} BuyIAPProdParams
     * @property {string} buyWay buyWay
     * @property {string} name name
     * @property {string} price price
     * @property {string} product_id product_id
     * @property {string} appId appId
     * @property {BuyIAPProdCallback} callback 回调
     */
    /**
     * 调用端上支付接口
     * @eapi
     * @since 3.4.0
     * @param {BuyIAPProdParams} params 支付参数
     * @returns {Promise<void>} 返回结果
     */
    buyIAPProductWithParams(params) {
      return extsdk.core.onEvent(MODULE_NAME$t, 'buyIAPProductWithParams', params);
    },

    /**
     * @edata
     * @typedef {Object} SelectedUserInfo 选中的用户信息
     * @property {number} uid 用户uid
     * @property {string} avatarUrl 头像路径
     * @property {string} nick 用户昵称
     */
    /**
     * @edata
     * @typedef {Object} GetSelectedUserRsp 选中的用户信息
     * @property {boolean} [all] 是否选中全部上麦用户
     * @property {SelectedUserInfo} [user] 已选用户信息；all 为 true 时 user 为空
     */
    /**
     * 获取送礼面板选中的要送礼的用户
     * @eapi
     * @since 3.5.1
     * @returns {Promise<GetSelectedUserRsp>} 调用结果
     */
    getGiftPanelSelectedUser() {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getGiftPanelSelectedUser');
    },

    /**
     * @edata
     * @typedef {Object} SetGiftPanelUserReq 要选中的用户信息
     * @property {number} [uid] 用户uid，all 为 true 时 uid 不传
     * @property {boolean} [all] 全部上麦用户
     */
    /**
     * 设置送礼面板中要送礼的用户
     * @summary 只能设置hyExt.advance.getJoinMicUserList获取到的用户
     * @eapi
     * @since 3.5.1
     * @param {SetGiftPanelUserReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    setGiftPanelSelectedUser(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'setGiftPanelSelectedUser', params);
    },

    /**
     * @edata
     * @callback GiftPanelUserChange 选中用户改变回调
     * @param {GetSelectedUserRsp} info 用户信息 
     */
    /**
     * @edata
     * @typedef {Object} OnGiftPanelUserChangeReq 监听送礼面板选中的用户改变参数
     * @property {GiftPanelUserChange} callback 选中用户改变回调
     */
    /**
     * 监听送礼面板选中的要送礼的用户信息改变
     * @eapi
     * @since 3.5.1
     * @param {OnGiftPanelUserChangeReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    onGiftPanelSelectedUserChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$t, 'onGiftPanelSelectedUserChange', params);
    },

    /**
     * 取消监听送礼面板选中的要送礼的用户信息改变
     * @eapi
     * @since 3.5.1
     * @returns {Promise<void>} 调用结果
     */
    offGiftPanelSelectedUserChange() {
      return extsdk.core.offEvent(MODULE_NAME$t, 'offGiftPanelSelectedUserChange');
    },

    /**
     * @edata
     * @typedef {Object} NavCompLayoutInfo 原生组件布局信息
     * @property {number} top 原生控件相对于浮窗容器上方的偏移量
     * @property {number} left 原生控件相对于浮窗容器左方的偏移量
     * @property {number} width 原生控件相对于浮窗容器的宽度
     * @property {number} height 原生控件相对于浮窗容器的高度
     * @property {any} props 关于这个原生控件的信息，JSON字符串，例如：头像框会带上uid等用户信息
     */
    /**
     * @edata
     * @typedef {Object} GetNavCompOffsetRsp 获取原生组件布局信息
     * @property {Array.<NavCompLayoutInfo>} list 布局信息列表
     */
    /**
     * @edata
     * @typedef {Object} GetNavCompOffsetReq 获取原生组件布局信息参数
     * @property {string} key 原生控件标签, video-视频, linkMicAvatar-连麦用户头像(默认)
     */
    /**
     * 获取原生组件布局信息
     * @summary 仅支持浮窗类型的小程序调用，且浮窗容器是视频区或全屏区；
     * @eapi
     * @since 3.5.1
     * @param {GetNavCompOffsetReq} params 输入参数
     * @returns {Promise<GetNavCompOffsetRsp>} 调用结果
     */
    getNativeCompOffset(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'getNativeCompOffset', params);
    },

    /**
     * @edata
     * @typedef {Object} NavCompOffsetChangeInfo 原生组件布局信息
     * @property {Array.<NavCompLayoutInfo>} list 布局信息列表
     * @property {string} key 原生控件标签, video-视频, linkMicAvatar-连麦用户头像(默认)
     */
    /**
     * @edata
     * @callback NavCompOffsetChange 布局变化回调
     * @param {NavCompOffsetChangeInfo} info 布局信息
     */
    /**
     * @edata
     * @typedef {Object} OnNavCompOffsetChangeReq 监听原生组件布局信息变化参数
     * @property {string} key 原生控件标签, video-视频, linkMicAvatar-连麦用户头像(默认)
     * @property {NavCompOffsetChange} callback 布局变化回调
     */
    /**
     * 监听原生组件布局信息变化
     * @eapi
     * @since 3.5.1
     * @param {OnNavCompOffsetChangeReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    onNativeCompOffsetChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$t, 'onNativeCompOffsetChange', params);
    },

    /**
     * @edata
     * @typedef {Object} OffNavCompOffsetChangeReq 取消监听原生组件布局信息变化参数
     * @property {string} key 原生控件标签, video-视频, linkMicAvatar-连麦用户头像(默认)
     */
    /**
     * 取消监听原生组件布局信息变化
     * @eapi
     * @since 3.5.1
     * @param {OffNavCompOffsetChangeReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    offNativeCompOffsetChange(params) {
      return extsdk.core.offEvent(MODULE_NAME$t, 'offNativeCompOffsetChange', params);
    },

    /**
     * @edata
     * @typedef {Object} AddGidToOftenUsedReq 添加常用品类参数
     * @property {number} gid 品类id
     */
    /**
     * 把某个品类添加到常用品类
     * @eapi
     * @since 3.6.0
     * @param {AddGidToOftenUsedReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    addGidToOftenUsed(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'addGidToOftenUsed', params);
    },

    /**
     * 退出登陆，清理登陆信息，包括匿名登陆信息
     * @eapi
     * @since 3.8.0
     * @returns {Promise<void>} 调用结果
     */
    logout() {
      return extsdk.core.callEvent(MODULE_NAME$t, 'logout');
    },

    /**
     * @edata
     * @typedef {Object} OffWupMessageReq 监听信息传参
     * @property {string} uri 监听uri
     * @property {boolean} [useDirectStrategy] 使用直连策略
     */
    /**
     * 取消监听taf信令
     * @eapi
     * @since 3.8.0
     * @param {OffWupMessageReq} params 监听信息
     * @returns {Promise<void>} 监听结果
     */
    offWupMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$t, 'offWupMessage', params);
    },
  }
};

var HYExtApp = {
  /**
   * app模块
   * @namespace app
   */
  app: {
    /**
     * 禁止native 容器手势
     * @eapi
     * @param {boolean} disable 是否禁止native容器手势
     * @returns {Promise<void>} 
     */
    disableContainerGesture(disable) {
      return extsdk.core.callEvent('ContainerGesture', 'disableContainerGesture', disable);
    }
  }
};

/** @ignore */
const MODULE_NAME$s = 'HYExtAppState';

var HYExtAppState = {
  /**
   * 监听加载完成
   * @eapi <directly>
   * @param {Function} callback 回调函数
   * @returns {void} 调用结果
   */
  onLoad(callback) {
    return extsdk.core.callEventSync(MODULE_NAME$s, 'onLoad', callback);
  },

  /**
   * 监听取消加载
   * @eapi <directly>
   * @param {Function} callback 
   * @returns {void} 调用结果
   */
  onUnload(callback) {
    return extsdk.core.callEventSync(MODULE_NAME$s, 'onUnload', callback);
  },

  /**
   * 注册App进入前台时回调
   * @summary WEB切换到当前标签页或者小程序显示都会触发
   * - APP/助手唤醒至前台时触发
   * @eapi <directly>
   * @param {Function} callback 
   * @returns {void} 调用结果
   */
  onEnterForeground(callback) {
    return extsdk.core.callEventSync(MODULE_NAME$s, 'onEnterForeground', callback);
  },

  /**
   * 注册App进入后台时回调
   * @summary WEB切换到别的标签页或者小程序隐藏都会触发
   * - APP/助手从前台退出时触发
   * @eapi <directly>
   * @param {Function} callback 
   * @returns {void} 调用结果
   */
  onLeaveForeground(callback) {
    return extsdk.core.callEventSync(MODULE_NAME$s, 'onLeaveForeground', callback);
  },

  /**
   * 生命周期消息回调
   * @edata
   * @callback LifeCallback 消息回调
   */
  /**
   * 小程序显示的生命周期
   * @summary 小程序显示的时候触发
   * - 2.15.0 开始支持全局小程序
   * @eapi <directly>
   * @param {LifeCallback} callback 
   * @returns {void} 调用结果
   */
  onAppear(callback) {
    return extsdk.core.callEventSync(MODULE_NAME$s, 'onAppear', callback);
  },

  /**
   * 小程序隐藏的生命周期
   * @summary 小程序隐藏的时候触发
   * - 2.15.0 开始支持全局小程序
   * @eapi <directly>
   * @param {LifeCallback} callback 
   * @returns {void} 调用结果
   */
  onDisappear(callback) {
    return extsdk.core.callEventSync(MODULE_NAME$s, 'onDisappear', callback);
  },
};

/** @ignore */
const MODULE_NAME$r = "HYExtBackend";

var HYExtBackend = {
  /**
   * 后台模块
   * @namespace backend
   */
  backend: {
    /**
     * @edata
     * @typedef {Object} SearchOptions
     * @property {string} key 关键字 getServerTime-获取服务器时间戳, getPKInfo-获取主播PK信息
     * @property {Object} [param] 参数
     */
    /**
     * @edata
     * @typedef {Object} GetServerTimeRsp
     * @property {number} startTime 开始的时间戳
     */

    /**
     * @edata
     * @typedef {Object} MemberInfo
     * @property {string} nickName 成员昵称
     * @property {string} avatarUrl 成员头像
     * @property {string} scorce 成员分数
     * @property {string} unionId 成员分数
     * @property {number} roomId 成员分数
     */

    /**
     * @edata
     * @typedef {Object} TeamInfo
     * @property {string} teamName 队伍名称
     * @property {number} teamScore 队伍分数
     * @property {number} scoreLevel 分数等级
     * @property {Array.<MemberInfo>} memberInfos 成员信息
     */

    /**
     * @edata
     * @typedef {Object} GetPKInfoRsp
     * @property {boolean} onPk 是否正在PK
     * @property {TeamInfo} leftTeam 发起队伍
     * @property {TeamInfo} rightTeam 接受队伍（数据结构同发起队伍）
     * @property {number} pkStatus PK状态, 0-不处于PK模式, 1-开启PK模式, 2-开启PK准备, 3-某局PK进行中, 4-某局PK结束中, 5-三局两胜结束
     * @property {number} pkResult PK结果, 0-平局, 1-左边赢, 2-右边赢
     * @property {number} remainSeconds 剩余秒数
     * @property {number} pkModeType 模式, 0-礼物模式, 1-礼物+人气模式, 2-匹配模式
     * @property {Array.<number>} pkResults 3局2胜每小局的结果, 0-平局, 1-左边赢, -1-右边赢
     */
    /**
     * @edata
     * @typedef {GetServerTimeRsp|GetPKInfoRsp|Object} CommonQueryResp 返回结果
     */
    /**
     * 通用查询后台状态接口
     * @eapi
     * @param {SearchOptions} params 参数
     * @returns {Promise<CommonQueryResp>} // key传入getServerTime参数时，返回GetServerTimeRsp，传入getPKInfo参数时, 返回GetPKInfoRsp
     */
    commonQuery(params) {
      return extsdk.core.callEvent(MODULE_NAME$r, "commonQuery", params);
    },

    /**
     * @edata
     * @typedef {Enum} ControlPanelExtTypes
     * @param {string} web_popup 虎牙主站-浮窗
     * @param {string} app_popup 虎牙直播APP-浮窗
     * @param {string} zs_anchor_popup 虎牙助手-浮窗
     * @param {string} pc_popup PC观众端浮窗
     * @param {string} web_video_com  虎牙主站-面板
     * @param {string} app_panel 虎牙直播APP-面板
     * @param {string} pc_panel PC观众端面板
     */

    /**
     * @edata
     * @typedef {Enum} ControlPanelLoadExtTypes
     * @param {string} web_popup 虎牙主站-浮窗
     * @param {string} app_popup 虎牙直播APP-浮窗
     * @param {string} zs_anchor_popup 虎牙助手-浮窗
     * @param {string} pc_popup PC观众端浮窗
     *
     */

    /**
     * @edata
     * @typedef {Enum} ControlEntranceExtTypes
     * @param {string} web_video_com 虎牙主站-面板
     * @param {string} app_panel 虎牙直播APP-面板
     * @param {string} pc_panel PC观众端面板
     */

    /**
     * @edata
     * @typedef {Object} ControlReq
     * @property {ControlEntranceExtTypes|ControlPanelLoadExtTypes|ControlPanelExtTypes} extTypes 观众端小程序类型枚举（逗号分隔），一共有3种枚举，每种枚举都与key对应。
     * @property {boolean} visible 是否显示
     */

    /**
     * @edata
     * @typedef {Object} ControlRsp
     * @property {number} status 状态码, 0为成功
     * @property {string} msg 描述
     */

    /**
     * @edata
     * @inner
     * @typedef {Object} SendMessageReqByRoomId
     * @property {string} message 发言内容，默认长度30个字符，过长会自动截断
     * @property {number} roomId 直播间ID
     */

    /**
     * @edata
     * @inner
     * @typedef {Object} SendMessageReq
     * @property {string} message 发言内容，默认长度30个字符，过长会自动截断
     */

    /**
     * @edata
     * @inner
     * @typedef {Enum} SendMessageErrorEnum
     * @param {number} number2  发送失败/权限问题/频率超出
     * @param {number} number17 贵族表情拦截
     * @param {number} number107 直播间封禁弹幕或者高危敏感词
     * @param {number} number905 未绑定手机号
     */

    /**
     * @edata
     * @inner
     * @typedef {Object} SendMessageRsp
     * @property {string} message 错误提示
     * @property {SendMessageErrorEnum} res 状态码
     */

    /**
     * @edata
     * @typedef {Enum} ControOperateKey
     * @param {string} controlEntrance  主播端控制观众端小程序入口
     * @param {string} controlPanelLoad 主播端控制观众端小程序面板加载
     * @param {string} controlPanelShow 主播端控制观众端小程序面板展示
     */

    /**
     * @edata
     * @typedef {Object} ControOperateOptions
     * @property {ControOperateKey} key 关键字
     * @property {ControlReq} param 参数,
     */

    /**
     * @edata
     * @inner
     * @typedef {Enum} SendMessageOperateKey
     * @param {string} sendUserMessage 当前直播间发言接口
     * @param {string} sendRoomMessage 指定直播间发言接口
     */

    /**
     * @edata
     * @inner
     * @typedef {Object} SendMessageOperateOptions
     * @property {SendMessageOperateKey} key 关键字
     * @property {SendMessageReq|SendMessageReqByRoomId} param 参数,
     */
    /**
     * @edata
     * @typedef {Object} DiyOptions 参数
     * @property {string} key 关键字
     * @property {Object} [param] 参数
     */
    /**
     * 操作选项
     * @edata
     * @inner
     * @typedef {ControOperateOptions|SendMessageOperateOptions|DiyOptions} CommonOperateParams
     */
    /**
     * @edata
     * @inner
     * @typedef {ControlRsp|SendMessageRsp|any} CommonOperateResp 返回结果
     */
    /**
     * 通用上行接口
     * @summary 端上直接请求服务器
     * @eapi
     * @param {DiyOptions} params 操作选项
     * @returns {Promise<CommonOperateResp>} 返回结果
     */
    commonOperate(params) {
      return extsdk.core.callEvent(MODULE_NAME$r, "commonOperate", params);
    },
  },
};

/** @ignore */
const MODULE_NAME$q = 'HYExtConsts';

var HYExtConsts = {

  /**
   * @edata
   * @typedef {Object} Consts
   * @property {number} screenWidth 屏幕宽度
   * @property {number} screenHeight 屏幕高度
   * @property {boolean} isLandscape 屏幕是否是横屏高度
   */
  /**
   * @type {Consts} consts
   */
  consts: extsdk.core.callEventSync(MODULE_NAME$q, 'getInstance')

};

/** @ignore */
const MODULE_NAME$p = 'HYExtDC';

var HYExtDC = {

  /**
   * 下载中心
   * @namespace dc
   */
  dc: {
    /**
     * @edata
     * @typedef {number} DownLoadStatus 下载状态，取值说明:
     * 0 STATUS_NOT_DOWNLOAD;
     * 1 STATUS_CONNECTING;
     * 2 STATUS_DOWNLOADING;
     * 3 STATUS_PAUSED;
     * 4 STATUS_DOWNLOAD_ERROR;
     * 5 STATUS_COMPLETE;
     * 6 STATUS_INSTALLED;
     * 7 STATUS_APPOINTED_DONE;
     * 8 STATUS_APPOINTED_NOT_YET;
     */
    /**
     * @edata 
     * @typedef {Object} StartDownLoadReq 开始下载参数
     * @property {string} package package 
     * @property {string} name name
     * @property {string} url url
     * @property {string} extra extra
     * @property {number} gameId gameId 
     * @property {number} downLoadAppId downLoadAppId 
     * @property {number} gameBaseId gameBaseId 
     * @property {boolean} continueDownload continueDownload
     * @property {number} downloadStatus downloadStatus 
     * @property {string} gameIcon gameIcon 
     * @property {number} versionCode versionCode 
     * @property {string} actid actid 
     * @property {string} anchoruid anchoruid 
     * @property {string} webId webId 
     * @property {string} fileMd5 fileMd5 
     */
    /**
     * 开始下载
     * @eapi
     * @since 2.16.0
     * @param {StartDownLoadReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    startDownload(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'startDownload', params);
    },

    /**
     * @edata 
     * @typedef {Object} PauseDownloadReq 暂停下载参数
     * @property {boolean} pauseAll pauseAll
     * @property {string} tag tag
     * @property {string} name name
     * @property {string} package package
     * @property {number} gameId gameId 
     * @property {number} downLoadAppId downLoadAppId 
     * @property {number} gameBaseId gameBaseId 
     * @property {string} gameIcon gameIcon 
     */
    /**
     * 暂停下载
     * @eapi
     * @since 2.16.0
     * @param {PauseDownloadReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     **/
    pauseDownload(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'pauseDownload', params);
    },

    /**
     * @edata 
     * @typedef {Object} CancelDownloadReq 取消下载参数
     * @property {boolean} cancelAll cancelAll
     * @property {string} tag tag 
     * @property {string} package package
     * @property {number} gameId gameId 
     * @property {number} downLoadAppId downLoadAppId 
     * @property {number} gameBaseId gameBaseId 
     */
    /**
     * 取消下载
     * @eapi
     * @since 2.16.0
     * @param {CancelDownloadReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     **/
    cancelDownload(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'cancelDownload', params);
    },

    /**
     * @edata 
     * @typedef {Object} InstallApkReq 安装Apk参数
     * @property {string} package package
     * @property {string} name name
     * @property {number} gameId gameId 
     * @property {number} downLoadAppId downLoadAppId 
     * @property {number} gameBaseId gameBaseId
     * @property {number} versionCode versionCode 
     */
    /**
     * 安装Apk
     * @eapi
     * @since 2.16.0
     * @param {InstallApkReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     **/
    installApk(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'installApk', params);
    },

    /**
     * @edata 
     * @typedef {Object} StartAppReq 启动App参数
     * @property {string} package package
     * @property {number} gameId gameId 
     * @property {number} downLoadAppId downLoadAppId 
     * @property {number} gameBaseId gameBaseId
     */
    /**
     * 启动App
     * @eapi
     * @since 2.16.0
     * @param {StartAppReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     **/
    startApp(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'startApp', params);
    },

    /**
     * @edata 
     * @typedef {Object} DownloadRsp 下载信息
     * @property {string} packageName packageName 
     * @property {string} progress progress 
     * @property {DownLoadStatus} status status 
     * @property {string} total total 
     * @property {string} finished finished 
     * @property {string} url url 
     * @property {string} name name 
     * @property {string} mVersionCode mVersionCode 
     * @property {string} extra extra 
     * @property {number} gameId gameId
     * @property {string} iconUrl iconUrl 
     * @property {string} downloadPerSize downloadPerSize 
     * @property {string} downloadSpeed downloadSpeed 
     */
    /**
     * @edata 
     * @typedef {Object} GetDownloadInfoReq 获取下载信息参数
     * @property {string} package package
     * @property {string} name name
     * @property {string} url url
     * @property {string} fileMd5 fileMd5
     * @property {number} joint joint
     * @property {number} versionCode versionCode 
     * @property {number} gameId gameId 
     * @property {number} downLoadAppId downLoadAppId 
     * @property {number} gameBaseId gameBaseId
     */
    /**
     * 获取下载信息
     * @eapi
     * @since 2.16.0
     * @param {GetDownloadInfoReq} params 输入参数
     * @returns {Promise<DownloadRsp>} 调用结果
     **/
    getDownloadInfo(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'getDownloadInfo', params);
    },

    /**
     * @edata 
     * @typedef {Object} RegisterCallbackInfo 下载监听回调信息
     * @property {string} packageName packageName
     * @property {string} progress progress
     * @property {DownLoadStatus} status status
     * @property {string} total total
     * @property {string} finished finished
     * @property {string} url url
     * @property {string} name name
     * @property {string} mVersionCode mVersionCode
     * @property {string} extra extra
     * @property {number} gameId gameId
     * @property {string} iconUrl iconUrl
     * @property {string} downloadPerSize downloadPerSize
     * @property {string} downloadSpeed downloadSpeed
     */
    /**
     * @edata
     * @callback RegisterCallback 下载监听回调
     * @param {RegisterCallbackInfo} info 回调参数
     */
    /**
     * @edata 
     * @typedef {Object} RegisterListenerReq 添加对下载的监听参数
     * @property {RegisterCallback} callback 回调
     */
    /**
     * 添加对下载的监听
     * @eapi
     * @since 2.16.0
     * @param {RegisterListenerReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     **/
    registerListener(params) {
      return extsdk.core.onEvent(MODULE_NAME$p, 'registerListener', params);
    },

    /**
     * @edata 
     * @typedef {Object} UnregisterListenerReq 移除对下载的监听参数
     * @property {RegisterCallback} [callback] 回调
     */
    /**
     * 移除对下载的监听
     * @eapi
     * @since 2.16.0
     * @param {UnregisterListenerReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     **/
    unregisterListener(params) {
      return extsdk.core.offEvent(MODULE_NAME$p, 'unregisterListener', params);
    },

    /**
     * 打开游戏预约弹窗参数
     * @edata 
     * @typedef {Object} ReserveGameReq
     * @property {number} gameCenterId gameCenterId
     * @property {number} gameBaseId gameBaseId
     * @property {number} downLoadAppId downLoadAppId 
     * @property {string} gameName gameName
     * @property {string} fromId fromId
     */
    /**
     * 打开游戏预约弹窗结果
     * @edata 
     * @typedef {Object} ReserveGameRsp
     * @property {number} isReserve 是否预约上; 0-未预约 1-预约成功
     */
    /**
     * 打开游戏预约弹窗
     * @eapi
     * @since 3.10.1
     * @param {ReserveGameReq} params 参数
     * @returns {Promise<ReserveGameRsp>} 调用结果
     **/
    reserveGame(params) {
      return extsdk.core.callEvent(MODULE_NAME$p, 'reserveGame', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$o = 'HYExtDevice';

var HYExtDevice = {
  /**
   * 设备相关
   * @namespace device
   */
  device: {
    /**
     * @edata
     * @typedef {Object} CameraResolutionInfo
     * @property {number} width 宽度（单位是像素）
     * @property {number} height 高度（单位是像素）
     */
    /**
     * 获取设备摄像头分辨率
     * @eapi
     * @returns {Promise<CameraResolutionInfo>}
     */
    getCameraResolution() {
      return extsdk.core.callEvent(MODULE_NAME$o, 'getCameraResolution');
    },

    /**
     * 开始录制音频
     * @eapi
     * @returns {Promise<void>}
     */
    startAudioRecording() {
      return extsdk.core.callEvent(MODULE_NAME$o, 'startAudioRecording');
    },

    /**
     * @edata
     * @typedef {Object} RecordInfo
     * @property {string} url 录音的地址
     */
    /**
     * 结束录制音频
     * @eapi
     * @returns {Promise<RecordInfo>}
     */
    finishAudioRecording() {
      return extsdk.core.callEvent(MODULE_NAME$o, 'finishAudioRecording');
    },

    /**
     * @edata
     * @typedef {Object} SetOrientationOptions
     * @property {string} orientation 方向, portrait-竖屏(默认), landscape-横屏
     */
    /**
     * 设置横竖屏
     * @eapi
     * @param {SetOrientationOptions} params  输入参数
     * @returns {Promise<void>}
     */
    setOrientation(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'setOrientation', params);
    },

    /**
     * @edata
     * @typedef {Object} DeviceInfo
     * @property {boolean} isCameraOn 主播是否打开摄像头
     * @property {boolean} isMicOn 主播是否打开麦克风
     * @property {boolean} isSpeakerOn 主播是否打开扬声器
     * @property {boolean} isKalaokOn 主播是否打开伴奏
     */
    /**
     * 获取当前直播间的设备状态
     * @eapi
     * @returns {Promise<DeviceInfo>}
     */
    getDeviceInfo() {
      return extsdk.core.callEvent(MODULE_NAME$o, 'getDeviceInfo');
    },

    /**
     * webview信息
     * @edata
     * @typedef {Object} WebViewInfo
     * @property {string} webViewId webWiewId
     */
    /**
     * webview的布局信息
     * @edata
     * @typedef {Object} WebViewLayoutInfo
     * @property {number} [x] WebView 距离左侧距离，单位像素
     * @property {number} [y] WebView 距离顶部距离，单位像素
     * @property {number} width WebView宽度，单位像素
     * @property {number} height WebView高度，单位像素
     */
    /**
     * 关闭按钮布局信息
     * @edata
     * @typedef {Object} CloseBtnInfo
     * @property {string} url 按钮图链接
     * @property {number} x 按钮距Webview左侧距离，单位像素
     * @property {number} y 按钮距Webview顶部距离，单位像素
     * @property {number} width 按钮宽度，单位像素
     * @property {number} height 按钮高度，单位像素
     */
    /**
     * @edata
     * @typedef {Object} OpenWebViewParams
     * @property {string} url 要打开webview的地址，如果要传入初始化参数请以查询串的方式带在url后面
     * @property {WebViewLayoutInfo} layout webview基于容器的布局，单位是像素
     * @property {CloseBtnInfo} [closeBtn] 关闭按钮的图片和基于webview的布局，单位是像素
     */
    /**
     * 在设备中打开一个webview
     * @eapi
     * @since 2.9.0
     * @param {OpenWebViewParams} params 打开webview的参数
     * @returns {Promise<WebViewInfo>}
     */
    openWebView(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'openWebView', params);
    },

    /**
     * @edata
     * @typedef {Object} WebViewParams
     * @property {string} webviewId webviewId 
     */
    /**
     * 关闭webview
     * @eapi
     * @since 2.9.8
     * @param {WebViewParams} params 关闭webview参数
     * @returns {Promise<void>} 调用结果
     */
    closeWebView(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'closeWebView', params);
    },

    /**
     * webview的布局信息
     * @edata
     * @typedef {Object} WebViewLayoutParam
     * @property {string} webviewId webviewId 
     * @property {number} x WebView 距离左侧距离，单位像素
     * @property {number} y WebView 距离顶部距离，单位像素
     * @property {number} width WebView宽度，单位像素
     * @property {number} height WebView高度，单位像素
     */
    /**
     * 设置webview的布局
     * @eapi
     * @since 2.9.0
     * @param {WebViewLayoutParam} params webview基于容器的布局信息
     * @returns {Promise<void>}
     */
    setWebViewLayout(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'setWebViewLayout', params);
    },

    /**
     * @edata
     * @typedef {Object} PostBroadcastMessageParam
     * @property {string} eventName 消息名
     * @property {string} message 消息内容
     */
    /**
     * 发送本地 webview 广播消息
     * @eapi
     * @since 2.9.0
     * @param {PostBroadcastMessageParam} params 消息参数
     * @returns {Promise<void>}
     */
    postBroadcastMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'postBroadcastMessage', params);
    },

    /**
     * @edata
     * @typedef {Object} LayoutChangeInfo
     * @property {number} containerWidth webview容器宽度
     * @property {number} containerHeight webview容器高度
     * @property {boolean} isLandscape 是否横屏，web端固定为true
     */
    /**
     * @edata
     * webview容器宽高变化的回调
     * @callback WebViewContainerLayoutChangeCallback
     * @param {LayoutChangeInfo} info webview容器宽高消息
     */
    /**
     * 监听webview容器宽高变化的消息
     * @summary 调用这个接口的同时会触发一次回调，返回当前的webview容器宽高信息
     * @eapi
     * @since 2.9.0
     * @eapi
     * @param {WebViewContainerLayoutChangeCallback} callback webview容器宽高变化的回调
     * @returns {Promise<void>}
     */
    onWebViewContainerLayoutChange(callback) {
      return extsdk.core.onEvent(MODULE_NAME$o, 'onWebViewContainerLayoutChange', callback);
    },

    /**
     * 本地小程序消息
     * @edata
     * @callback BroadcastMessageCallback
     * @param {string} message 消息内容
     */
    /**
     * 监听参数
     * @edata
     * @typedef {Object} OnBroadcastMessageParams
     * @property {string} eventName 消息名
     * @property {BroadcastMessageCallback} callback 消息回调
     */
    /**
     * 监听本地 webview 广播消息
     * @eapi
     * @since 2.9.0
     * @param {OnBroadcastMessageParams} params 监听参数
     * @returns {Promise<void>}
     */
    onBroadcastMessage(params) {
      return extsdk.core.onEvent(MODULE_NAME$o, 'onBroadcastMessage', params);
    },

    /**
     * @edata
     * @typedef {Object} OffBroadcastMessageParams
     * @property {string} eventName 消息名
     */
    /**
     * 取消监听本地 webview 广播消息
     * @eapi
     * @since 2.9.0
     * @param {OffBroadcastMessageParams} params 取消监听参数
     * @returns {Promise<void>}
     */
    offBroadcastMessage(params) {
      return extsdk.core.offEvent(MODULE_NAME$o, 'offBroadcastMessage', params);
    },

    /**
     * 返回服务信息
     * @edata 
     * @typedef {Object} LocalServerInfo
     * @property {string} serverId 本地服务标识
     * @property {string} root 根路径
     */
    /**
     * @edata 
     * @typedef {Object} LocalServerParams
     * @property {string} path 指定启动的本地服务的root
     */
    /**
     * 打开本地server
     * @eapi
     * @since 2.9.8
     * @param {LocalServerParams} params 打开本地server参数
     * @returns {Promise<LocalServerInfo>} 返回服务信息
     */
    startLocalServer(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'startLocalServer', params);
    },

    /**
     * @edata 
     * @typedef {Object} StopLocalServerParams
     * @property {string} serverId 指定要关闭的serverId
     */
    /**
     * 关闭本地server
     * @eapi
     * @since 2.9.8
     * @param {StopLocalServerParams} params 关闭本地server参数
     * @returns {Promise<void>}
     */
    stopLocalServer(params) {
      return extsdk.core.callEvent(MODULE_NAME$o, 'stopLocalServer', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$n = 'HYExtEBS';

var HYExtEBS = {
  /**
   * 逐步废弃
   * @param {*} options 
   */
  requestEbs(options) {
    return extsdk.core.callEvent(MODULE_NAME$n, 'requestEbs', options);
  }
};

/** @ignore */
const MODULE_ENV$1 = 'HYExtEnv';

var HYExtEnv = {
  /**
   * 环境相关
   * @namespace env
   */
  env: {
    /**
    * @edata
    * @typedef {Enum} ExtVersionType
    * @param {number} number1 开发版本
    * @param {number} number2 灰度版本
    * @param {number} number3 正式版本
    */
    /**
     * @edata
     * @typedef {Object} GetVersionTypeRsp
     * @property {ExtVersionType} versionType 版本类型
     */
    /**
     * 获取当前版本类型
     * @eapi
     * @returns {Promise<GetVersionTypeRsp>} 返回当前版本类型
     */
    getVersionType() {
      return extsdk.core.callEvent(MODULE_ENV$1, 'getVersionType');
    },

    /**
     * 获取初始化参数
     * @eapi
     * @returns {Promise<Object>} 初始化参数
     */
    getInitialParam() {
      return extsdk.core.callEvent(MODULE_ENV$1, 'getInitialParam');
    },
    /**
     * @edata
     * @typedef {Object} GetExtInfoRsp
     * @property {string} extUuid 小程序id
     * @property {string} extName 小程序名字
     * @property {string} extVersion 小程序版本
     * @property {ExtVersionType} extVersionType 版本类型枚举
     * @property {string} extType 小程序类型
     */
    /**
     * 获取小程序参数
     * @eapi
     * @returns {Promise<GetExtInfoRsp>} 小程序参数
     */
    getExtInfo() {
      return extsdk.core.callEvent(MODULE_ENV$1, 'getExtInfo');
    },
    /**
    * @edata
    * @typedef {Enum} Host
    * @param {string} huya_web 虎牙直播WEB主站
    * @param {string} huya_app_ios 虎牙直播APP(iOS)
    * @param {string} huya_app_adr 虎牙直播APP(安卓)
    * @param {string} huya_pc_viewer 虎牙直播PC观众端
    * @param {string} huya_pc_anchor 虎牙直播PC主播端
    * @param {string} huya_zs_ios 虎牙直播助手(iOS)
    * @param {string} huya_zs_adr 虎牙直播助手(安卓)
    */
    /**
    * @edata
    * @typedef {Enum} Platform
    * @param {string} web 浏览器
    * @param {string} ios IOS
    * @param {string} adr 安卓
    * @param {string} pc PC客户端
    */
    /**
     * 宿主信息
     * @edata
     * @typedef {Object} GetHostInfoRsp
     * @property {Host} name 宿主名称
     * @property {Platform} platform 平台
     * @property {string} version 宿主版本
     * @property {string} baseVersion 基础包版本
     */
    /**
     * 获取宿主信息接口
     * @summary 使用querystring解析rn bundle的查询串参数，返回给小程序
     * @eapi
     * @returns {Promise<GetHostInfoRsp>} 返回宿主信息
     */
    getHostInfo() {
      return extsdk.core.callEvent(MODULE_ENV$1, 'getHostInfo');
    },

    /**
     * @edata
     * @typedef {Object} PerformaceInfo 性能数据
     * @property {string} [session_id] 会话id
     * @property {number} [enter] 进入直播间
     * @property {number} [fetch_list_start] 获取小程序列表开始
     * @property {number} [fetch_list_succ] 获取小程序列表成功
     * @property {number} [fetch_list_fail] 获取小程序列表失败
     * @property {number} [show_entrance_succ] 入口显示成功
     * @property {number} [show_entrance_fail] 入口显示失败
     * @property {number} [show_entrance_channel_succ] 互动通道显示成功
     * @property {number} [show_entrance_channel_fail] 互动通道显示失败
     * @property {number} [exec_start] 触发启动小程序开始
     * @property {number} [exec_succ] 触发启动小程序成功
     * @property {number} [exec_fail] 触发启动小程序失败
     * @property {number} [check_auth_start] 验证小程序权限开始
     * @property {number} [check_auth_succ] 验证小程序权限成功
     * @property {number} [check_auth_fail] 验证小程序权限失败
     * @property {number} [install_start] 安装小程序开始
     * @property {number} [install_succ] 安装小程序成功
     * @property {number} [install_fail] 安装小程序失败
     * @property {number} [load_supframe_start] 中间层iframe加载开始
     * @property {number} [load_supframe_succ] 中间层iframe加载成功
     * @property {number} [load_supframe_fail] 中间层iframe加载失败
     * @property {number} [load_busiframe_start] 业务层iframe加载开始
     * @property {number} [load_busiframe_succ] 业务层iframe加载成功
     * @property {number} [load_busiframe_fail] 业务层iframe加载失败
     * @property {number} [create_vc_start] vc创建开始
     * @property {number} [download_base_start] 开始下载base包
     * @property {number} [download_base_end] 完成下载base包
     * @property {number} [download_busi_start] 开始下载busi包
     * @property {number} [download_busi_end] 完成下载busi包
     * @property {number} [load_basebundle_start] baseBundle加载开始
     * @property {number} [load_basebundle_end] baseBundle加载成功
     * @property {number} [load_busibundle_start] 业务Bundle加载开始
     * @property {number} [load_busibundle_end] 业务Bundle加载成功
     * @property {number} [create_bridge_start] bridge创建开始
     * @property {number} [create_rootview_start] rootView创建开始
     * @property {number} [rn_view_appear] RN root View显示
     * @property {number} [bundle_load_type] bundle来源, 0-本地有URL指定的版本, 1-本地没有URL指定的版本，使用本地最新的版本, 2-本地没有URL指定版本，且一直等待下载完成
     * @property {number} [cef_process_start] CEF进程启动开始
     * @property {number} [cef_process_succ] CEF进程启动成功
     * @property {number} [cef_process_fail] CEF进程启动失败
     * @property {number} [cef_loadpage_start] CEF加载页面开始
     * @property {number} [cef_loadpage_succ] CEF加载页面成功
     * @property {number} [cef_loadpage_fail] CEF加载页面失败
     */
    /**
     * @edata
     * @typedef {Object} PerformaceDataRsp 性能数据
     * @property {PerformaceInfo} [data] 性能数据详细
     */
    /**
     * 获取性能数据
     * @eapi
     * @since 3.8.7
     * @returns {Promise<PerformaceDataRsp>} 调用结果
     */
    getPerformaceData() {
      return extsdk.core.callEvent(MODULE_ENV$1, 'getPerformaceData');
    }
  }
};

/** @ignore */
const MODULE_NAME$m = 'HYExtExe';

var HYExtExe = {
  /**
   * EXE加工相关
   * @namespace exe
   */
  exe: {
    /**
     * 初始化Game环境传参
     * @edata
     * @typedef {Object} ExeInitGameEnvReq 初始化Game环境参数
     * @property {string} optParams 预留参数(可选)
     */
    /**
     * 初始化Game环境
     * @eapi
     * @param {ExeInitGameEnvReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    initGameEnv(params) {
      return extsdk.core.callEvent(MODULE_NAME$m, 'initGameEnv', params);
    },
    /**
     * 启动Game传参
     * @edata
     * @typedef {Object} ExeLaunchGameReq 启动Game参数
     * @property {string} [processMode] local/cloud: 本地加工(默认)/云端加工(可选)
     * @property {string} md5 game Exe的压缩包md5(必填)
     * @property {string} exeName game exe的本地文件名字(必填)
     * @property {string} [exeParams] game exe的启动参数(可选)
     * @property {string} [optParams] 预留参数(可选)
     */
    /**
     * 启动Game
     * @eapi
     * @param {ExeLaunchGameReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    launchGame(params) {
      return extsdk.core.callEvent(MODULE_NAME$m, 'launchGame', params);
    },
    /**
     * 停止Game
     * @eapi
     * @returns {Promise<void>} 返回操作结果
     */
    shutdownGame() {
      return extsdk.core.callEvent(MODULE_NAME$m, 'shutdownGame');
    },
    /**
     * 发送消息至Game传参
     * @edata
     * @typedef {Object} ExeSendToGameReq 发送消息至Game参数
     * @property {string} message 消息内容
     */
    /**
     * 发送消息至Game
     * @eapi
     * @param {ExeSendToGameReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    sendToGame(params) {
      return extsdk.core.callEvent(MODULE_NAME$m, 'sendToGame', params);
    },
    /**
     * 回调消息
     * @edata
     * @typedef {Object} ExeOnGameMessageCallbackParams 回调消息
     * @property {string} name 消息名称
     * @property {string} message 消息内容
     */
    /**
     * 监听相关消息回调
     * @edata
     * @callback ExeOnGameMessageCallback 监听相关消息回调 
     * @param {ExeOnGameMessageCallbackParams} params 回调消息
     */
    /**
     * 监听消息信息传参
     * @edata
     * @typedef {Object} ExeOnGameMessageReq 监听消息信息参数
     * @property {ExeOnGameMessageCallback} callback 监听相关消息回调
     */
    /**
     * 监听消息信息
     * @eapi
     * @param {ExeOnGameMessageReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    onGameMessage(params) {
      return extsdk.core.onEvent(MODULE_NAME$m, 'onGameMessage', params);
    },
    /**
     * 取消监听消息信息
     * @eapi
     * @returns {Promise<void>} 返回操作结果
     */
    offGameMessage() {
      return extsdk.core.offEvent(MODULE_NAME$m, 'offGameMessage');
    },
  }
};

/** @ignore */
const MODULE_ENV = 'HYExtFeedback';

var HYExtFeedback = {
  /**
   * 反馈相关
   * @namespace feedback
   */
  feedback: {
    /**
     * 上报grafana参数
     * @edata
     * @typedef {Object} ReportMetricReq
     * @property {string} namespace namespace
     * @property {string} metricName metricName
     * @property {Object} dimensions dimensions
     * @property {Object} fields fields
     */
    /**
     * 上报数据到grafana
     * @eapi
     * @param {ReportMetricReq} params 请求参数
     * @returns {Promise<void>} 返回结果
     */
    reportMetric(params) {
      return extsdk.core.callEvent(MODULE_ENV, 'reportMetric', params);
    },

    /**
     * @edata
     * @typedef {Object} FeedbackParams
     * @property {string} type 问题分类 
     * @property {string} content 描述
     * @property {string} param 额外参数
     */
    /**
     * 打开反馈表单
     * @eapi
     * @since 2.12.1
     * @param {FeedbackParams} params 请求参数
     * @returns {Promise<void>} 返回结果
     */
    openFeedbackForm(params) {
      return extsdk.core.callEvent(MODULE_ENV, 'openFeedbackForm', params);
    }
  },
};

/** @ignore */
const MODULE_NAME$l = 'HYExtFs';

var HYExtFs = {
  /**
   * 文件系统
   * @namespace fs
   */
  fs: {
    /**
     * 文件信息
     * @edata
     * @typedef {Object} UrlInfo
     * @property {string} url 文件的地址
     */

    /**
     * 上传图片
     * @summary 调用该接口时弹出系统选择图片的UI，选择图片后自动上传
     * - 上传成功后返回图片地址
     * - 大小限制：6M
     * @eapi
     * @returns {Promise<UrlInfo>} 调用结果
     */
    uploadImg() {
      return extsdk.core.callEvent(MODULE_NAME$l, 'uploadImg');
    },

    /**
     * 离线资源是否下载完成
     * @eapi
     * @param {UrlInfo} params 监听参数
     * @returns {Promise<void>} 调用结果
     */
    offlineFileReady(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'offlineFileReady', params);
    },

    /**
     * 通用上传文件接口
     * @summary 调用该接口时弹出系统选择文件的UI，选择图片后自动上传
     * - 上传成功后返回文件的地址
     * @eapi
     * @returns {Promise<UrlInfo>} 调用结果
     */
    uploadFile() {
      return extsdk.core.callEvent(MODULE_NAME$l, 'uploadFile');
    },

    /**
     * 下载资源信息
     * @edata
     * @typedef {Object} BatchRes
     * @property {string} url 要下载的资源url
     * @property {string} md5 资源md5
     * @property {boolean} unzip 自动解压
     * @property {boolean} [offline] 是否离线资源
     * @property {number} [pathType] 枚举, 0-目录1, 1-目录2, 2-目录3
     * @property {string} [sourceName] 资源名，用于当二级目录名
     * @property {string} [encryptUrl]  要下载的加密资源url
     * @property {string} [encryptMd5]  加密资源md5
     */

    /**
     * 批量下载资源
     * @summary 这个接口仅用于创建批量下载资源的任务，resolve并不等于文件下载完毕
     * - 使用 hyExt.context.on('downloadProgress', ({ res, msg, url, md5, bytesLoaded, bytesTotal, path, encryptUrl, encryptMd5 }) => {}) 监听每个任务的下载进度
     * @eapi
     * @param {Array.<BatchRes>} params 下载资源信息
     * @returns {Promise<void>} 调用结果
     */
    downloadBatchRes(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'downloadBatchRes', params);
    },

    /**
     * 要删除的资源信息
     * @edata
     * @typedef {Object} RemoveRes
     * @property {string} md5 资源md5
     * @property {string} [encryptMd5] 加密资源md5
     * @property {boolean} [unzip] 如果是true，则把zip包和解压目录一并删掉；否则只删除zip包
     */
    /**
     * 删除资源
     * @eapi
     * @param {RemoveRes} params 要删除的资源信息
     * @returns {Promise<void>} 调用结果
     */
    removeRes(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'removeRes', params);
    },

    /**
     * 判断结果
     * @edata
     * @typedef {Object} ExistsResp 
     * @property {boolean} isExists 是否存在
     * @property {string} path 如果存在，则返回目标文件的完整路径，否则为空
     */
    /**
     * 判断资源是否存在参数
     * @edata
     * @typedef {Object} ExistsReq
     * @property {string} md5 资源md5
     * @property {string} fileName 文件名
     * @property {boolean} [unzip] 目标文件是否自动解压
     * @property {number} [pathType] 枚举, 0-目录1, 1-目录2, 2-目录3
     * @property {string} [url] 要下载的资源url
     * @property {string} [encryptUrl]  要下载的加密资源url
     * @property {string} [encryptMd5] 加密资源md5
     */
    /**
     * 判断资源是否存在
     * @eapi
     * @param {ExistsReq} params 要判断的资源信息
     * @returns {Promise<ExistsResp>} 查询结果结果
     */
    isResExists(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'isResExists', params);
    },

    /**
     * 增强型上传文件返回
     * @edata
     * @typedef {Object} FileInfo
     * @property {Object} data 上传服务返回的数据
     * @property {number} statusCode 上传服务返回的HTTP状态码
     * @property {Object} header 上传服务返回的Response Header
     */
    /**
     * 增强型上传文件返回
     * @edata
     * @typedef {Object} FileExtraResp
     * @property {FileInfo} info 文件信息
     */
    /**
     * 增强型上传文件参数
     * @edata
     * @typedef {Object} FileExtraParams
     * @property {string} url 指定的上传服务地址
     * @property {string} fileKey 文件在FormData中的键值
     * @property {Object} [params] params自定义参数
     * @property {boolean} compress 是否需要压缩
     */
    /**
     * 增强型上传文件
     * @summary 能指定上传的服务地址，APP/助手仅支持上传图片/视频，打开图片库选择图片/视频
     * @eapi
     * @since 2.9.10
     * @param {FileExtraParams} params 要判断的资源信息
     * @returns {Promise<FileExtraResp>} 查询结果结果
     */
    uploadFileExtra(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'uploadFileExtra', params);
    },

    /**
     * 下载资源信息
     * @edata
     * @typedef {Object} BatchSharedRes
     * @property {string} url 资源url
     * @property {string} md5 资源md5
     * @property {boolean} unzip 是否自动解压
     */
    /**
     * 批量发起下载共享资源
     * @summary 主要指跨小程序共享资源，如礼物特效、贵族特效、活动特效等
     * @eapi
     * @since 2.9.11
     * @param {Array.<BatchSharedRes>} params 下载资源信息
     * @returns {Promise<void>} 调用结果
     */
    downloadBatchSharedRes(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'downloadBatchSharedRes', params);
    },

    /**
     * 判断共享资源是否存在
     * @eapi
     * @since 2.9.11
     * @param {BatchSharedRes} params 要判断的资源信息
     * @returns {Promise<ExistsResp>} 查询结果结果
     */
    isSharedResExists(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'isSharedResExists', params);
    },


    /**
     * 清除资源参数
     * @edata
     * @typedef {Object} CleanResParams
     * @property {Array.<string>} reserveMD5List 要保留的资源md5列表，至少传入一个
     */
    /**
     * 清除下载资源
     * @eapi
     * @since 3.2.0
     * @param {CleanResParams} params 参数
     * @returns {Promise<void>} 结果
     */
    cleanRes(params) {
      return extsdk.core.callEvent(MODULE_NAME$l, 'cleanRes', params);
    },
  }
};

/** @ignore */
const MODULE_NAME$k = 'HYExtGame';

var HYExtGame = {
  /**
   * 游戏相关
   * @namespace game
   */
  game: {
    /**
     * lua实例的布局信息
     * @edata
     * @typedef {Object} LuaOffsetInfo
     * @property {number} x 轴的偏移量，相对于推流分辨率
     * @property {number} y 轴的偏移量，相对于推流分辨率
     * @property {number} width 宽度，相对于推流分辨率
     * @property {number} height 高度，相对于推流分辨率
     * @property {boolean} force 是否强制使用上述的布局信息，默认是否，即按name字段记忆主播对这个lua实例的布局操作，以主播操作后的布局结果为准
     */
    /**
     * 启动游戏传参
     * @edata
     * @typedef {Object} GameStartReq 启动游戏参数
     * @property {string} name lua实例的名称，由业务指定，关联布局信息
     * @property {LuaOffsetInfo} offset lua实例的布局信息
     * @property {string} groupName 图层分组的组名
     * @property {string} md5 md5
     * @property {Object} [params] params自定义参数
     */
    /**
     * Lua实例信息
     * @edata
     * @typedef {Object} LuaGameInfo
     * @property {string} id lua实例的id，由终端生成，用于给lua实例发送命令
     * @property {string} layerId lua图层的id，由终端生成，用于监听图层状态变化
     */
    /**
     * 启动游戏
     * @eapi
     * @param {GameStartReq} params 参数
     * @returns {Promise<LuaGameInfo>} 返回创建结果
     */
    start(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'start', params);
    },

    /**
     * 停止游戏参数
     * @edata
     * @typedef {Object} GameStopReq 
     * @property {string} id lua实例的id，由终端生成
     */
    /**
     * 停止游戏
     * @eapi
     * @param {GameStopReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    stop(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'stop', params);
    },

    /**
     * 发送指令传参
     * @edata
     * @typedef {Object} GamePushCommandReq 发送指令参数
     * @property {string} id lua实例的id，由终端生成
     * @property {string} cmd cmd
     * @property {Object} [params] params
     */
    /**
     * 发送指令
     * @eapi
     * @param {GamePushCommandReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    pushCommand(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'pushCommand', params);
    },

    /**
     * Command消息回调
     * @edata
     * @callback GameOnCommandCallback Command消息回调函数 
     * @param {any} message 回调消息
     */
    /**
     * 监听onCommand消息传参
     * @edata
     * @typedef {Object} GameOnCommandReq 监听onCommand消息参数
     * @property {string} id lua实例的id，由终端生成
     * @property {GameOnCommandCallback} callback callback
     */
    /**
     * 监听onCommand消息
     * @eapi
     * @param {GameOnCommandReq} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    onCommand(params) {
      return extsdk.core.onEvent(MODULE_NAME$k, 'onCommand', params);
    },

    /**
     * 参数
     * @edata 
     * @typedef {Object} EventParams
     * @property {string} eventName 事件名
     * @property {GameOnCommandCallback} callback 回调
     */
    /**
     * 通用事件监听
     * @eapi
     * @since 2.9.0
     * @param {EventParams} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    on(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'on', params);
    },

    /**
     * 通用取消事件监听
     * @eapi
     * @since 2.9.0
     * @param {EventParams} params 参数
     * @returns {Promise<void>} 返回操作结果
     */
    off(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'off', params);
    },

    /**
     * 开始游戏参数
     * @edata 
     * @typedef {Object} StartGameParams
     * @property {string} md5 lua资源包md5
     * @property {boolean} needDetect 是否开启检测
     * @property {number} gameScenes 游戏场景, 1-多人游戏, 2-单人游戏
     * @property {boolean} setMirror 设置镜像
     * @property {any} [params] effect传给lua初始化参数--不同业务定义不同
     */

    /**
     * 开始小游戏（Lua加工）
     * @summary 是一个整体的概念，没有图层的概念，对开发中比较友好，不需要理解渲染图层逻辑。
     * @since 2.12.1
     * @eapi
     * @param {StartGameParams} params 参数
     * @returns {Promise<any>} 返回操作结果
     */
    startGame(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'startGame', params);
    },

    /**
     * 结束游戏参数
     * @edata 
     * @typedef {Object} StopGameParams
     * @property {string} [type] 目前可关闭的类型，只支持全部关闭，默认all
     */
    /**
     * 关闭整个游戏
     * @summary 关闭Lua加工，目前设计是全部关闭
     * @since 2.12.1
     * @eapi
     * @param {StopGameParams} params 参数
     * @returns {Promise<any>} 返回操作结果
     */
    stopGame(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'stopGame', params);
    },

    /**
     * Node数据
     * @edata 
     * @typedef {Object} NodeInfo
     * @property {string} id lua实例的id，由终端生成（保证在同一个小程序内唯一），用于给lua发命令
     * @property {string} layerId lua图层的id，由终端生成，用于监听图层状态变化
     */
    /**
     * 布局信息
     * @edata 
     * @typedef {Object} LuaLayoutInfo
     * @property {number} x x方向偏移量
     * @property {number} y y方向偏移量
     * @property {number} width 宽度
     * @property {number} height 高度
     */
    /**
     * 增加节点参数
     * @edata 
     * @typedef {Object} AddNodeParams
     * @property {string} [name] pc专用，图层名称
     * @property {string} [groupName] pc专用，图层分组的组名，只是对图层列表分组
     * @property {string} md5 资源下载链接的md5
     * @property {LuaLayoutInfo} layoutInfo 布局信息
     * @property {number} nodeFlag 表示节点类型，预留位运算的赋值方式暂时用不上
     * @property {number} zOrder 表示渲染层级
     * @property {number} supportOperate 使用位运算来判断node需要哪些能力
     * @property {Object} nodeInitParams 节点启动参数
     * @property {boolean} reload4SizeChange 分辨率变化是否重启节点
     * @property {Object} [params] 自定义参数
     */
    /**
     * 增加节点
     * @since 2.16.0
     * @eapi
     * @param {AddNodeParams} params 参数
     * @returns {Promise<NodeInfo>} 返回操作结果
     */
    addNode(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'addNode', params);

    },

    /**
     * 删除节点参数
     * @edata 
     * @typedef {Object} RemoveNodeParams
     * @property {string} id lua实例的id
     */
    /**
     * 删除节点
     * @since 2.16.0
     * @eapi
     * @param {RemoveNodeParams} params 参数
     * @returns {Promise<any>} 返回操作结果
     */
    removeNode(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'removeNode', params);

    },

    /**
     * 开始游戏参数
     * @edata 
     * @typedef {Object} BeginParams
     * @property {number} gameScenes 游戏场景, 1-多人游戏, 2-单人游戏
     * @property {boolean} setMirror 设置镜像，一旦设置了端上就不可更改镜像
     * @property {any} [params] 自定义参数
     */
    /**
     * 开始游戏
     * @since 2.16.0
     * @eapi
     * @param {BeginParams} params 参数
     * @returns {Promise<any>} 返回操作结果
     */
    begin(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'begin', params);
    },

    /**
     * 结束游戏
     * @since 2.16.0
     * @eapi
     * @param {any} params 参数
     * @returns {Promise<any>} 返回操作结果
     */
    end(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'end', params);
    },

    /**
     * @edata 
     * @typedef {Object} UpdateNodeParams 实时更新参数
     * @property {string} id lua实例id
     * @property {string} layerId lua图层的id
     * @property {any} nodeInfo 自定义参数
     */
    /**
     * 实时更新
     * @since 3.7.0
     * @eapi
     * @param {UpdateNodeParams} params 输入参数
     * @returns {Promise<any>} 调用结果
     */
    updateNode(params) {
      return extsdk.core.callEvent(MODULE_NAME$k, 'updateNode', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$j = 'HYExtInteract';

var HYExtInteract = {
  /**
   * 互动相关
   * @namespace interact
   */
  interact: {

    /**
     * 自定义连麦消息
     * @edata
     * @typedef {Object} InteractMsg
     * @property {Array.<string>} unionIds 被邀请主播端的unionId列表
     * @property {string} msg 自定义消息数据
     */
    /**
     * 发送自定义连麦消息
     * @eapi
     * @since 2.10.0
     * @param {InteractMsg} params 参数
     * @returns {Promise<void>} 调用结果
     */
    sendInteractMsg(params) {
      return extsdk.core.callEvent(MODULE_NAME$j, 'sendInteractMsg', params);
    },

    /**
     * 模拟消息
     * @edata
     * @typedef {Object} BarrageMsg
     * @property {string} text 消息文案
     */
    /**
     * 本地模拟一条系统消息
     * @eapi
     * @since 2.10.0
     * @param {BarrageMsg} params 参数
     * @returns {Promise<void>} 调用结果
     */
    showBarrageMsg(params) {
      return extsdk.core.callEvent(MODULE_NAME$j, 'showBarrageMsg', params);
    },

    /**
     * 成员信息
     * @edata
     * @typedef {Object} Member
     * @property {string} unionId 用户unionId
     * @property {string} name 用户昵称
     * @property {string} avatarUrl 用户头像
     * @property {number} role 角色, 0-成员, 1-房主
     */
    /**
     * 成员列表
     * @edata
     * @typedef {Object} Members
     * @property {Array.<Member>} members 连麦成员
     */
    /**
     * 获取连麦成员
     * @eapi
     * @since 2.10.0
     * @param {Object} [params] 参数
     * @returns {Promise<Members>} 调用结果
     */
    getInteractGameMember(params) {
      return extsdk.core.callEvent(MODULE_NAME$j, 'getInteractGameMember', params);
    },

    /**
     * 获取正在游戏的成员列表
     * @eapi
     * @since 2.10.0
     * @param {Object} [params] 参数
     * @returns {Promise<Members>} 调用结果
     */
    getInteractGamingMembers(params) {
      return extsdk.core.callEvent(MODULE_NAME$j, 'getInteractGamingMembers', params);
    },


    /**
     * 连麦消息
     * @edata
     * @typedef {Object} CallbackMsg
     * @property {string} gameData 游戏数据JSON字符串
     * @property {number} action 游戏行为, 1-游戏开始, 2-游戏人数变化
     */
    /**
     * @edata
     * @callback InteractCallback 事件回调
     * @param {CallbackMsg} msg 回调消息
     */
    /**
     * 监听互动事件
     * @eapi
     * @since 2.10.0
     * @param {string} eventName 事件名, onInteractData-游戏连麦消息(默认), onInteractGameAction-游戏行为变化
     * @param {InteractCallback} callback 连麦消息回调
     * @returns {Promise<void>} 调用结果
     */
    on(eventName, callback) {
      return extsdk.core.callEvent(MODULE_NAME$j, 'on', { eventName, callback });
    },

    /**
     * 取消监听互动事件
     * @eapi
     * @since 2.10.0
     * @param {string} eventName 事件名, onInteractData-游戏连麦消息(默认), onInteractGameAction-游戏行为变化
     * @param {InteractCallback} [callback] 连麦消息回调
     * @returns {Promise<void>} 调用结果
     */
    off(eventName, callback) {
      return extsdk.core.callEvent(MODULE_NAME$j, 'off', { eventName, callback });
    },
  }
};

/** @ignore */
const MODULE_NAME$i = 'HYExtLeaf';

var HYExtLeaf = {
  /**
   * 云端Leaf加工
   * @namespace leaf
   */
  leaf: {

    /**
     * Leaf开始信息
     * @edata
     * @typedef {Object} LeafStartRsp
     * @property {string} jobKey 作业唯一key
     * @property {number} ret 业务返回码
     * @property {string} msg 错误码辅助信息
     * @property {number} jobVersion 作业的版本号更新的时候需要传入
     */
    /**
     * Leaf启动参数
     * @edata
     * @typedef {Object} LeafStartParams
     * @property {string} buziCode 业务Id
     * @property {boolean} needHeartbeat 是否需要心跳保活
     * @property {Object} [params] 该业务ID自定义参数  
     */
    /**
     * 启动Leaf
     * @eapi
     * @since 2.10.0
     * @param {LeafStartParams} params 参数
     * @returns {Promise<LeafStartRsp>} 调用结果
     */
    start(params) {
      return extsdk.core.callEvent(MODULE_NAME$i, 'start', params);
    },

    /**
     * Leaf 操作结果
     * @edata
     * @typedef {Object} LeafActionRsp
     * @property {number} ret 业务返回码
     * @property {string} msg 错误码辅助信息
     */

    /**
     * Leaf 关闭参数
     * @edata
     * @typedef {Object} LeafStopParams
     * @property {string} jobKey 作业唯一key
     */
    /**
     * 关闭Leaf
     * @eapi
     * @since 2.10.0
     * @param {LeafStopParams} params 关闭参数
     * @returns {Promise<LeafActionRsp>} 调用结果
     */
    stop(params) {
      return extsdk.core.callEvent(MODULE_NAME$i, 'stop', params);
    },

    /**
     * 任务信息
     * @edata
     * @typedef {Object} JobMessage
     * @property {string} jobKey 作业唯一key
     * @property {string} buziCode 业务Id
     * @property {string} message 这个就是数据，一般是json字符串
     */
    /**
     * 给Leaf发送数据
     * @eapi
     * @since 2.10.0
     * @param {JobMessage} params 参数
     * @returns {Promise<LeafActionRsp>} 调用结果
     */
    sendJobMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$i, 'sendJobMessage', params);
    },

    /**
     * @edata
     * @typedef {Object} LeafStatus Leaf状态信息
     * @property {number} status 心跳状态, 0-心跳成功, 1-心跳失败
     * @property {string} buziCode 业务Id
     * @property {string} jobKey 作业唯一key
     * @property {string} [msg] 错误提示信息
     */
    /**
     * @edata
     * @callback LeafCallback Leaf事件回调
     * @param {LeafStatus|Object} info 回调信息
     */
    /**
     * @edata
     * @typedef {Object} OnLeafEventsReq Leaf事件监听参数
     * @property {string} eventName 事件名, leafStatusChange-听Leaf状态变化(默认)
     * @property {LeafCallback} callback 事件回调
     */
    /**
     * 通用Leaf事件监听
     * @eapi
     * @since 3.5.1
     * @param {OnLeafEventsReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    on(params) {
      return extsdk.core.onEvent(MODULE_NAME$i, 'on', params);
    },

    /**
     * @edata
     * @typedef {Object} OffLeafEventsReq Leaf事件取消监听参数
     * @property {string} eventName 事件名, leafStatusChange-听Leaf状态变化(默认)
     */
    /**
     * 通用Leaf事件取消监听
     * @eapi
     * @since 3.5.1
     * @param {OffLeafEventsReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    off(params) {
      return extsdk.core.offEvent(MODULE_NAME$i, 'off', params);
    },
  }
};

/** @ignore */
const MODULE_NAME$h = 'HYExtLink';

var HYExtLink = {
  /**
   * 连麦
   * @namespace link
   */
  link: {
    /**
     * @edata
     * 流信息
     * @typedef {Object} AudioStreamInfo
     * @property {string} streamName 推流的流名称
     */
    /**
     * @edata
     * 讲话参数
     * @typedef {Object} PublishAudioParams
     * @property {string} [streamName] 指定流名称推流，可选，如果没给的话由端上生成流名称
     */
    /**
     * 开始讲话
     * @eapi
     * @param {PublishAudioParams} params 讲话参数
     * @returns {Promise<AudioStreamInfo>} 返回调用结果
     */
    startPublishAudio(params) {
      return extsdk.core.callEvent(MODULE_NAME$h, 'startPublishAudio', params);
    },

    /**
     * 停止讲话
     * @eapi
     * @returns {Promise<void>} 返回调用结果
     */
    stopPublishAudio() {
      return extsdk.core.callEvent(MODULE_NAME$h, 'stopPublishAudio');
    },

    /**
     * @edata
     * 音量参数
     * @typedef {Object} MicVolumeParams
     * @property {number} volume 音量，取值范围是0-100
     */
    /**
     * 设置讲话音量
     * @eapi
     * @param {MicVolumeParams} params 音量参数
     * @returns {Promise<void>} 返回调用结果
     */
    setMicVolume(params) {
      return extsdk.core.callEvent(MODULE_NAME$h, 'setMicVolume', params);
    },

    /**
     * @edata
     * 更新音频播放参数
     * @typedef {Object} [UpdateAudioPlayParams]
     * @property {string} [unionId] 用户的unionId
     * @property {number} [uid] 在UDB-SDK相关接口没提供之前暂用
     * @property {string} [streamName] 流名称
     * @property {number} volume 音量，取值范围是0-100
     */
    /**
     * 更新音频播放
     * @eapi
     * @param {Array.<UpdateAudioPlayParams>} params 更新音频播放参数
     * @returns {Promise<void>} 返回调用结果
     */
    updateAudioPlay(params) {
      return extsdk.core.callEvent(MODULE_NAME$h, 'updateAudioPlay', params);
    },

    /**
     * @edata
     * 流名称变化消息
     * @typedef {Object} StreamNameChangeInfo
     * @property {string} streamName 流名称
     */
    /**
     * @edata
     * 音频流改变回调
     * @callback AudioStreamNameChangeCallback
     * @param {StreamNameChangeInfo} streamNameChangeInfo 流名称变化消息
     */
    /**
     * @edata
     * 音频流改变参数
     * @typedef {Object} AudioStreamNameChangeParams
     * @property {AudioStreamNameChangeCallback} callback 音频流改变回调
     */
    /**
    * 监听音频流改变(无用)
    * @eapi
    * @param {AudioStreamNameChangeParams} params 音频流改变参数
    * @returns {Promise<void>} 返回调用结果
    */
    onAudioStreamNameChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$h, 'onAudioStreamNameChange', params);
    },

    /**
    * 移除音频流改变监听(无用)
    * @eapi
    * @returns {Promise<void>} 返回调用结果
    */
    offAudioStreamNameChange() {
      return extsdk.core.offEvent(MODULE_NAME$h, 'offAudioStreamNameChange');
    },

    /**
     * @edata
     * @typedef {Object} InviteLinkMicParams
     * @property {string} inviteMessage 邀请框的文案
     * @property {Array.<string>} roomIds 邀请对象的房间id
     * @property {Array.<string>} extTypes 拉起的小程序类型列表
     * @property {string} extraData 拉起时带的额外参数
     */
    /**
     * 发起连麦邀请
     * @eapi
     * @since 2.9.9
     * @param {InviteLinkMicParams} params 音频流改变参数
     * @returns {Promise<void>} 返回调用结果
     */
    inviteLinkMic(params) {
      return extsdk.core.callEvent(MODULE_NAME$h, 'inviteLinkMic', params);
    },

    /**
     * @edata
     * 邀请消息
     * @typedef {Object} InviteNotice
     * @property {string} noticeType 消息类型, INVITEE-被邀请, ACCEPT_INVITE-接受邀请, REJECT_INVITE-拒绝邀请
     * @property {string} roomId 触发消息的房间号
     * @property {string} extraData 邀请消息的额外数据
     */
    /**
     * @edata
     * 连麦邀请回调
     * @callback InviteNoticeCallback
     * @param {InviteNotice} params 邀请消息
     */
    /**
     * @edata
     * @typedef {Object} OnInviteNoticeParams
     * @property {InviteNoticeCallback} callback 连麦邀请回调
     */
    /**
     * 监听连麦邀请消息
     * @eapi
     * @since 2.9.9
     * @param {OnInviteNoticeParams} params 音频流改变参数
     * @returns {Promise<void>} 返回调用结果
     */
    onInviteNotice(params) {
      return extsdk.core.onEvent(MODULE_NAME$h, 'onInviteNotice', params);
    },

    /**
     * 取消监听连麦邀请消息
     * @eapi
     * @since 2.9.9
     * @returns {Promise<void>} 返回调用结果
     */
    offInviteNotice(params) {
      return extsdk.core.offEvent(MODULE_NAME$h, 'offInviteNotice', params);
    },


    /**
     * @edata
     * 消息内容
     * @typedef {Object} AudioChangeInfo
     * @property {number} speakerId speakerId，实际上是主播uid
     * @property {number} volume 音量，0-100
     */
    /**
     * @edata
     * 音量变化回调
     * @callback AudioChangeCallback
     * @param {Array.<AudioChangeInfo>} info 消息内容
     */
    /**
     * @edata
     * @typedef {Object} OnAudioChangeParams
     * @property {AudioChangeCallback} callback 音量变化回调
     * @property {number} [interval] 音量变化回调频率，单位ms
     */
    /**
     * 监听拉流是否有声音
     * @eapi
     * @since 3.2.0
     * @param {OnAudioChangeParams} params 音频流改变参数
     * @returns {Promise<void>} 返回调用结果
     */
    onAudioChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$h, 'onAudioChange', params);
    },

    /**
     * 取消监听拉流是否有声音
     * @eapi
     * @since 3.2.0
     * @returns {Promise<void>} 返回调用结果
     */
    offAudioChange(params) {
      return extsdk.core.offEvent(MODULE_NAME$h, 'offAudioChange', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$g = 'HYExtLiveEvent';

var HYExtLiveEvent = {
  /**
   * 直播间事件
   * @namespace liveEvent
   */
  liveEvent: {
    /**
     * 直播间事件消息回调
     * @edata
     * @callback LiveEventCallback Command消息回调函数 
     * @param {Object} content 回调消息，服务端自定义
     */
    /**
     * 监听直播间事件
     * @eapi
     * @param {string} eventName 
     * @param {LiveEventCallback} callback 
     * @returns {Promise<void>} 调用结果
     */
    on(eventName, callback) {
      return extsdk.core.callEvent(MODULE_NAME$g, "on", eventName, callback);
    },

    /**
     * 取消监听直播间事件
     * @eapi
     * @param {string} eventName 事件名
     * @param {LiveEventCallback} [callback] 回调函数
     * @returns {Promise<void>} 调用结果
     */
    off(eventName, callback) {
      return extsdk.core.callEvent(MODULE_NAME$g, "off", eventName, callback);
    }
  }
};

/** @ignore */
const MODULE_NAME$f = 'HYExtOb';

var HYExtOB = {
  /**
   * 比赛
   * @namespace ob
   */
  ob: {
    /**
     * @edata
     * 比赛状态信息
     * @typedef {Object} MatchInfo
     * @property {string} state 状态值
     */
    /**
     * 获取比赛信息
     * @eapi
     * @returns {Promise<MatchInfo>} 返回比赛状态信息
     */
    getMatchInfo() {
      return extsdk.core.callEvent(MODULE_NAME$f, 'getMatchInfo');
    },

    /**
     * 直播流的分隔配置参数
     * @edata
     * @typedef {Object} SplitedObParams
     * @property {number} row 行
     * @property {number} column 列
     * @property {number} height 高
     * @property {number} width 宽
     */
    /**
     * 设置超高分辨率直播流的分隔配置
     * @eapi
     * @param {SplitedObParams} param 直播流的分隔配置参数
     * @returns {Promise<void>} 返回当前视角信息
     */
    setSplitedOBStream(param) {
      return extsdk.core.callEvent(MODULE_NAME$f, 'setSplitedOBStream', param);
    },

    /**
     * 当前视角参数
     * @edata
     * @typedef {Object} PerspectiveParams
     * @property {number} pid 视角id
     */
    /**
     * 设置当前视角
     * @eapi
     * @param {PerspectiveParams} param 当前视角参数
     * @returns {Promise<void>} 返回设置视角是否成功
     */
    setPerspective(param) {
      return extsdk.core.callEvent(MODULE_NAME$f, 'setPerspective', param);
    },

    /**
     * 视角信息
     * @edata
     * @typedef {Object} PerspectiveInfo
     * @property {number} pid 视角id
     * @property {string} name 视角名称
     */
    /**
     * 获取视角列表
     * @eapi
     * @returns {Promise<Array.<PerspectiveInfo>>} 返回视角信息列表
     */
    getPerspectiveList() {
      return extsdk.core.callEvent(MODULE_NAME$f, 'getPerspectiveList');
    },

    /**
     * 获取当前视角
     * @eapi
     * @returns {Promise<PerspectiveInfo>} 返回当前视角信息
     */
    getCurrentPerspective() {
      return extsdk.core.callEvent(MODULE_NAME$f, 'getCurrentPerspective');
    },

    /**
     * ob消息回调
     * @edata
     * @callback OBCallback
     * @param {Object} content 回调消息 
     */
    /**
     * 监听ob消息
     * @eapi
     * @param {string} topic 消息名 matchStatusChange-比赛状态改变(默认), perspectiveChange-当前视角改变
     * @param {OBCallback} callback 收到消息时回调
     * @returns {void} 调用结果
     */
    on(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$f, 'on', topic, callback);
    },

    /**
     * 取消监听ob消息
     * @eapi
     * @param {string} topic 消息名 matchStatusChange-比赛状态改变(默认), perspectiveChange-当前视角改变
     * @param {OBCallback} [callback] 调用ob.on()时传入的函数的引用
     * @returns {void} 调用结果
     */
    off(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$f, 'off', topic, callback);
    }
  }
};

/** @ignore */
const MODULE_NAME$e = 'HYExtObserver';

var HYExtObserver = {
  /**
   * 监听后台消息
   * @namespace observer
   */
  observer: {
    /**
     * 小程序消息回调
     * @edata
     * @callback ObserverCallback
     * @param {string} content 消息内容
     */
    /**
     * 监听小程序消息
     * @summary 通过[小程序API](/api/list.md)或者hyExt.observer.emit发送虎牙小程序消息，使用这个接口接收
     * - 主播端（PC主播端/助手APP）无法接收到通过调用hyExt.observer.emit触发的消息，只能收到[小程序API](/api/list.md)的消息
     * @eapi
     * @param {string} topic 消息名
     * @param {ObserverCallback} callback 收到消息时回调 返回对应消息名的后台消息content
     * @returns {void} 调用结果
     */
    on(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$e, "on", topic, callback);
    },

    /**
     * 取消监听后台消息
     * @eapi
     * @param {string} topic 消息名
     * @param {ObserverCallback} [callback] 消息回调
     * @returns {void} 调用结果
     */
    off(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$e, "off", topic, callback);
    },

    /**
     * 触发小程序消息
     * @summary 频率限制（每分钟最高请求10次）
     * @eapi
     * @param {string} topic 小程序消息名
     * @param {string} message 小程序消息内容
     * @returns {Promise<void>}
     */
    emit(topic, message) {
      return extsdk.core.callEvent(MODULE_NAME$e, "emit", topic, message);
    },

    /**
     * 本地小程序消息回调
     * @edata
     * @callback LocalMessageCallback
     * @param {string} message 消息内容
     */
    /**
     * 监听本地小程序参数
     * @edata
     * @typedef {Object} LocalMessageParams
     * @property {string} eventName 消息名
     * @property {LocalMessageCallback} callback 消息回调
     */
    /**
     * 监听本地小程序消息
     * @summary 仅保留最后一次监听
     * @eapi
     * @param {LocalMessageParams} params 监听本地小程序参数
     * @returns {Promise<void>}
     */
    onLocalMessage({ eventName, callback }) {
      return extsdk.core.onEvent(MODULE_NAME$e, "onLocalMessage", { eventName, callback });
    },

    /**
     * 取消监听参数
     * @edata
     * @typedef {Object} OffLocalMessageParams
     * @property {string} eventName 消息名
     */
    /**
     * 取消监听自身小程序消息
     * @eapi
     * @param {OffLocalMessageParams} params 取消监听参数
     * @returns {Promise<void>}
     */
    offLocalMessage({ eventName }) {
      return extsdk.core.offEvent(MODULE_NAME$e, "offLocalMessage", { eventName });
    },

    /**
     * 本地消息参数
     * @edata
     * @typedef {Object} PostLocalMessageParams
     * @property {string} eventName 消息名
     * @property {string} message 消息内容
     */

    /**
     * 触发小程序本地消息
     * @eapi
     * @param {PostLocalMessageParams} params 本地消息参数
     * @returns {Promise<void>} 调用结果
     */
    postLocalMessage({ eventName, message }) {
      return extsdk.core.callEvent(MODULE_NAME$e, "postLocalMessage", { eventName, message });
    },

    /**
     * 广播开发者维度的本地消息
     * @since 2.9.9
     * @eapi
     * @param {PostLocalMessageParams} params 本地消息参数
     * @returns {Promise<void>} 调用结果
     */
    postDevelperLocalMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$e, "postDevelperLocalMessage", params);
    },

    /**
     * 监听开发者维度的本地消息
     * @since 2.9.9
     * @eapi
     * @param {LocalMessageParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    onDeveloperLocalMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$e, "onDeveloperLocalMessage", params);
    },

    /**
     * 取消监听开发者维度的本地消息
     * @since 2.9.9
     * @eapi
     * @param {OffLocalMessageParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    offDeveloperLocalMessage(params) {
      return extsdk.core.callEvent(MODULE_NAME$e, "offDeveloperLocalMessage", params);
    },

  },
};

/** @ignore */
const MODULE_NAME$d = 'HYExtOrder';

var HYExtOrder = {
  /**
   * 秩序相关
   * @namespace order
   */
  order: {
    /**
     * 文本秩序审核参数
     * @edata
     * @typedef {Object} ReportTextParams
     * @property {string} text 要检查的字符串
     */
    /**
     * 发起小程序文本的秩序审核
     * @eapi
     * @param {ReportTextParams} param 文本秩序审核参数
     * @returns {Promise<void>} 调用结果，reject为审核失败
     */
    reportText(param) {
      return extsdk.core.callEvent(MODULE_NAME$d, 'reportText', param);
    },
  }

};

/** @ignore */
const MODULE_NAME$c = 'HYExtPC';

var HYExtPC = {
  /**
   * PC相关
   * @namespace pc
   */
  pc: {
    /**
     * 下载资源参数
     * @edata
     * @typedef {Object} DownloadResParams
     * @property {string} url 要下载资源的url
     * @property {string} md5 资源的md5
     * @property {boolean} [unzip] 自动解压
     */
    /**
     * 下载资源
     * @eapi
     * @param {DownloadResParams} param 下载资源参数
     * @returns {Promise<void>} 下载失败reject
     */
    downloadRes(param) {
      return extsdk.core.callEvent(MODULE_NAME$c, 'downloadRes', param);
    },

    /**
     * 外部EXE参数
     * @edata
     * @typedef {Object} LaunchExeParams
     * @property {string} extName exe的名称
     * @property {string} md5 exe的md5
     * @property {Object} [params] 额外的参数
     */
    /**
     * 启动外部EXE
     * @eapi
     * @param {LaunchExeParams} param 外部EXE参数
     * @returns {Promise<void>} 启动失败reject
     */
    launchExe(param) {
      return extsdk.core.callEvent(MODULE_NAME$c, 'launchExe', param);
    },

    /**
     * Exe消息回调
     * @edata
     * @callback ExeCallback
     * @param {string} data 消息内容
     */
    /**
     * 监听小程序外部EXE消息参数
     * @edata
     * @typedef {Object} ExeMessageParams
     * @property {string} md5 要监听消息exe的md5
     * @property {ExeCallback} callback 消息回调
     */
    /**
     * 监听小程序外部EXE消息
     * @eapi
     * @param {ExeMessageParams} param 监听小程序外部EXE消息参数
     * @returns {Promise<void>} 注册监听失败 reject
     */
    onExeMessage(param) {
      return extsdk.core.onEvent(MODULE_NAME$c, 'onExeMessage', param);
    },

    /**
     * 状态信息
     * @edata
     * @typedef {Object} ExeStateInfo 
     * @property {string} state 枚举状态 "0"-exe启动成功, "1"-exe启动失败, "2"-exe退出, "3"-exe为建立链接, "4"-exe链接成功, "5"-exe断开链接, "6"-exe网络错误
     */
    /**
     * Exe状态变化回调
     * @edata
     * @callback ExeStateCallback
     * @param {ExeStateInfo} info 消息内容
     */
    /**
     * EXE状态监听
     * @edata
     * @typedef {Object} ExeStateListener
     * @property {string} md5 exe的md5
     * @property {ExeStateCallback} callback 状态变化回调
     */
    /**
     * 监听小程序外部EXE状态变化消息
     * @eapi
     * @param {ExeStateListener} param 传入参数
     * @returns {Promise<void>} 注册监听失败 reject
     */
    onExeStateChange(param) {
      return extsdk.core.onEvent(MODULE_NAME$c, 'onExeStateChange', param);
    },

    /**
     * 发到EXE的信息 
     * @edata
     * @typedef {Object} SendToExeInfo
     * @property {string} md5 要发送消息exe的md5
     * @property {string} data 要发送消息exe的数据
     */
    /**
     * 发送消息到小程序外部EXE
     * @eapi
     * @param {SendToExeInfo} param 发到EXE的信息
     * @returns {Promise<void>} 发送失败 reject
     */
    sendToExe(param) {
      return extsdk.core.callEvent(MODULE_NAME$c, 'sendToExe', param);
    },

    /**
     * 带token的url信息
     * @edata
     * @typedef {Object} TokenUrlInfo
     * @property {string} tokenUrl 带token的url
     */
    /**
     * 获取带token的url参数
     * @edata
     * @typedef {Object} TokenUrlParams
     * @property {string} baseUrl 基础url
     */
    /**
     * 获取带token的url
     * @eapi
     * @param {TokenUrlParams} param 获取带token的url参数
     * @returns {Promise<TokenUrlInfo>} 返回信息
     */
    getTokenUrl(param) {
      return extsdk.core.callEvent(MODULE_NAME$c, 'getTokenUrl', param);
    },
  }
};

/** @ignore */
const MODULE_NAME$b = 'HYExtPk';

var HYExtPK = {
  /**
   * PK 相关
   * @namespace pk
   */
  pk: {
    /**
     * @edata
     * @typedef {Object} PKStatusInfo
     * @property {number} status 结果枚举, 0-不能PK, 1-可以PK, 2-经过用户允许之后可以PK
     * @property {string} message 结果说明
     */
    /**
     * 是否能开启PK 
     * @eapi
     * @returns {Promise<PKStatusInfo>} 结果
     */
    isPKAvailable() {
      return extsdk.core.callEvent(MODULE_NAME$b, 'isPKAvailable');
    },

    /**
     * @edata
     * @typedef {Object} PKInfo
     * @property {string} streamName 流名称
     * @property {number} videoWidth 推流宽度（单位是像素）
     * @property {number} videoHeight 推流高度（单位是像素）
     * @property {number} videoBitRate 推流码率
     * @property {number} mixStragy 策略, 1-本地混化, 2-服务器混化
     */
    /**
     * 开始PK
     * @eapi
     * @returns {Promise<PKInfo>} 结果
     */
    startPk() {
      return extsdk.core.callEvent(MODULE_NAME$b, 'startPk');
    },

    /**
     * 结束PK
     * @eapi
     * @returns {Promise<void>} 结果
     */
    stopPk() {
      return extsdk.core.callEvent(MODULE_NAME$b, 'stopPk');
    },

    /**
     * 结束本地行为（连麦、原生PK等）
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    stopLocalAction() {
      return extsdk.core.callEvent(MODULE_NAME$b, 'stopLocalAction');
    },
  }
};

/** @ignore */
const MODULE_NAME$a = 'HYExtPanel';

var HYExtPanel = {
  /**
   * 面板
   * @namespace panel
   */
  panel: {
    /**
     * 布局信息
     * @edata
     * @typedef {Object} LayoutData
     * @property {boolean} visible 是否可见，默认true
     * @property {number} x 左上角横坐标占容器的比例
     * @property {number} y 左上角纵坐标占容器的比例
     * @property {number} width 宽度占容器的比例
     * @property {number} height 高度占容器的比例
     * @property {boolean} [animate] 是否带动画效果
     * @property {number} [duration] 动画时长（毫秒）
     * @property {number} alpha 不透明度
     */
    /**
     * 设置小程序布局
     * @summary 适用于浮窗小程序
     * @eapi
     * @param {LayoutData} params 布局信息
     * @returns {Promise<void>} 调用结果
     */
    setLayout(params) {
      return extsdk.core.callEvent(MODULE_NAME$a, 'setLayout', params);
    },

    /**
     * 主动销毁当前小程序
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    disposal() {
      return extsdk.core.callEvent(MODULE_NAME$a, 'disposal');
    },

    /**
     * 设置关闭按钮参数
     * @edata
     * @typedef {Object} SetBtnParams
     * @property {boolean} enable 是否启用原生关闭按钮
     * @property {number} [x] 相对于小程序视图左上角的横坐标
     * @property {number} [y] 相对于小程序视图左上角的纵坐标
     * @property {number} [width] 关闭按钮的宽度
     * @property {number} [height] 关闭按钮的高度
     * @property {string} [imgUrl] 关闭按钮的背景图
     */
    /**
     * 设置浮窗小程序的关闭按钮
     * @summary 仅支持浮窗类型的小程序
     * - 用户点击这个原生的关闭按钮后小程序会被强制销毁
     * @eapi
     * @param {SetBtnParams} params 设置关闭按钮参数
     * @returns {Promise<void>} 设置结果
     */
    setPopupCloseBtn(params) {
      return extsdk.core.callEvent(MODULE_NAME$a, 'setPopupCloseBtn', params);
    },

    /**
     * @edata
     * @typedef {Object} SetPanelDimParams 设置面板类型小程序宽高参数
     * @property {number} width 宽度的像素值
     * @property {number} height 高度的像素值
     */
    /**
     * 设置面板类型小程序宽高
     * @summary 如果超过容器宽高，按设置的宽高比缩小尺寸至显示完整
     * - 设置之后在容器中居中
     * @eapi
     * @since 3.8.7
     * @param {SetPanelDimParams} params 设置面板类型小程序宽高参数
     * @returns {Promise<void>} 调用结果
     */
    setPanelDimensions(params) {
      return extsdk.core.callEvent(MODULE_NAME$a, 'setPanelDimensions', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$9 = 'HYExtPlayer';

var HYExtPlayer = {
  /**
   * 玩家模块
   * @namespace player
   */
  player: {
    /** 
     * 小程序透明区域识别到单击手势，调用播放器单击事件
     * @eapi
     * @param {Object} [params] 触点相对于RN根元素坐标
     * @returns {Promise<void>} 返回调用是否成功
     */
    tapped(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'tapped', params);
    },

    /**
     * 小程序透明区域识别到双击手势，调用播放器双击事件
     * @eapi
     * @param {Object} [params] 触点相对于RN根元素坐标
     * @returns {Promise<void>} 返回调用是否成功
     */
    doubleTapped(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'doubleTapped', params);
    },

    /**
     * 帧信息
     * @edata
     * @typedef {Object} FrameInfo
     * @property {number} pts pts
     */
    /**
     * 获取当前播放的视频帧信息
     * @eapi
     * @returns {Promise<FrameInfo>} 返回帧信息
     */
    getFrameData() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getFrameData');
    },

    /**
     * 事件监听
     * @eapi
     * @param {string} topic 事件名 waiting-waiting, seeking-seeking, seeked-seeked, playing-playing, ended-ended, canplay-canplay, loadedmetadata-loadedmetadata, pause-pause, play-play, timeupdate-timeupdate, videoFrameReduceStart-videoFrameReduceStart, videoFrameGrowEnd-videoFrameGrowEnd
     * @param {Function} callback 事件回调
     * @returns {void} 调用结果
     */
    on(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$9, 'on', topic, callback);
    },

    /**
     * 取消事件监听
     * @eapi
     * @param {string} topic 事件名 waiting-waiting, seeking-seeking, seeked-seeked, playing-playing, ended-ended, canplay-canplay, loadedmetadata-loadedmetadata, pause-pause, play-play, timeupdate-timeupdate, videoFrameReduceStart-videoFrameReduceStart, videoFrameGrowEnd-videoFrameGrowEnd
     * @param {Function} [callback] 事件回调
     * @returns {void} 调用结果
     */
    off(topic, callback) {
      return extsdk.core.callEventSync(MODULE_NAME$9, 'off', topic, callback);
    },

    /**
     * 切换线路参数
     * @edata
     * @typedef {Object} SwitchLineParams
     * @property {number} line 线路标识
     */
    /**
     * 切换当前直播间线路
     * @eapi
     * @param {SwitchLineParams} params 切换线路参数
     * @returns {Promise<FrameInfo>} 调用结果
     */
    switchLine(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'switchLine', params);
    },

    /**
     * 路线信息
     * @edata
     * @typedef {Object} LineInfo
     * @property {number} line 线路标识
     * @property {string} label 线路名称
     */
    /**
     * 路线列表信息
     * @edata
     * @typedef {Object} LinesInfo
     * @property {Array.<LineInfo>} lines 线路列表
     */
    /**
     * 获取当前直播间线路列表
     * @eapi
     * @returns {Promise<LinesInfo>} 调用结果
     */
    getLinesInfo() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getLinesInfo');
    },

    /**
     * 当前线路信息
     * @edata 
     * @typedef {Object} CurrentLineInfo
     * @property {number} line 线路标识
     */
    /**
     * 获取当前直播间的当前线路
     * @eapi
     * @returns {Promise<CurrentLineInfo>} 调用结果
     */
    getCurrentLine() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getCurrentLine');
    },

    /**
     * 视频信息
     * @edata 
     * @typedef {Object} VideoInfo
     * @property {number} duration 视频时长
     * @property {number} currentTime 当前播放时间
     * @property {boolean} isPlaying 是否正在播放
     */
    /**
     * 当前视频信息
     * @edata 
     * @typedef {Object} CurrentVideoInfo
     * @property {VideoInfo} videoInfo 点播视频信息
     */
    /**
     * 获取当前直播间播放视频的信息
     * @summary 仅限于播放点播视频模式
     * @eapi
     * @returns {Promise<CurrentVideoInfo>} 调用结果
     */
    getVideoInfo() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getVideoInfo');
    },

    /**
     * 播放视频参数
     * @edata
     * @typedef {Object} PlayVideoInfoParams
     * @property {string} url 视频地址
     * @property {number} startTime 视频开始时间
     */
    /**
     * 在当前直播间播放视频
     * @summary 仅支持m3u8
     * @eapi
     * @param {PlayVideoInfoParams} params 播放视频参数
     * @returns {Promise<void>} 操作结果
     */
    playVideo(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'playVideo', params);
    },

    /**
     * 暂停直播间点播视频播放
     * @eapi
     * @returns {Promise<void>} 暂停结果
     */
    pauseVideo() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'pauseVideo');
    },

    /**
     * 恢复直播间点播视频播放
     * @eapi
     * @returns {Promise<void>} 调用结果 
     */
    resumeVideo() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'resumeVideo');
    },

    /**
     * 视频快进参数
     * @edata
     * @typedef {Object} FastForwardParams
     * @property {number} time 快进秒数
     */
    /**
     * 视频快进
     * @summary 仅限于播放点播视频模式
     * @eapi
     * @param {FastForwardParams} params 视频快进参数
     * @returns {Promise<void>} 调用结果 
     */
    fastForward(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'fastForward', params);
    },

    /**
     * 视频快进参数
     * @edata
     * @typedef {Object} FastBackwardParams
     * @property {number} time 快退秒数
     */
    /**
     * 视频快退
     * @summary 仅限于播放点播视频模式
     * @eapi
     * @param {FastBackwardParams} params 
     * @returns {Promise<void>} 调用结果 
     */
    fastBackward(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'fastBackward', params);
    },

    /**
     * 在当前直播间恢复直播
     * @eapi
     * @returns {Promise<void>} 调用结果 
     */
    resumeLive() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'resumeLive');
    },

    /**
     * 高分辨率直播流视口参数
     * @edata
     * @typedef {Object} ViewportParams
     * @property {number} x 视口左上角的横坐标
     * @property {number} y 视口左上角的纵坐标
     * @property {number} scale 视口的缩放比
     */
    /**
     * 设置超高分辨率直播流视口
     * @eapi
     * @param {ViewportParams} params 高分辨率直播流视口参数
     * @returns {Promise<void>} 调用结果 
     */
    setViewport(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'setViewport', params);
    },

    /**
     * 直播流视口信息
     * @edata
     * @typedef {Object} ViewportInfo
     * @property {number} x 视口左上角的横坐标
     * @property {number} y 视口左上角的纵坐标
     * @property {number} scale 视口的缩放比
     */
    /**
     * 获取超高分辨率直播流视口
     * @eapi
     * @returns {Promise<ViewportInfo>} 调用结果 
     */
    getViewport() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getViewport');
    },

    /**
     * 直播流视口增量参数
     * @edata
     * @typedef {Object} ViewportAddParams
     * @property {number} x 视口的横坐标增量
     * @property {number} y 视口的纵坐标增量
     * @property {number} scale 视口的缩放比增量
     */
    /**
     * 设置超高分辨率直播流视口增量
     * @eapi
     * @param {ViewportAddParams} params 直播流视口增量参数
     * @returns {Promise<void>} 调用结果 
     */
    addViewport(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'addViewport', params);
    },

    /**
     * 显示播放器UI
     * @param {Object} params 展示UI参数
     * @returns {Promise<void>} 调用结果 
     */
    showUI(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'showUI', params);
    },

    /**
     * 视频相对于播放器的位置信息
     * @edata
     * @typedef {Object} VideoPosition
     * @property {number} left 视频区域距离播放器左侧的像素值
     * @property {number} top 视频区域距离播放器上侧的像素值
     * @property {number} right 视频区域距离播放器右侧的像素值
     * @property {number} bottom 视频区域距离播放器下侧的像素值
     */
    /**
     * 获取视频相对于播放器的位置
     * @eapi
     * @returns {Promise<VideoPosition>} 调用结果
     */
    getVideoPosition() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getVideoPosition');
    },

    /**
     * 播放器的播放状态
     * @edata
     * @typedef {Object} VideoState
     * @property {number} state 状态值枚举, 1000-正在播放, 1001-直播关闭, 1002-加载失败, 1003-当前线路没有直播, 1004-没有拿到ob流的状态
     */
    /**
     * 获取播放器的播放状态
     * @eapi
     * @returns {Promise<VideoState>} 调用结果
     */
    getVideoState() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getVideoState');
    },

    /**
     * 播放器布局信息
     * @edata
     * @typedef {Object} VideoLayoutInfo
     * @property {boolean} isZoomOut 是否处于缩小布局
     */
    /**
     * 获取播放器布局信息
     * @eapi
     * @returns {Promise<VideoLayoutInfo>} 返回结果
     */
    getLayoutInfo() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getLayoutInfo');
    },

    /**
     * 缓冲时间参数
     * @edata
     * @typedef {Object} BufferTimeParams
     * @property {number} time 缓冲时间（毫秒）
     */
    /**
     * 设置缓冲时间
     * @eapi
     * @param {BufferTimeParams} params 缓冲时间参数
     * @returns {Promise<void>} 返回结果
     */
    setBufferTime(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'setBufferTime', params);
    },

    /**
     * 触发上下文菜单
     * @eapi
     * @returns {Promise<void>} 返回结果
     */
    contextMenu() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'contextMenu');
    },

    /**
     * 直播间播放直播流参数
     * @edata
     * @typedef {Object} PlayLiveParams
     * @property {string} streamName 流名称
     */
    /**
     * 在当前直播间播放直播流
     * @eapi
     * @param {PlayLiveParams} params 直播间播放直播流参数
     * @returns {Promise<void>} 返回结果
     */
    playLive(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'playLive', params);
    },

    /**
     * 播放器音量
     * @edata
     * @typedef {Object} VolumeInfo
     * @property {number} volume 音量（取值范围（0-1））
     */
    /**
     * 获取播放器音量
     * @eapi
     * @returns {Promise<VolumeInfo>} 返回结果
     */
    getVolume() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'getVolume');
    },

    /**
     * 播放器音量参数
     * @edata
     * @typedef {Object} VolumeParams
     * @property {number} volume 音量（取值范围（0-1））
     */
    /**
     * 设置播放器音量
     * @eapi
     * @param {VolumeParams} params 播放器音量参数
     * @returns {Promise<void>} 返回结果
     */
    setVolume(params) {
      return extsdk.core.callEvent(MODULE_NAME$9, 'setVolume', params);
    },

    /**
     * 静音播放
     * @eapi
     * @returns {Promise<void>} 返回结果
     */
    mutePlay() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'mutePlay');
    },

    /**
     * 非静音播放
     * @eapi
     * @returns {Promise<void>} 返回结果
     */
    unmutePlay() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'unmutePlay');
    },

    /**
     * 模拟鼠标hover到播放器
     * @eapi
     * @inner
     * @returns {Promise<void>} 调用结果
     */
    hover() {
      return extsdk.core.callEvent(MODULE_NAME$9, 'hover');
    },
  }
};

/** @ignore */
const MODULE_NAME$8 = 'HYExtPopup';

var HYExtPopup = {
  /**
   * 浮窗控制
   * @namespace popup
   */
  popup: {

    /**
     * 设置浮窗模式返回信息
     * @edata
     * @typedef {Object} SetModeRsp
     * @property {string} noticeKey 回调标记
     */
    /**
     * 设置浮窗模式参数
     * @edata
     * @typedef {Object} ModeParams
     * @property {string} mode 模式的枚举值, NORMAL-默认状态，所有浮窗初始化的时候都是这个状态，可以自由布局(默认), NOTICE-提示状态，这个状态下不能自由布局，显示/隐藏下沉到平台进行控制，进入提示状态会默认显示，退出提示状态时会默认隐藏, RIGHT_BOTTOM_BTN-右下角按钮状态，这个状态下不能自由布局，显示/隐藏下沉到平台进行控制，进入提示状态会默认显示，退出提示状态时会默认隐藏
     * @property {string} [key] 权重key值
     * @property {number} [width] 宽度，单位是点/像素，仅在NOTICE模式下生效
     * @property {number} [height] 高度，单位是点/像素，仅在NOTICE模式下生效
     */
    /**
     * 设置浮窗模式
     * @eapi
     * @since 2.9.10
     * @param {ModeParams} params 参数
     * @returns {Promise<SetModeRsp>} 调用结果
     */
    setMode(params) {
      return extsdk.core.callEvent(MODULE_NAME$8, 'setMode', params);
    },

    /**
     * 提示浮窗显示消息
     * @edata
     * @typedef {Object} NoticeShowInfo
     * @property {string} noticeKey 调用hyExt.popup.setMode时返回的标记，用来匹配是哪次setMode的回调
     */
    /**
     * 提示浮窗显示回调
     * @edata
     * @callback NoticeShowCallback
     * @param {NoticeShowInfo} info 提示浮窗显示消息
     */
    /**
     * 提示浮窗显示监听参数
     * @edata
     * @typedef {Object} NoticeShowParams 
     * @property {NoticeShowCallback} callback 消息回调
     */
    /**
     * 监听提示浮窗显示排队信息
     * @eapi
     * @since 3.10.1
     * @param {NoticeShowParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    onNoticeShow(params) {
      return extsdk.core.onEvent(MODULE_NAME$8, 'onNoticeShow', params);
    },

    /**
     * 取消监听提示浮窗显示排队信息
     * @eapi
     * @since 3.10.1
     * @returns {Promise<void>} 调用结果
     */
    offNoticeShow() {
      return extsdk.core.offEvent(MODULE_NAME$8, 'offNoticeShow');
    },

    /**
     * 提示浮窗隐藏消息
     * @edata
     * @typedef {Object} NoticeHideInfo
     * @property {string} noticeKey 调用hyExt.popup.setMode时返回的标记，用来匹配是哪次setMode的回调
     */
    /**
     * 提示浮窗隐藏回调
     * @edata
     * @callback NoticeHideCallback
     * @param {NoticeHideInfo} info 提示浮窗隐藏消息
     */
    /**
     * 提示浮窗隐藏监听参数
     * @edata
     * @typedef {Object} NoticeHideParams 
     * @property {NoticeHideCallback} callback 消息回调
     */
    /**
     * 监听提示浮窗隐藏
     * @eapi
     * @since 3.10.1
     * @param {NoticeHideParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    onNoticeHide(params) {
      return extsdk.core.onEvent(MODULE_NAME$8, 'onNoticeHide', params);
    },

    /**
     * 取消监听提示浮窗隐藏
     * @eapi
     * @since 3.10.1
     * @returns {Promise<void>} 调用结果
     */
    offNoticeHide() {
      return extsdk.core.offEvent(MODULE_NAME$8, 'offNoticeHide');
    },
  }
};

/** @ignore */
const MODULE_NAME$7 = 'HYExtReg';

var HYExtReg = {
  /**
   * 识别相关
   * @namespace reg
   */
  reg: {
    /**
     * @edata
     * @typedef {Object} SpeechResp 语音识别消息
     * @property {string} data 语音识别出来的文字
     */
    /**
     * 语音识别回调
     * @edata
     * @callback SpeechCallback
     * @param {SpeechResp} recognition 语音识别消息
     */
    /**
     * 语音识别参数
     * @edata
     * @typedef {Object} SpeechParams 参数
     * @property {Array.<string>} hotwords 热词
     * @property {SpeechCallback} callback 语音识别回调
     */
    /**
     * 监听当前直播间语音识别消息
     * @eapi
     * @param {SpeechParams} param 语音识别参数
     * @returns {Promise<void>} 调用结果
     */
    onSpeechRecognition(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onSpeechRecognition', param);
    },

    /**
     * 取消监听当前直播间语音识别消息
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    offSpeechRecognition() {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offSpeechRecognition');
    },

    /**
     * @edata
     * @typedef {Object} GestureResp 手势识别消息
     * @property {string} key 手势识别的标识, BIXIN-比心
     */
    /**
     * 手势识别回调
     * @edata
     * @callback GestureCallback
     * @param {GestureResp} recognition 识别消息
     */
    /**
     * @edata
     * @typedef {Object} GestureRecognitionParams
     * @property {GestureCallback} callback 手势识别回调
     */
    /**
     * 监听当前直播间手势识别消息
     * @summary 双面镜、两屏、三屏的时候提示接口不支持
     * @eapi
     * @param {GestureRecognitionParams} param 手势识别参数
     * @returns {Promise<void>} 调用结果
     */
    onGestureRecognition(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onGestureRecognition', param);
    },

    /**
     * 取消监听当前直播间手势识别消息
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    offGestureRecognition() {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offGestureRecognition');
    },

    /**
     * 画布信息
     * @edata
     * @typedef {Object} CanvasInfo 
     * @property {number} width 画布宽度
     * @property {number} height 画布高度
     */
    /**
     * 骨骼点信息
     * @edata
     * @typedef {Object} KeypointInfo 
     * @property {number} x 横坐标（值域 [0, 画布宽]，单位是像素）
     * @property {number} y 纵坐标（值域 [0, 画布宽]，单位是像素）
     * @property {number} score 置信度（值越高表示识别得越准确）
     * @property {string} id 骨骼点的标识 "0"-NOSE, "1"-LEFT_EYE, "2"-RIGHT_EYE, "3"-LEFT_EAR, "4"-RIGHT_EAR, "5"-LEFT_SHOULDER, "6"-RIGHT_SHOULDER, "7"-LEFT_ELBOW, "8"-RIGHT_ELBOW, "9"-LEFT_WRIST, "10"-RIGHT_WRIST, "11"-LEFT_HIP, "12"-RIGHT_HIP, "13"-LEFT_KNEE, "14"-RIGHT_KNEE, "15"-LEFT_ANKLE, "16"-RIGHT_ANKLE, "17"-LEFT_HAND, "18"-RIGHT_HAND
     */
    /**
     * 骨骼识别消息
     * @edata
     * @typedef {Object} SkeletonResp 
     * @property {CanvasInfo} canvas 画布信息
     * @property {Array.<KeypointInfo>} keypoints 骨骼点
     */
    /**
     * 骨骼识别回调
     * @edata
     * @callback SkeletonCallback
     * @param {SkeletonResp} recognition 骨骼识别消息
     */
    /**
     * 骨骼识别消息
     * @edata
     * @typedef {Object} HumanSkeletonDetectionParams 
     * @property {SkeletonCallback} callback 骨骼识别回调
     */
    /**
     * 监听当前直播间肢体骨骼点检测消息
     * @summary 双面镜、两屏、三屏的时候提示接口不支持
     * - 开启左右翻转后点的下标和识别部位的对应关系会发生变化
     * @eapi
     * @param {HumanSkeletonDetectionParams} param 参数
     * @returns {Promise<void>} 调用结果
     */
    onHumanSkeletonDetection(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onHumanSkeletonDetection', param);
    },

    /**
     * 取消监听当前直播间肢体骨骼点检测消息
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    offHumanSkeletonDetection() {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offHumanSkeletonDetection');
    },

    /**
     * 人脸框信息
     * @edata
     * @typedef {Object} FaceRect 
     * @property {number} x 人脸框左上角横坐标（相对与视频区域左上角，单位是像素）
     * @property {number} y 人脸框左上角纵坐标（相对与视频区域左上角，单位是像素）
     * @property {number} width 人脸框宽度（相对与视频区域左上角，单位是像素）
     * @property {number} height 人脸框高度（相对与视频区域左上角，单位是像素）	
     */
    /**
     * 人脸特征点信息
     * @edata
     * @typedef {Object} Landmark 
     * @property {number} x 横坐标（值域 [0, 画布宽]，单位是像素）
     * @property {number} y 纵坐标（值域 [0, 画布高]，单位是像素）
     */
    /**
     * 人脸信息
     * @edata
     * @typedef {Object} FaceInfo 
     * @property {FaceRect} faceRect 人脸框
     * @property {number} pitch	俯仰角（x轴），值域 [-90, 90]
     * @property {number} yaw	偏航角（y轴），值域 [-90, 90]
     * @property {number} roll 翻滚角（z轴），值域 [-180, 180]
     * @property {Array.<Landmark>} landmarks106 人脸特征点
     */
    /**
     * 人脸识别消息
     * @edata
     * @typedef {Object} FacialResp 
     * @property {CanvasInfo} canvas 画布信息
     * @property {Array.<FaceInfo>} faces 人脸信息
     */
    /**
     * 人脸识别回调
     * @edata
     * @callback FacialCallback
     * @param {FacialResp} recognition 人脸识别消息
     */
    /**
     * @edata
     * @typedef {Object} FacialLandmarkDetectionParams
     * @property {FacialCallback} callback 人脸识别回调
     */
    /**
     * 监听当前直播间人脸特征点检测消息
     * @summary 双面镜、两屏、三屏的时候提示接口不支持
     * - 开启左右翻转后点的下标和识别部位的对应关系会发生变化
     * @eapi
     * @param {FacialLandmarkDetectionParams} param 参数
     * @returns {Promise<void>} 调用结果
     */
    onFacialLandmarkDetection(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onFacialLandmarkDetection', param);
    },

    /**
     * 取消监听当前直播间肢体骨骼点检测消息
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    offFacialLandmarkDetection() {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offFacialLandmarkDetection');
    },

    /**
     * 轮廓点信息
     * @edata
     * @typedef {Object} ContourPointInfo 
     * @property {number} x 横坐标（值域 [0, 画布宽]，单位是像素）
     * @property {number} y 纵坐标（值域 [0, 画布高]，单位是像素）
     */
    /**
     * 人体轮廓识别消息
     * @edata
     * @typedef {Object} HumanResp 
     * @property {CanvasInfo} canvas 画布信息
     * @property {Array.<ContourPointInfo>} contourPoints 轮廓点
     * @property {number} contourCount 轮廓数，值域为正整数
     */
    /**
     * 人体轮廓识别回调
     * @edata
     * @callback HumanCallback
     * @param {HumanResp} recognition 人体轮廓识别消息
     */
    /**
     * 人体轮廓识别消息参数
     * @edata
     * @typedef {Object} HumanContourDetectionParams 
     * @property {HumanCallback} callback 画布信息
     */
    /**
     * 监听当前直播间人体轮廓点检测消息
     * @summary 双面镜、两屏、三屏的时候提示接口不支持
     * @eapi
     * @param {HumanContourDetectionParams} param 人体轮廓识别消息参数
     * @returns {Promise<void>} 调用结果
     */
    onHumanContourDetection(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onHumanContourDetection', param);
    },

    /**
     * 取消监听当前直播间人体轮廓点检测消息
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    offHumanContourDetection() {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offHumanContourDetection');
    },

    /**
     * 人体轮廓识别对象
     * @edata
     * @typedef {Object} CVRecognition 
     * @property {string} cvRecKey key
     * @property {Object} cvRecValue value
     */
    /**
     * 人体轮廓识别回调
     * @edata
     * @callback OnCVRecognitionOptionsCallback
     * @param {Array.<CVRecognition>} recognitions 识别消息列表
     */
    /**
     * 人体轮廓识别参数
     * @edata
     * @typedef {Object} CVRecognitionParams 
     * @property {Array.<string>} keys 识别标识
     * @property {OnCVRecognitionOptionsCallback} callback
     */
    /**
     * 监听当前直播间视觉识别消息
     * @eapi
     * @param {CVRecognitionParams} param 人体轮廓识别参数
     * @returns {Promise<void>} 调用结果
     */
    onCVRecognition(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onCVRecognition', param);
    },

    /**
     * 取消监听当前直播间视觉识别参数
     * @edata
     * @typedef {Object} OffCVRecognitionParams
     * @property {Array.<string>} keys 识别标识
     */
    /**
     * 取消监听当前直播间视觉识别消息
     * @eapi
     * @param {OffCVRecognitionParams} param 取消监听当前直播间视觉识别参数
     * @returns {Promise<void>} 调用结果
     */
    offCVRecognition(param) {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offCVRecognition', param);
    },

    /**
     * 查询当前直播间视觉识别结果参数
     * @edata
     * @typedef {Object} QueryCVRecognitionParams
     * @property {Array.<string>} keys 识别标识
     */
    /**
     * 查询当前直播间视觉识别结果
     * @eapi
     * @param {QueryCVRecognitionParams} param 参数
     * @returns {Promise<Array.<CVRecognition>>} 识别消息列表
     */
    queryCVRecognition(param) {
      return extsdk.core.callEvent(MODULE_NAME$7, 'queryCVRecognition', param);
    },

    /**
     * 热词识别消息
     * @edata
     * @typedef {Object} KeywordResp 
     * @property {string} data 识别出来的文字
     */
    /**
     * 热词识别回调
     * @edata
     * @callback SpeechKeywordCallback
     * @param {KeywordResp} recognition 热词识别消息
     */
    /**
     * @edata
     * @typedef {Object} SpeechKeywordParams 热词监听请求参数
     * @property {Array.<string>} hotwords 热词
     * @property {SpeechKeywordCallback} callback 热词识别回调
     */
    /**
     * 监听当前直播间语音关键字识别消息
     * @eapi
     * @param {SpeechKeywordParams} param 调用参数
     * @returns {Promise<void>} 调用结果
     */
    onSpeechKeywordRecognition(param) {
      return extsdk.core.onEvent(MODULE_NAME$7, 'onSpeechKeywordRecognition', param);
    },

    /**
     * 取消监听当前直播间肢体骨骼点检测消息
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    offSpeechKeywordRecognition() {
      return extsdk.core.offEvent(MODULE_NAME$7, 'offSpeechKeywordRecognition');
    },

    /**
     * 转换返回结果
     * @edata
     * @typedef {Object} TextToSpeechResp  
     * @property {number} returnCode 返回码
     * @property {string} message 返回信息
     * @property {string} audioUrl 音频地址
     * @property {number} duration 音频长度
     */
    /**
     * 文本转语音参数
     * @edata
     * @typedef {Object} TextToSpeechParams 
     * @property {string} text 文本
     * @property {number} tone 语调, 1-TONE_XIAOYU, 2-TONE_XIAOXIA, 3-TONE_XIAOXIN, 4-TONE_XIAOZE
     * @property {number} type 类型, 0-TYPE_WAV, 1-TYPE_PCM
     */
    /**
     * 文本转语音
     * @eapi
     * @param {TextToSpeechParams} param 传入参数
     * @returns {Promise<TextToSpeechResp>} 调用结果
     */
    textToSpeech(param) {
      return extsdk.core.callEvent(MODULE_NAME$7, 'textToSpeech', param);
    }
  }
};

/** @ignore */
const MODULE_NAME$6 = 'HYExtRevenue';

var HYExtRevenue = {
  /**
   * 营收相关
   * @namespace revenue
   */
  revenue: {
    /**
     * 营收统计参数
     * @edata
     * @typedef {Object} RevenueStatParams
     * @property {Object} eventData 上报数据
     */
    /**
     * 开始营收统计
     * @eapi
     * @param {RevenueStatParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    startRevenueStat(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'startRevenueStat', params);
    },

    /**
     * 停止营收统计
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    stopRevenueStat() {
      return extsdk.core.callEvent(MODULE_NAME$6, 'stopRevenueStat');
    },

    /**
     * 否可以使用指定的商品
     * @edata
     * @typedef {Object} CanUseGoodsInfo
     * @property {boolean} isCanUse 是否可用
     */
    /**
     * 是否可以使用指定的商品参数
     * @edata
     * @typedef {Object} CanUseGoodsParams
     * @property {string} goodsUuid 商品id
     */
    /**
     * 判断当前主播是否可以使用指定的商品
     * @eapi
     * @param {CanUseGoodsParams} params 参数
     * @returns {Promise<CanUseGoodsInfo>} 调用结果
     */
    checkStreamerCanUseGoods(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'checkStreamerCanUseGoods', params);
    },

    /**
     * 停止统计参数
     * @edata
     * @typedef {Object} EndGiftRevenueStatParams
     * @property {string} goodsUuid 商品id
     */
    /**
     * 停止统计
     * @eapi
     * @param {EndGiftRevenueStatParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    endModuleGiftRevenueStat(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'endModuleGiftRevenueStat', params);
    },

    /**
     * 开始统计参数
     * @edata
     * @typedef {Object} StartGiftRevenueStatParams
     * @property {string} goodsUuid 商品id
     * @property {string} [giftIds] 礼物id，多个用竖线分隔
     */
    /**
     * 开始统计
     * @eapi
     * @param {StartGiftRevenueStatParams} params 参数
     * @returns {Promise<void>} 调用结果 
     */
    startModuleGiftRevenueStat(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'startModuleGiftRevenueStat', params);
    },

    /**
     * 指定商品的使用有效期信息
     * @edata
     * @typedef {Object} GoodsExpireInfo
     * @property {number} expire 主播指定商品的失效日期时间戳，没有购买过则返回-1
     * @property {boolean} hadBuy 是否有购买过
     */
    /**
     * 指定商品的使用有效期参数
     * @edata
     * @typedef {Object} GoodsExpireParams
     * @property {string} goodsUuid 商品id
     */
    /**
     * 判断当前主播指定的商品的使用有效期
     * @eapi
     * @param {GoodsExpireParams} params 参数 
     * @returns {Promise<GoodsExpireInfo>} 调用结果
     */
    checkStreamerGoodsExpire(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'checkStreamerGoodsExpire', params);
    },

    /**
     * 购买商品参数
     * @edata
     * @typedef {Object} GoodsBuyParams
     * @property {string} goodsUuid 商品id
     */
    /**
     * 弹出商品购买的H5面板
     * @eapi
     * @param {GoodsBuyParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    popupGoodsBuyPanel(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'popupGoodsBuyPanel', params);
    },

    /**
     * 购买商品结果
     * @edata
     * @typedef {Object} PurchaseInfo
     * @property {string} code 结果, OrderSucc-下单成功, OrderFail-下单失败
     * @property {string} confirmType 确认方式, Direct-直接点击, Phone-手机验证码
     * @property {string} msg 错误信息
     * @property {string} purchaseOrderId 支付订单号
     * @property {string} url 支付方式, HYB-虎牙币, HDB-互动币
     * @property {string} createOrderNonce 下单成功随机串
     */
    /**
     * 购买商品参数
     * @edata
     * @typedef {Object} PurchaseParams
     * @property {string} goodsUuid 商品id
     * @property {string} purchaseOrderId 支付订单号
     * @property {string} feeType 支付方式, HYB-虎牙币, HDB-互动币
     * @property {number} totalFee 总支付金额，单位分
     * @property {number} price 单个金额，单位分
     * @property {number} quantity 购买数量
     * @property {string} productType 商品类型, monetization-资源, custom-自定义商品
     * @property {string} productId 购买资源的ID（业务）
     * @property {string} productName 购买资源的名称（业务）
     * @property {string} productDetail 购买资源的可扩展字段（结构化的JSON字符串）
     * @property {number} timeStamp 时间戳（秒）
     * @property {string} signType 签名类型, MD5-MD5
     * @property {string} signStr 签名（请查看签名算法说明）
     * @property {string} nonce 随机串
     */
    /**
     * 发起购买
     * @eapi
     * @since 2.15.2
     * @param {PurchaseParams} params 购买参数
     * @returns {Promise<PurchaseInfo>} 调用结果
     */
    requestPurchase(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'requestPurchase', params);
    },

    /**
     * 购买订单ID信息
     * @edata
     * @typedef {Object} PurchaseOrderIdInfo
     * @property {string} purchaseOrderId 支付订单号
     */
    /**
     * 获取购买订单号参数
     * @edata
     * @typedef {Object} PurchaseOrderIdParams
     * @property {number} timeStamp 时间戳（秒）
     * @property {string} signType 签名类型, MD5-MD5
     * @property {string} signStr 签名（请查看签名算法说明）
     * @property {string} nonce 随机串
     */
    /**
     * 获取购买订单号
     * @eapi
     * @since 2.15.2
     * @param {PurchaseOrderIdParams} params 参数
     * @returns {Promise<PurchaseOrderIdInfo>} 调用结果
     */
    getPurchaseOrderId(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'getPurchaseOrderId', params);
    },

    /**
     * 订单详情
     * @edata
     * @typedef {Object} PurchaseOrderInfo
     * @property {string} code 结果, OrderSucc-下单成功, OrderFail-下单失败, PaySucc-支付成功, PayFail-支付失败, PayHanding-支付处理中
     * @property {string} msg 错误信息
     * @property {string} purchaseOrderId 支付订单号
     * @property {string} feeType 支付方式, HYB-虎牙币, HDB-互动币
     * @property {number} totalFee 总支付金额，单位分
     * @property {number} price 单个金额，单位分
     * @property {number} quantity 购买数量
     * @property {string} productType 商品类型, monetization-资源, custom-自定义商品
     * @property {string} productId 购买资源的ID（业务）
     * @property {string} productName 购买资源的名称（业务）
     * @property {string} productDetail 购买资源的可扩展字段（结构化的JSON字符串）
     */
    /**
     * 查询订单详情参数
     * @edata
     * @typedef {Object} PurchaseOrderParams
     * @property {string} purchaseOrderId 支付订单号
     * @property {number} timeStamp 时间戳（秒）
     * @property {string} signType 签名类型, MD5-MD5
     * @property {string} signStr 签名（请查看签名算法说明）
     * @property {string} nonce 随机串
     */
    /**
     * 查询订单详情
     * @eapi
     * @since 2.15.2
     * @param {PurchaseOrderParams} params 参数
     * @returns {Promise<PurchaseOrderInfo>} 调用结果
     */
    queryPurchaseOrder(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'queryPurchaseOrder', params);
    },

    /**
     * 唤起能量豆充值弹窗
     * @summary 使用 hyExt.context.on("openCoinPanelClosed", ({ openType, closeType }) => (openType === "exchange") && console.log("弹窗关闭"))  监听充值弹窗关闭
     * @eapi
     * @since 3.9.3
     * @param {any} [params] 参数
     * @returns {Promise<void>} 调用结果
     */
    popupOpenCoinExchangePanel(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'popupOpenCoinExchangePanel', params);
    },

    /**
     * 能量豆消费订单信息
     * @edata
     * @typedef {Object} PrePayOrderInfo
     * @property {string} code 结果, OrderSucc-下单成功, OrderFail-下单失败
     * @property {string} msg 错误信息
     * @property {string} purchaseOrderId 平台支付订单号
     * @property {string} preOrderNonce 下单成功随机串
     */
    /**
     * 发起能量豆消费下单参数
     * @edata
     * @typedef {Object} PrePayOrderParams
     * @property {string} outerPurchaseOrderId 外部支付订单号
     * @property {string} totalFee 总支付金额
     * @property {string} price 单个金额
     * @property {number} quantity 购买数量
     * @property {string} productId 购买资源的ID（业务）
     * @property {string} productName 购买资源的名称（业务）
     * @property {string} productDetail 购买资源的可扩展字段（结构化的JSON字符串）
     * @property {string} timeStamp 时间戳（秒）
     * @property {string} signType 签名类型, MD5-MD5
     * @property {string} signStr 签名（请查看签名算法说明）
     * @property {string} nonce 随机串
     */
    /**
     * 发起能量豆消费下单
     * @eapi
     * @since 3.9.3
     * @param {PrePayOrderParams} params 参数
     * @returns {Promise<PrePayOrderInfo>} 调用结果
     */
    prePayOrder(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'prePayOrder', params);
    },

    /**
     * 能量豆余额信息
     * @edata
     * @typedef {Object} OpenCoinInfo
     * @property {string} balance 余额，单位元，保留两位小数
     */
    /**
     * 能量豆余额查询
     * @eapi
     * @since 3.9.3
     * @param {any} [params] 参数
     * @returns {Promise<OpenCoinInfo>} 调用结果
     */
    queryUserOpenCoinBalance(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'queryUserOpenCoinBalance', params);
    },

    /**
     * 能量豆消费请求参数
     * @edata
     * @typedef {Object} OpenCoinConsumeParams
     * @property {string} purchaseOrderId 平台支付订单号
     * @property {string} preOrderNonce 下单成功随机串
     */
    /**
     * 发起能量豆消费请求
     * @summary 使用 hyExt.context.on("openCoinPanelClosed", ({ openType, closeType }) => (openType === "consume") && console.log("弹窗关闭")) 监听消费弹窗关闭
     * @eapi
     * @since 3.9.3
     * @param {OpenCoinConsumeParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    requestOpenCoinConsume(params) {
      return extsdk.core.callEvent(MODULE_NAME$6, 'requestOpenCoinConsume', params);
    },

  }
};

/** @ignore */
const MODULE_NAME$5 = 'HYExtStream';

var HYExtStream = {
  /**
   * 流模块
   * @namespace stream
   */
  stream: {
    /**
     * 直播间延迟模式
     * @edata
     * @typedef {Object} ViewerLatencyModeInfo
     * @property {number} mode 延迟模式标识, 0-普通模式, 1-低延迟模式
     */
    /**
     * 获取当前直播间的延迟模式
     * @summary 观众端专用
     * @eapi
     * @returns {Promise<ViewerLatencyModeInfo>} 调用结果
     */
    getViewerLatencyMode() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getViewerLatencyMode');
    },

    /**
     * 设置直播间延迟模式参数
     * @edata
     * @typedef {Object} ViewerLatencyModeParams
     * @property {number} mode 延迟模式标识, 0-普通模式(默认), 1-低延迟模式
     */
    /**
     * 设置当前直播间的延迟模式
     * @summary 观众端专用
     * @eapi
     * @param {ViewerLatencyModeParams} params 设置直播间延迟模式参数
     * @returns {Promise<void>} 调用结果
     */
    setViewerLatencyMode(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'setViewerLatencyMode', params);
    },

    /**
     * 白板信息
     * @edata
     * @typedef {Object} WhiteBoardInfo
     * @property {string} wbId 白板ID
     */
    /**
     * 创建独立白板参数
     * @edata
     * @typedef {Object} WhiteBoardParams
     * @property {Object} [param] 独立白板的初始参数
     * @property {number} width 独立白板的宽度
     * @property {number} height 独立白板的高度
     */
    /**
     * 创建小程序独立白板
     * @eapi
     * @param {WhiteBoardParams} params 创建独立白板参数
     * @returns {Promise<WhiteBoardInfo>} 返回白板信息
     */
    addExtraWhiteBoard(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addExtraWhiteBoard', params);
    },

    /**
     * 移除小程序独立白板
     * @eapi
     * @param {WhiteBoardInfo} params 移除独立白板参数
     * @returns {Promise<void>} 调用结果
     */
    removeExtraWhiteBoard(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeExtraWhiteBoard', params);
    },

    /**
     * 发送到白板的消息
     * @edata
     * @typedef {Object} WhiteBoardMsg
     * @property {string} wbId 独立白板的Id
     * @property {string} [data] 要发送的消息
     */
    /**
     * 发送消息到小程序独立白板
     * @eapi
     * @param {WhiteBoardMsg} params 发送到白板的消息
     * @returns {Promise<void>} 调用结果
     */
    sendToExtraWhiteBoard(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'sendToExtraWhiteBoard', params);
    },

    /**
     * 推流的分辨率
     * @edata
     * @typedef {Object} StreamResolutionInfo
     * @property {number} width 宽度（单位是像素）
     * @property {number} height 高度（单位是像素）
     */
    /**
     * 获取推流的分辨率
     * @eapi
     * @returns {Promise<StreamResolutionInfo>} 返回推流的分辨率
     */
    getStreamResolution() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getStreamResolution');
    },

    /**
     * 推流分辨率参数
     * @edata
     * @typedef {Object} StreamResolutionParams
     * @property {number} width 宽度（单位是像素）
     * @property {number} height 高度（单位是像素）
     */
    /**
     * 设置推流分辨率
     * @eapi
     * @param {StreamResolutionParams} params 推流分辨率参数
     * @returns {Promise<void>} 调用结果
     */
    setStreamResolution(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'setStreamResolution', params);
    },

    /**
     * 直播间延迟模式信息
     * @edata
     * @typedef {Object} StreamerLatencyModeInfo
     * @property {number} mode 延迟模式标识, 0-普通模式, 1-低延迟模式
     */
    /**
     * 获取当前直播间的延迟模式
     * @summary 主播端专用
     * @eapi
     * @returns {Promise<StreamerLatencyModeInfo>} 调用结果
     */
    getStreamerLatencyMode() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getStreamerLatencyMode');
    },

    /**
     * 设置当前直播间的延迟模式
     * @summary 主播端专用
     * @eapi
     * @param {StreamerLatencyModeInfo} params 延迟模式参数
     * @returns {Promise<void>} 调用结果
     */
    setStreamerLatencyMode(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'setStreamerLatencyMode', params);
    },

    /**
     * 创建图层信息参数
     * @edata
     * @typedef {Object} LayerInfoParam
     * @property {string} type 图层类型, PK-PK图层(默认), IMAGE-图片图层, VIDEO-视频图层
     * @property {string} [layerName] 业务传入的图层标识
     * @property {number} offsetX 图层相对推流出去的界面左侧的偏移量（单位是像素）
     * @property {number} offsetY 图层相对推流出去的界面顶部的偏移量（单位是像素）
     * @property {number} canvasWidth 推流出去的界面里图层占的宽度（单位是像素）
     * @property {number} canvasHeight 推流出去的界面里图层占的高度（单位是像素）
     * @property {number} [weight] 权重
     * @property {boolean} [force] 强制使用当前配置
     * @property {Object} [param] 参数
     */
    /**
     * 创建图层结果
     * @edata
     * @typedef {Object} LayerId
     * @property {string} layerId 图层id
     */
    /**
     * 批量创建图层
     * @eapi
     * @param {Array.<LayerInfoParam>} params 图层信息队列
     * @returns {Promise<Array.<LayerId>>} 调用结果
     */
    addLayers(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addLayers', params);
    },

    /**
     * 图层信息
     * @edata
     * @typedef {Object} LayerInfo
     * @property {string} layerId 图层id
     * @property {string} type 图层类型
     * @property {string} layerName 业务传入的图层标识
     * @property {number} offsetX 图层相对推流出去的界面左侧的偏移量（单位是像素）
     * @property {number} offsetY 图层相对推流出去的界面顶部的偏移量（单位是像素）
     * @property {number} canvasWidth 推流出去的界面里图层占的宽度（单位是像素）
     * @property {number} canvasHeight 推流出去的界面里图层占的高度（单位是像素）
     * @property {number} weight 权重
     * @property {Object} param 参数
     */
    /**
     * 获取图层信息
     * @eapi
     * @returns {Promise<Array.<LayerInfo>>} 调用结果
     */
    getLayers() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getLayers');
    },

    /**
     * 更新操作结果
     * @edata
     * @typedef {Object} ChangePesp
     * @property {number} res 操作结果，0成功，非0失败
     */
    /**
     * 更新图层信息参数
     * @edata
     * @typedef {Object} UpdateLayerParam
     * @property {string} layerId 图层id
     * @property {number} offsetX 图层相对推流出去的界面左侧的偏移量（单位是像素）
     * @property {number} offsetY 图层相对推流出去的界面顶部的偏移量（单位是像素）
     * @property {number} canvasWidth 推流出去的界面里图层占的宽度（单位是像素）
     * @property {number} canvasHeight 推流出去的界面里图层占的高度（单位是像素）
     * @property {number} [weight] 权重
     * @property {boolean} [force] 强制使用当前配置
     * @property {Object} [param] 参数
     */
    /**
     * 批量更新图层
     * @eapi
     * @param {Array.<UpdateLayerParam>} params 携带图层id的图层信息队列
     * @returns {Promise<Array.<ChangePesp>>} 调用结果
     */
    updateLayers(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'updateLayers', params);
    },

    /**
     * 批量删除图层
     * @eapi
     * @param {Array.<LayerId>} params 参数
     * @returns {Promise<Array.<ChangePesp>>} 调用结果
     */
    removeLayers(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeLayers', params);
    },

    /**
     * 元素配置
     * @edata
     * @typedef {Object} ZoneOptions
     * @property {string} screenColor 透明底色配置，默认为空，即不启用透明底色
     */
    /**
     * 添加元素参数
     * @edata
     * @typedef {Object} ZoneParams
     * @property {any} elem 截取的HTML元素/React组件
     * @property {ZoneOptions} [options] 截取选项
     */
    /**
     * 截取小程序的某个元素并让其内容显示到视频流中，截取的内容可以在开播端的“预览”界面进行编辑
     * @eapi
     * @param {ZoneParams} params 添加元素参数
     * @returns {Promise<void>} 调用结果
     */
    addZone(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addZone', params);
    },

    /**
     * 删除投射区域
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    removeZone() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeZone');
    },

    /**
     * 创建普通白板参数
     * @edata
     * @typedef {Object} AddWhiteBoardParams
     * @property {Object} [param] 独立白板的初始参数
     * @property {number} width 普通白板的宽度
     * @property {number} height 普通白板的高度
     * @property {number} x 普通白板的左上角横坐标
     * @property {number} y 普通白板的左上角纵坐标
     */
    /**
     * 创建小程序普通白板
     * @eapi
     * @param {AddWhiteBoardParams} params 创建普通白板参数
     * @returns {Promise<WhiteBoardInfo>} 调用结果
     */
    addWhiteBoard(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addWhiteBoard', params);
    },

    /**
     * 移除小程序普通白板
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    removeWhiteBoard() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeWhiteBoard');
    },

    /**
     * 创建图片图层参数
     * @edata
     * @typedef {Object} ImageLayerParams
     * @property {string} md5 图片资源md5
     * @property {number} [frameRate] 帧率
     */
    /**
     * 创建小程序图片图层
     * @summary 增加图层（需要先使用hyExt.pc.downloadRes下载对应的图层资源）
     * - 目前仅支持一张apng文件，或者包含n张png文件的zip包，小程序会遍历zip包里面的所有图片进行轮播 
     * - zip包里面的子目录会忽略
     * @eapi
     * @param {ImageLayerParams} params 创建图片图层参数
     * @returns {Promise<LayerId>} 调用结果
     */
    addImageLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addImageLayer', params);
    },

    /**
     * 移除小程序图片图层
     * @eapi
     * @param {LayerId} params 移除涂图层信息
     * @returns {Promise<void>} 调用结果
     */
    removeImageLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeImageLayer', params);
    },

    /**
     * 脸部效果参数
     * @edata
     * @typedef {Object} FaceEffectParams
     * @property {string} md5 变脸效果的md5
     * @property {boolean} enable 是否启用
     */
    /**
     * 使用脸部效果
     * @summary 要用摄像头开播，打开美颜模式才有效果
     * @eapi
     * @param {FaceEffectParams} params 调用参数
     * @returns {Promise<void>} 调用结果
     */
    enableFaceEffect(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'enableFaceEffect', params);
    },

    /**
     * 创建EXE白板参数
     * @edata
     * @typedef {Object} ExeWhiteBoardParams
     * @property {string} sharedhandle 第三方EXE的共享纹理句柄，用于把EXE的界面投屏到主播端
     * @property {number} x EXE白板的左上角横坐标
     * @property {number} y EXE白板的左上角纵坐标
     * @property {number} width EXE白板的宽度
     * @property {number} height EXE白板的高度
     */
    /**
     * 创建小程序EXE白板
     * @eapi
     * @param {ExeWhiteBoardParams} params 创建EXE白板参数
     * @returns {Promise<void>} 调用结果
     */
    addExeWhiteBoard(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addExeWhiteBoard', params);
    },

    /**
     * 移除小程序EXE白板
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    removeExeWhiteBoard() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeExeWhiteBoard');
    },

    /**
     * 独立白板消息回调
     * @edata
     * @callback WhiteBoardMessageCallback
     * @param {string} data 消息内容
     */
    /**
     * 监听独立白板消息参数
     * @edata
     * @typedef {Object} WhiteBoardMessageParams
     * @property {WhiteBoardMessageCallback} callback 独立白板消息回调
     */
    /**
     * 监听小程序独立白板消息
     * @eapi
     * @param {WhiteBoardMessageParams} params 监听独立白板消息参数
     * @returns {Promise<void>} 调用结果
     */
    onExtraWhiteBoardMessage(params) {
      return extsdk.core.onEvent(MODULE_NAME$5, 'onExtraWhiteBoardMessage', params);
    },

    /**
     * 创建文字图层参数
     * @edata
     * @typedef {Object} TextLayerParams
     * @property {string} [layerId] 文字图层id
     * @property {string} text 文字图层内容
     * @property {string} [fontFamily] 文字图层字体
     * @property {number} [fontSize] 文字图层字体大小
     * @property {string} [fontColor] 字图层字体颜色
     * @property {boolean} [useBackground] 是否带背景
     * @property {string} [backgroundColor] 文字图层背景颜色
     * @property {number} [alpha] 文字图层不透明度
     * @property {boolean} [bold] 是否加粗
     * @property {boolean} [italic] 是否斜体
     * @property {boolean} [underline] 是否带下划线
     * @property {boolean} [scroll] 是否滚动
     */
    /**
     * 创建小程序文字图层
     * @eapi
     * @param {TextLayerParams} params 文字图层参数
     * @returns {Promise<LayerId>} 调用结果
     */
    addTextLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addTextLayer', params);
    },

    /**
     * 移除文本图层
     * @eapi
     * @param {LayerId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    removeTextLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeTextLayer', params);
    },

    /**
     * 启用背景分离
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    enableBackgroundSegmentation() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'enableBackgroundSegmentation');
    },

    /**
     * 禁用背景分离
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    disableBackgroundSegmentation() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'disableBackgroundSegmentation');
    },

    /**
     * 创建白板参数
     * @edata
     * @typedef {Object} WBParams
     * @property {string} type 白板类型, EXTRA-独立白板(默认), EXE-EXE白板, NORMAL-普通白板
     * @property {string} wbName 业务传入的白板标识
     * @property {number} offsetX 相对推流出去的界面左侧的偏移量（单位是像素）
     * @property {number} offsetY 相对推流出去的界面顶部的偏移量（单位是像素）
     * @property {number} canvasWidth 推流出去的界面里白板图层占的宽度（单位是像素）
     * @property {number} canvasHeight 推流出去的界面里白板图层占的高度（单位是像素
     * @property {number} [x] 白板左侧偏移量（单位是像素
     * @property {number} [y] 白板顶部偏移量（单位是像素）
     * @property {number} width 白板区域宽度（单位是像素）
     * @property {number} height 白板高度（单位是像素）
     * @property {boolean} [force] 强制使用当前配置
     * @property {Object} [param] 参数
     * @property {boolean} [combinable] 是否合流
     * @property {boolean} [editable] 是否可编辑
     * 
     */
    /**
     * 创建白板
     * @eapi
     * @param {WBParams} params 创建白板参数
     * @returns {Promise<WhiteBoardInfo>} 调用结果
     */
    createWB(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'createWB', params);
    },

    /**
     * 删除白板
     * @eapi
     * @param {WhiteBoardInfo} params 参数
     * @returns {Promise<void>} 调用结果
     */
    deleteWB(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'deleteWB', params);
    },

    /**
     * 白板布局数据
     * @edata
     * @typedef {Object} WBLayoutInfo
     * @property {number} offsetX 相对推流出去的界面左侧的偏移量（PC主播端单位是像素，助手单位是点）
     * @property {number} offsetY 相对推流出去的界面顶部的偏移量（PC主播端单位是像素，助手单位是点）
     * @property {number} canvasWidth 推流出去的界面里白板图层占的宽度（PC主播端单位是像素，助手单位是点）
     * @property {number} canvasHeight 推流出去的界面里白板图层占的高度（PC主播端单位是像素，助手单位是点）
     */
    /**
     * 白板布局变化信息
     * @edata
     * @typedef {Object} ChangedLayoutInfo
     * @property {WBLayoutInfo} data 布局数据
     */
    /**
     * 白板布局变化回调
     * @edata
     * @callback WBLayoutChangeCallback
     * @param {ChangedLayoutInfo} layoutInfo 布局信息
     */
    /**
     * 监听参数
     * @edata
     * @typedef {Object} WBLayoutChangeParams 
     * @property {string} wbId 白板id
     * @property {string} [wbName] 业务传入的白板标识
     * @property {WBLayoutChangeCallback} callback 回调函数
     */
    /**
     * 监听白板布局变化消息
     * @eapi
     * @param {WBLayoutChangeParams} params 监听参数
     * @returns {Promise<void>} 调用结果
     */
    onWBLayoutChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$5, 'onWBLayoutChange', params);
    },

    /**
     * 更新白板参数
     * @edata 
     * @typedef {Object} ChangeWBParams
     * @property {string} wbId 白板id
     * @property {string} wbName 业务传入的白板标识
     * @property {number} offsetX 相对推流出去的界面左侧的偏移量(单位是像素)
     * @property {number} offsetY 相对推流出去的界面顶部的偏移量(单位是像素)
     * @property {number} canvasWidth 推流出去的界面里白板图层占的宽度(单位是像素)
     * @property {number} canvasHeight 推流出去的界面里白板图层占的高度(单位是像素)
     */
    /**
     * 更新白板
     * @eapi
     * @param {ChangeWBParams} params 更新参数
     * @returns {Promise<void>} 调用结果
     */
    updateWB(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'updateWB', params);
    },

    /**
     * 图层布局改变回调
     * @edata
     * @callback LayerLayoutChangeCallback
     * @param {LayerInfo} layoutInfo 布局信息
     */
    /**
     * 布局改变参数
     * @edata
     * @typedef {Object} LayerLayoutChangeParams
     * @property {string} layerId 图层id
     * @property {LayerLayoutChangeCallback} callback 回调函数
     */
    /**
     * 布局改变
     * @eapi
     * @param {LayerLayoutChangeParams} params 布局改变参数
     * @returns {Promise<void>} 调用结果
     */
    onLayerLayoutChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$5, 'onLayerLayoutChange', params);
    },

    /**
     * 布局信息
     * @edata
     * @typedef {Object} StreamLayoutInfo
     * @property {number} width 宽度（单位是像素)
     * @property {number} height 高度（单位是像素）
     * @property {number} x 普通白板的左上角横坐标
     * @property {number} y 普通白板的左上角纵坐标
     */
    /**
     * 获取图层画布布局信息
     * @summary 适用于获取颜值PK时视频区域相对于小程序容器的布局信息
     * @eapi
     * @returns {Promise<StreamLayoutInfo>} 调用结果
     */
    getStreamCanvasLayout() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getStreamCanvasLayout');
    },

    /**
     * 设置图层画布布局信息
     * @summary 适用于设置颜值PK时视频区域相对于小程序容器的布局信息
     * @eapi
     * @param {StreamLayoutInfo} params 参数
     * @returns {Promise<void>} 调用结果
     */
    setStreamCanvasLayout(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'setStreamCanvasLayout', params);
    },

    /**
     * 创建图层
     * @eapi
     * @param {LayerInfo} params 图层信息
     * @returns {Promise<LayerId>} 调用结果
     */
    addLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addLayer', params);
    },

    /**
     * 更新图层
     * @summary 视频图层暂不支持
     * @eapi
     * @param {LayerInfoParam|LayerId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    updateLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'updateLayer', params);
    },

    /**
     * 删除图层
     * @eapi
     * @param {LayerId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    removeLayer(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeLayer', params);
    },

    /**
     * 特效信息
     * @edata
     * @typedef {Object} EffectParams 
     * @property {string} md5 资源的md5
     * @property {string} fileName 文件名
     * @property {Object} [param] 额外参数
     */
    /**
     * 增加特效
     * @eapi
     * @param {EffectParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    addEffect(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'addEffect', params);
    },

    /**
     * 移除资源参数
     * @edata
     * @typedef {Object} RemoveEffectParams
     * @property {string} md5 资源的md5
     * @property {string} fileName 文件名
     */
    /**
     * 移除特效
     * @eapi
     * @param {RemoveEffectParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    removeEffect(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'removeEffect', params);
    },

    /**
     * 麦克风信息
     * @edata
     * @typedef {Object} MicInfo
     * @property {boolean} isOn 是否打开
     * @property {number} volume 音量
     */
    /**
     * 扬声器信息
     * @edata
     * @typedef {Object} SpeakerInfo
     * @property {boolean} isOn 是否打开
     * @property {number} volume 音量
     */
    /**
     * 伴奏信息
     * @edata
     * @typedef {Object} MusicInfo
     * @property {boolean} isOn 是否打开
     * @property {number} volume 音量
     */
    /**
     * 可见性信息
     * @edata
     * @typedef {Object} AccessibilityInfo
     * @property {boolean} isPrivate 是否打开隐私模式
     * @property {boolean} isPassword 是否打开加密模式
     */
    /**
     * 镜头信息
     * @edata
     * @typedef {Object} CameraInfo
     * @property {boolean} isOn 摄像头是否打开
     * @property {boolean} isFlip 是否开启翻转(仅PC主播端支持)
     * @property {boolean} isSplitScreen 是否开启分屏(仅PC主播端支持)
     * @property {boolean} isRhythm 是否开启律动(仅PC主播端支持)
     */
    /**
     * 特效信息
     * @edata
     * @typedef {Object} EffectInfo
     * @property {number} id id
     * @property {string} name name
     * @property {number} tab_id tab_id
     * @property {string} tab_name tab_name
     */
    /**
     * 特效信息列表
     * @edata
     * @typedef {Object} EffectListInfo
     * @property {boolean} isOn 特效是否打开
     * @property {Array.<EffectInfo>} effectList 特效信息列表
     */
    /**
     * 分辨率信息
     * @edata
     * @typedef {Object} ResolutionInfo
     * @property {number} width 横向分辨率(单位是像素)
     * @property {number} height 纵向分辨率(单位是像素)
     */
    /**
     * 画质信息
     * @edata
     * @typedef {Object} QualityInfo
     * @property {number} bitRate 码率
     * @property {number} frameRate 帧率
     * @property {ResolutionInfo} resolution 分辨率信息
     */
    /**
     * 延迟信息
     * @edata
     * @typedef {Object} DelayInfo
     * @property {number} delayTime 延迟时间(单位是秒)
     */
    /**
     * 开播信息
     * @edata
     * @typedef {Object} StreamingInfo 
     * @property {MicInfo} mic 麦克风信息
     * @property {SpeakerInfo} speaker 扬声器信息（仅PC主播端支持）
     * @property {MusicInfo} music 伴奏信息
     * @property {AccessibilityInfo} accessibility 可见性信息
     * @property {CameraInfo} camera 镜头信息
     * @property {EffectListInfo} effect 特效信息
     * @property {QualityInfo} quality 画质信息
     * @property {DelayInfo} delay 延迟信息（仅PC主播端支持）
     */
    /**
     * 获取开播信息参数
     * @edata
     * @typedef {Object} StreamingInfoParams
     * @property {Array.<string>} keys 查询的关键字
     */
    /**
     * 获取开播信息
     * @summary 各个端支持的信息字段有差异
     * - 如果某个端没有指定的信息，则返回null
     * - 传入对应的key值返回对应的value值
     * @eapi 
     * @param {StreamingInfoParams} params 参数
     * @returns {Promise<StreamingInfo>} 调用结果
     */
    getStreamingInfo(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getStreamingInfo', params);
    },

    /**
     * 是否启用白板编辑模式参数
     * @edata
     * @typedef {Object} SetWBEditModeParams
     * @property {boolean} enable 是否启用
     */
    /**
     * 设置是否启用白板编辑模式
     * @eapi 
     * @param {SetWBEditModeParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    setWBEditMode(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'setWBEditMode', params);
    },

    /**
     * 当前特效信息
     * @edata
     * @typedef {Object} CurrentEffectInfo
     * @property {string} md5 资源的md5
     * @property {string} fileName 文件名
     * @property {Object} param 额外参数
     */
    /**
     * 获取当前特效列表
     * @eapi
     * @returns {Promise<Array.<CurrentEffectInfo>>} 当前应用的特效列表
     */
    getCurrentEffects(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getCurrentEffects', params);
    },

    /**
     * pk连麦图层布局信息
     * @edata
     * @typedef {Object} LinkLayerLayout 
     * @property {number} offsetX 图层相对推流出去的界面左侧的偏移量（单位是像素）
     * @property {number} offsetY 图层相对推流出去的界面顶部的偏移量（单位是像素）
     * @property {number} canvasWidth 推流出去的界面里图层占的宽度（单位是像素）
     * @property {number} canvasHeight 推流出去的界面里图层占的高度（单位是像素）
     */
    /**
     * 获取PK连麦的视频图层布局信息
     * @eapi
     * @returns {Promise<Array.<LinkLayerLayout>>} 返回布局信息
     */
    getLinkLayersLayout() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getLinkLayersLayout');
    },

    /**
     * 图层状态信息
     * @edata 
     * @typedef {Object} LayerStatusInfo
     * @property {string} layerId 图层id
     * @property {string} type 图层类型
     * @property {string} layerName 业务传入的图层标识
     * @property {string} status 图层状态, VISIBLE-显示(默认), HIDDEN-隐藏, CLOSED-关闭
     * @property {Object} param 额外参数
     */
    /**
     * @edata
     * @callback LayerStatusChangeCallback
     * @param {LayerStatusInfo} statusInfo 布局信息
     */
    /**
     * 监听图层状态变化消息参数
     * @edata
     * @typedef {Object} OnLayerStatusChangeParams 
     * @property {string} layerId 图层id
     * @property {LayerStatusChangeCallback} callback 回调函数
     */
    /**
     * 监听图层状态变化消息
     * @eapi
     * @since 2.10.0
     * @param {OnLayerStatusChangeParams} params 参数
     * @returns {Promise<void>} 
     */
    onLayerStatusChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$5, 'onLayerStatusChange', params);
    },

    /**
     * 取消监听图层状态变化消息参数
     * @edata
     * @typedef {Object} OffLayerStatusChangeParams 
     * @property {string} layerId 图层id
     * @property {LayerStatusChangeCallback} callback 回调函数
     */
    /**
     * 取消监听图层状态变化消息
     * @eapi
     * @since 2.10.0
     * @param {OffLayerStatusChangeParams} params 参数
     * @returns {Promise<void>} 
     */
    offLayerStatusChange(params) {
      return extsdk.core.offEvent(MODULE_NAME$5, 'offLayerStatusChange', params);
    },

    /**
     * 布局信息
     * @edata
     * @typedef {Object} GetLayoutInfo
     * @property {number} x 左上角的横坐标，相对于推流分辨率
     * @property {number} y 左上角的纵坐标，相对于推流分辨率
     * @property {number} width 图层宽度，相对于推流分辨率
     * @property {number} height 图层高度，相对于推流分辨率
     */
    /**
     * 图层信息
     * @edata
     * @typedef {Object} GetLayerInfo
     * @property {string} id 根据这个id可以判断这个图层是否为当前小程序创建的图层
     * @property {string} type 图层类型
     * @property {boolean} isVisible 是否显示
     * @property {number} order 层级，0为最上层
     * @property {GetLayoutInfo} layout 布局信息
     */
    /**
     * @edata
     * @typedef {Object} LayerInfoResp 返回图层信息
     * @property {Array.<GetLayerInfo>} layerInfoList 图层信息列表
     */
    /**
     * 获取图层信息
     * @eapi
     * @since 2.13.0
     * @param {Object} [params] 参数
     * @returns {Promise<LayerInfoResp>} 
     */
    getLayerInfo(params) {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getLayerInfo', params);
    },

    /**
     * @edata
     * @typedef {Object} StreamNameInfo 播放的流名称信息
     * @property {string} streamName 当前播放的流名称
     */
    /**
     * 获取当前播放的流名称
     * @eapi
     * @since 3.6.0
     * @returns {Promise<StreamNameInfo>} 调用结果
     */
    getCurrentStreamName() {
      return extsdk.core.callEvent(MODULE_NAME$5, 'getCurrentStreamName');
    },

    /**
     * @edata
     * @callback CurrentStreamNameChangeCallback 流名称变化回调
     * @param {StreamNameInfo} info 流名称信息
     */
    /**
     * @edata
     * @typedef {Object} CurrentStreamNameChangeReq 监听当前播放的流名称变化参数
     * @property {CurrentStreamNameChangeCallback} callback 流名称变化回调
     */
    /**
     * 监听当前播放的流名称变化
     * @eapi
     * @since 3.6.0
     * @param {CurrentStreamNameChangeReq} params 输入参数
     * @returns {Promise<void>} 调用结果
     */
    onCurrentStreamNameChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$5, 'onCurrentStreamNameChange', params);
    },

    /**
     * 取消监听当前播放的流名称变化
     * @eapi
     * @since 3.6.0
     * @returns {Promise<void>} 调用结果
     */
    offCurrentStreamNameChange() {
      return extsdk.core.offEvent(MODULE_NAME$5, 'offCurrentStreamNameChange');
    },
  }
};

/** @ignore */
const MODULE_NAME$4 = 'HYExtTheme';

var HYExtTheme = {
  /**
   * theme
   * @namespace theme
   */
  theme: {
    /**
     * 模式信息
     * @edata
     * @typedef {Object} ThemeRsp
     * @property {string} currentTheme 当前模式；取值范围：light 明亮模式；dark 暗黑模式；
     */
    /**
     * 获取当前是否暗黑模式
     * @eapi
     * @since 3.3.0
     * @returns {Promise<ThemeRsp>} 调用结果
     */
    getCurrentTheme() {
      return extsdk.core.callEvent(MODULE_NAME$4, 'getCurrentTheme');
    },

    /**
     * 回调模式信息
     * @edata
     * @typedef {Object} ThemeInfo
     * @property {string} currentTheme 当前模式；取值范围：light 明亮模式；dark 暗黑模式；
     */
    /**
     * @edata
     * 音量变化回调
     * @callback ThemeChangeCallback
     * @param {ThemeInfo} info 主题信息
     */
    /**
     * 监听模式变化参数
     * @edata
     * @typedef {Object} ThemeChangeParam
     * @property {ThemeChangeCallback} callback 模式变化回调
     */
    /**
     * 监听模式变化
     * @eapi
     * @since 3.3.0
     * @param {ThemeChangeParam} params 监听模式变化参数
     * @returns {Promise<void>} 调用结果
     */
    onThemeChange(params) {
      return extsdk.core.onEvent(MODULE_NAME$4, 'onThemeChange', params);
    },

    /**
     * 取消监听模式变化
     * @eapi
     * @since 3.3.0
     * @returns {Promise<void>} 调用结果
     */
    offThemeChange() {
      return extsdk.core.offEvent(MODULE_NAME$4, 'offThemeChange');
    },

  }
};

/** @ignore */
const MODULE_NAME$3 = 'HYExtUI';

var HYExtUI = {
  /**
   * ui
   * @namespace ui
   */
  ui: {
    /**
     * 设置参数
     * @edata
     * @typedef {Object} BadgeStatusParams
     * @property {boolean} visible 红点是否可见
     */
    /**
     * 设置开放平台互动入口红点显示状态
     * @summary 仅适用于有开放平台互动入口的小程序类型调用
     * @eapi
     * @since 2.9.11
     * @param {BadgeStatusParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    setOpenPlatformBadgeStatus(params) {
      return extsdk.core.callEvent(MODULE_NAME$3, 'setOpenPlatformBadgeStatus', params);
    },

    /**
     * 弹窗的宽高信息
     * @edata
     * @typedef {Object} H5PopupSize
     * @property {number} width 宽，单位像素
     * @property {number} height 高，单位像素
     */
    /**
     * 拖动区域的布局信息
     * @edata
     * @typedef {Object} H5PopupDragSize
     * @property {number} x 距左侧距离，单位像素
     * @property {number} y 距顶部距离，单位像素
     * @property {number} width 拖动区域宽度，单位像素
     * @property {number} height 拖动区域高度，单位像素
     */
    /**
     * 弹出H5窗口参数
     * @edata
     * @typedef {Object} H5PopupParams
     * @property {string} url URL
     * @property {string} name 名称
     * @property {boolean} titlelbar 是否需要标题栏
     * @property {H5PopupSize} layout 弹窗的宽高信息
     * @property {H5PopupDragSize} dragHandleLayout 拖动区域的布局信息
     */
    /**
     * 弹出H5小程序窗口
     * @summary 弹出的小程序窗口需要支持虎牙小程序SDK的所有接口功能
     * @eapi
     * @since 2.14.0
     * @param {H5PopupParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    openH5MiniappPopup(params) {
      return extsdk.core.callEvent(MODULE_NAME$3, 'openH5MiniappPopup', params);
    },

    /**
     * 设置小程序入口自定义文案参数
     * @edata
     * @typedef {Object} EntranceTextParams
     * @property {string} text 要设置的自定义文案，如果传空字符串就不显示任何内容（包括文案背景）
     * @property {string} [toast] 入口的toast，如果传空字符串就不显示toast
     * @property {string} [toastAction] toast上的按钮，如果传空字符串就不显示按钮
     * @property {string} [toastActionID] toast上的按钮ID，用于区分点击按钮
     */
    /**
     * 设置小程序入口自定义文案
     * @eapi
     * @since 2.15.2
     * @param {EntranceTextParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    setEntranceText(params) {
      return extsdk.core.callEvent(MODULE_NAME$3, 'setEntranceText', params);
    },

    /**
     * 开启或者关闭穿透模式参数
     * @edata
     * @typedef {Object} GesturePenetrationParams
     * @property {boolean} enable 开启或者关闭穿透模式
     */
    /**
     * 开启或者关闭穿透模式
     * @summary 开启穿透模式后opacity或rgba颜色值取值说明：
     * 合法取值范围：0.00-1.00；
     * 取值为 0 时点击穿透；
     * 取值 0.005 以上点击不穿透；
     * @eapi
     * @since 3.4.1
     * @param {GesturePenetrationParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    setGesturePenetration(params) {
      return extsdk.core.callEvent(MODULE_NAME$3, 'setGesturePenetration', params);
    },

    /**
     * @edata
     * 入口toast按钮点击回调数据
     * @typedef {Object} ClickToastInfo
     * @property {string} toastActionID 点击的按钮ID
     * @property {string} toastAction 点击的按钮文案
     */
    /**
     * @edata
     * 入口toast按钮点击回调
     * @callback EnterToastClick
     * @param {ClickToastInfo} info 按钮点击回调数据
     */
    /**
     * @edata
     * 入口toast按钮点击参数
     * @typedef {Object} OnEnterToastClick
     * @property {EnterToastClick} callback 入口toast按钮点击回调
     */
    /**
     * 监听小程序入口提示按钮点击
     * @eapi
     * @since 3.5.0
     * @param {OnEnterToastClick} params 参数
     * @returns {Promise<void>} 调用结果
     */
    onEntranceToastClick(params) {
      return extsdk.core.onEvent(MODULE_NAME$3, 'onEntranceToastClick', params);
    },

    /**
     * 取消监听小程序入口提示按钮点击
     * @eapi
     * @since 3.5.0
     * @returns {Promise<void>} 调用结果
     */
    offEntranceToastClick() {
      return extsdk.core.offEvent(MODULE_NAME$3, 'offEntranceToastClick');
    },


    /**
     * @edata
     * @typedef {Object} TriggerVideoClickReq 触发播放器点击参数
     * @property {number} button MouseEvent.button
     * @property {number} clientX 点击位置距离浮窗容器左上角的x轴坐标，单位是像素
     * @property {number} clientY 点击位置距离浮窗容器左上角的y轴坐标，单位是像素
     */
    /**
     * 触发播放器点击
     * @eapi
     * @since 3.6.1
     * @param {TriggerVideoClickReq} params 调用参数
     * @returns {Promise<void>} 调用结果
     */
    triggerVideoClick(params) {
      return extsdk.core.callEvent(MODULE_NAME$3, 'triggerVideoClick', params);
    },

    /**
     * @edata
     * @typedef {Object} ShowInputBarRsp 键盘输入返回
     * @property {string} text 输入的文字
     */
    /**
     * @edata
     * @typedef {Object} ShowInputBarReq 展示APP端键盘输入框参数
     * @property {string} [text] 默认文字
     * @property {string} [placeholder] 默认提示文字
     */
    /**
     * 展示键盘输入框
     * @eapi
     * @since 3.11.1
     * @param {ShowInputBarReq} params 调用参数
     * @returns {Promise<ShowInputBarRsp>} 调用结果
     */
    showNativeInputBar(params) {
      return extsdk.core.callEvent(MODULE_NAME$3, 'showNativeInputBar', params);
    },

  }
};

/** @ignore */
const MODULE_NAME$2 = 'HYExtVideo';

var HYExtVideo = {
  /**
   * HY vidoe
   * @namespace hyv
   */
  hyv: {
    /**
     * 打开视频播放页参数
     * @edata
     * @typedef {Object} OpenVideoParams
     * @property {string} vid 视频ID
     */
    /**
     * 打开虎牙视频播放页
     * @eapi
     * @param {OpenVideoParams} params 参数
     * @returns {Promise<void>} 调用结果
     */
    openVideo(params) {
      return extsdk.core.callEvent(MODULE_NAME$2, 'openVideo', params);
    }
  }
};

/** @ignore */
const MODULE_NAME$1 = 'HYExtView';

var HYExtView = {
  /**
   * 视图相关
   * @namespace view
   */
  view: {
    /**
     * 分身信息
     * @edata
     * @typedef {Object} SubViewId
     * @property {string} subViewId 分身Id
     */
    /**
     * 布局信息
     * @edata
     * @typedef {Object} Layout
     * @property {number} width 宽度占位置的比例
     * @property {number} ratio 宽高比
     * @property {number} top 左上角的纵坐标占位置的比例
     * @property {number} left 左上角的横坐标占位置的比例
     */
    /**
     * 创建分身参数
     * @edata
     * @typedef {Object} SubViewParams
     * @property {string} position 位置, player-视频区, chatroom-公屏
     * @property {Layout} layout 布局信息
     * @property {number} [level] 层级
     * @property {number} [weight] 权重
     * @property {Object} [param] 初始化参数
     */
    /**
     * 创建分身
     * @eapi
     * @param {SubViewParams} params 创建分身参数
     * @returns {Promise<SubViewId>} 调用结果
     */
    createSubView(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'createSubView', params);
    },

    /**
     * 销毁分身
     * @eapi
     * @param {SubViewId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    destroySubView(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'destroySubView', params);
    },

    /**
     * 隐藏当前分身
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    hideCurrentView() {
      return extsdk.core.callEvent(MODULE_NAME$1, 'hideCurrentView');
    },

    /**
     * 隐藏分身
     * @eapi
     * @param {SubViewId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    hideSubView(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'hideSubView', params);
    },

    /**
     * 显示分身
     * @eapi
     * @param {SubViewId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    showSubView(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'showSubView', params);
    },

    /**
     * 弹窗信息
     * @edata
     * @typedef {Object} PopupId
     * @property {string} popupId 弹窗id
     */
    /**
     * 配置参数
     * @edata
     * @typedef {Object} PopupConfig
     * @property {number} handleX handleX
     * @property {number} handleY handleY
     * @property {number} handleWidth handleWidth
     * @property {number} handleHeight handleHeight
     */
    /**
     * 创建浮窗参数
     * @edata
     * @typedef {Object} PopupParams
     * @property {number} width 宽
     * @property {number} height 高
     * @property {PopupConfig} [config] 配置参数
     * @property {Object} [param] 传给弹窗的初始化参数
     */
    /**
     * 创建浮窗
     * @eapi
     * @param {PopupParams} params 创建浮窗参数
     * @returns {Promise<PopupId>} 调用结果
     */
    createPopup(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'createPopup', params);
    },

    /**
     * 摧毁浮窗
     * @eapi
     * @param {PopupId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    destroyPopup(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'destroyPopup', params);
    },

    /**
     * 隐藏当前浮窗
     * @eapi
     * @returns {Promise<void>} 调用结果
     */
    hideCurrentPopup() {
      return extsdk.core.callEvent(MODULE_NAME$1, 'hideCurrentPopup');
    },

    /**
     * 隐藏浮窗
     * @eapi
     * @param {PopupId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    hidePopup(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'hidePopup', params);
    },

    /**
     * 展示浮窗
     * @eapi
     * @param {PopupId} params 参数
     * @returns {Promise<void>} 调用结果
     */
    showPopup(params) {
      return extsdk.core.callEvent(MODULE_NAME$1, 'showPopup', params);
    }
  }
};

/** @ignore */
const MODULE_NAME = 'HYExtVip';

var HYExtVip = {
  /**
   * vip
   * @namespace vip
   */
  vip: {

    /**
     * @edata
     * @typedef {Object} JWTInfo 用户凭证信息
     * @property {string} jwt 用户凭证
     */
    /**
     * @edata
     * @typedef {Object} GetJWTReq 获取用户Token参数
     * @property {boolean} [anonymous] 是否匿名
     */
    /**
     * 获取当前用户Token
     * @eapi
     * @param {GetJWTReq} [params] 参数
     * @returns {Promise<JWTInfo>} 返回凭证信息
     */
    getJWT(params) {
      return extsdk.core.callEvent(MODULE_NAME, 'getJWT', params);
    }
  }
};

var api = {
  ...error,
  ...localStorage$1,
  ...logger,
  ...network,
  ...storage,
  ...system$1,
  ...HYExtAR,
  ...HYExtAction,
  ...HYExtAdvance,
  ...HYExtApp,
  ...HYExtAppState,
  ...HYExtBackend,
  ...HYExtConsts,
  ...HYExtContext$2,
  ...HYExtDC,
  ...HYExtDevice,
  ...HYExtEBS,
  ...HYExtEnv,
  ...HYExtExe,
  ...HYExtFeedback,
  ...HYExtFs,
  ...HYExtGame,
  ...HYExtInteract,
  ...HYExtLeaf,
  ...HYExtLink,
  ...HYExtLiveEvent,
  ...HYExtOB,
  ...HYExtObserver,
  ...HYExtOrder,
  ...HYExtPC,
  ...HYExtPK,
  ...HYExtPanel,
  ...HYExtPlayer,
  ...HYExtPopup,
  ...HYExtReg,
  ...HYExtRevenue,
  ...HYExtStream,
  ...HYExtTheme,
  ...HYExtUI,
  ...HYExtVideo,
  ...HYExtView,
  ...HYExtVip
};

const sdk = api.default || api;
const _global = (typeof window !== 'undefined' && window) || (typeof commonjsGlobal !== 'undefined' && commonjsGlobal) || {};
_global["hyExt"] = sdk;

try {
  const basicSdk = extsdk.default || extsdk || {};
  basicSdk.core.init();
} catch (err) {
  console.warn('sdk init fail', err);
}

var rn = sdk;

export { rn as default };
