text: const onAndSyncApis = {
    onSocketOpen: true,
    onSocketError: true,
    onSocketMessage: true,
    onSocketClose: true,
    onBackgroundAudioPlay: true,
    onBackgroundAudioPause: true,
    onBackgroundAudioStop: true,
    onNetworkStatusChange: true,
    onAccelerometerChange: true,
    offAccelerometerChange: true,
    onCompassChange: true,
    onBluetoothAdapterStateChange: true,
    onBluetoothDeviceFound: true,
    onBLEConnectionStateChange: true,
    onBLECharacteristicValueChange: true,
    onBeaconUpdate: true,
    onBeaconServiceChange: true,
    onUserCaptureScreen: true,
    onHCEMessage: true,
    onGetWifiList: true,
    onWifiConnected: true,
    offWifiConnected: true,
    offGetWifiList: true,
    onDeviceMotionChange: true,
    setStorageSync: true,
    getStorageSync: true,
    getStorageInfoSync: true,
    removeStorageSync: true,
    clearStorageSync: true,
    getSystemInfoSync: true,
    getExtConfigSync: true,
    getLogManager: true,
    onMemoryWarning: true,
    reportMonitor: true,
    reportAnalytics: true,
    navigateToSmartGameProgram: true,
    // 文件
    getFileSystemManager: true,
  
    getLaunchOptionsSync: true,
    onPageNotFound: true,
    onError: true,
    onAppShow: true,
    onAppHide: true,
    offPageNotFound: true,
    offError: true,
    offAppShow: true,
    offAppHide: true,
    onAudioInterruptionEnd: true,
    onAudioInterruptionBegin: true,
    onLocationChange: true,
    offLocationChange: true,
  
    onLocalServiceResolveFail: true,
    onLocalServiceLost: true,
    onLocalServiceFound: true,
    onLocalServiceDiscoveryStop: true,
    offLocalServiceResolveFail: true,
    offLocalServiceLost: true,
    offLocalServiceFound: true,
    offLocalServiceDiscoveryStop: true,
  
    onGyroscopeChange: true,
    offGyroscopeChange: true
  }
  const noPromiseApis = {
    // 媒体
    stopRecord: true,
    getRecorderManager: true,
    pauseVoice: true,
    stopVoice: true,
    pauseBackgroundAudio: true,
    stopBackgroundAudio: true,
    getBackgroundAudioManager: true,
    createAudioContext: true,
    createInnerAudioContext: true,
    createVideoContext: true,
    createCameraContext: true,
    createLivePlayerContext: true,
    createLivePusherContext: true,
  
    // 位置
    createMapContext: true,
  
    // 设备
    canIUse: true,
    startAccelerometer: true,
    stopAccelerometer: true,
    startCompass: true,
    stopCompass: true,
  
    // 界面
    hideToast: true,
    hideLoading: true,
    showNavigationBarLoading: true,
    hideNavigationBarLoading: true,
    createAnimation: true,
    createSelectorQuery: true,
    createOffscreenCanvas: true,
    createCanvasContext: true,
    // createContext: true,
    drawCanvas: true,
    hideKeyboard: true,
    stopPullDownRefresh: true,
    createIntersectionObserver: true,
    nextTick: true,
  
    // 菜单
    getMenuButtonBoundingClientRect: true,
  
    onWindowResize: true,
    offWindowResize: true,
  
    // 拓展接口
    arrayBufferToBase64: true,
    base64ToArrayBuffer: true,
  
    getAccountInfoSync: true,
    getUpdateManager: true,
    createWorker: true,
  
    // 广告
    createRewardedVideoAd: true,
    createInterstitialAd: true,
  
    // 调试
    getRealtimeLogManager: true
  }
  const otherApis = {
    // 网络
    uploadFile: true,
    downloadFile: true,
    connectSocket: true,
    sendSocketMessage: true,
    closeSocket: true,
  
    // 媒体
    chooseImage: true,
    chooseMessageFile: true,
    chooseMedia: true,
    previewImage: true,
    getImageInfo: true,
    compressImage: true,
    saveImageToPhotosAlbum: true,
    startRecord: true,
    playVoice: true,
    setInnerAudioOption: true,
    getAvailableAudioSources: true,
    getBackgroundAudioPlayerState: true,
    playBackgroundAudio: true,
    seekBackgroundAudio: true,
    chooseVideo: true,
    saveVideoToPhotosAlbum: true,
    loadFontFace: true,
  
    // 文件
    saveFile: true,
    getFileInfo: true,
    getSavedFileList: true,
    getSavedFileInfo: true,
    removeSavedFile: true,
    openDocument: true,
  
    // 数据缓存
    setStorage: true,
    getStorage: true,
    getStorageInfo: true,
    removeStorage: true,
    clearStorage: true,
  
    // 导航
    navigateBack: true,
    navigateTo: true,
    redirectTo: true,
    switchTab: true,
    reLaunch: true,
  
    // 位置
    startLocationUpdate: true,
    startLocationUpdateBackground: true,
    stopLocationUpdate: true,
    getLocation: true,
    chooseLocation: true,
    openLocation: true,
  
    // 设备
    getSystemInfo: true,
    getNetworkType: true,
    makePhoneCall: true,
    scanCode: true,
    setClipboardData: true,
    getClipboardData: true,
    openBluetoothAdapter: true,
    closeBluetoothAdapter: true,
    getBluetoothAdapterState: true,
    startBluetoothDevicesDiscovery: true,
    stopBluetoothDevicesDiscovery: true,
    getBluetoothDevices: true,
    getConnectedBluetoothDevices: true,
    createBLEConnection: true,
    closeBLEConnection: true,
    getBLEDeviceServices: true,
    getBLEDeviceCharacteristics: true,
    readBLECharacteristicValue: true,
    writeBLECharacteristicValue: true,
    notifyBLECharacteristicValueChange: true,
    startBeaconDiscovery: true,
    stopBeaconDiscovery: true,
    getBeacons: true,
    setScreenBrightness: true,
    getScreenBrightness: true,
    setKeepScreenOn: true,
    vibrateLong: true,
    vibrateShort: true,
    addPhoneContact: true,
    getHCEState: true,
    startHCE: true,
    stopHCE: true,
    sendHCEMessage: true,
    startWifi: true,
    stopWifi: true,
    connectWifi: true,
    getWifiList: true,
    setWifiList: true,
    getConnectedWifi: true,
    startDeviceMotionListening: true,
    stopDeviceMotionListening: true,
  
    startGyroscope: true,
    stopGyroscope: true,
  
    // 界面
    pageScrollTo: true,
    showToast: true,
    showLoading: true,
    showModal: true,
    showActionSheet: true,
    setNavigationBarTitle: true,
    setNavigationBarColor: true,
    setTabBarBadge: true,
    removeTabBarBadge: true,
    showTabBarRedDot: true,
    hideTabBarRedDot: true,
    setTabBarStyle: true,
    setTabBarItem: true,
    showTabBar: true,
    hideTabBar: true,
    setTopBarText: true,
    startPullDownRefresh: true,
    canvasToTempFilePath: true,
    canvasGetImageData: true,
    canvasPutImageData: true,
  
    setBackgroundColor: true,
    setBackgroundTextStyle: true,
    getSelectedTextRange: true,
    hideHomeButton: true,
  
    stopLocalServiceDiscovery: true,
    startLocalServiceDiscovery: true,
  
    // 第三方平台
    getExtConfig: true,
  
    // 开放接口
    login: true,
    checkSession: true,
    authorize: true,
    getUserInfo: true,
    checkIsSupportFacialRecognition: true,
    startFacialRecognitionVerify: true,
    startFacialRecognitionVerifyAndUploadVideo: true,
    faceVerifyForPay: true,
    requestPayment: true,
    showShareMenu: true,
    hideShareMenu: true,
    updateShareMenu: true,
    getShareInfo: true,
    chooseAddress: true,
    addCard: true,
    openCard: true,
    openSetting: true,
    getSetting: true,
    getWeRunData: true,
    navigateToMiniProgram: true,
    navigateBackMiniProgram: true,
    chooseInvoice: true,
    chooseInvoiceTitle: true,
    checkIsSupportSoterAuthentication: true,
    startSoterAuthentication: true,
    checkIsSoterEnrolledInDevice: true,
  
    // 订阅消息
    requestSubscribeMessage: true,
  
    setEnableDebug: true,
    // 支付宝小程序API
    getOpenUserInfo: true,
  
    // 百度小程序专有 API
    // 百度小程序 AI 相关
    ocrIdCard: true,
    ocrBankCard: true,
    ocrDrivingLicense: true,
    ocrVehicleLicense: true,
    textReview: true,
    textToAudio: true,
    imageAudit: true,
    advancedGeneralIdentify: true,
    objectDetectIdentify: true,
    carClassify: true,
    dishClassify: true,
    logoClassify: true,
    animalClassify: true,
    plantClassify: true,
    setPageInfo: true,
  
    // 用户信息
    getSwanId: true,
    // 百度收银台支付
    requestPolymerPayment: true,
    // 打开小程序
    navigateToSmartProgram: true,
    navigateBackSmartProgram: true,
    preloadSubPackage: true
  }
  
  function initPxTransform (config) {
    const {
      designWidth = 700,
      deviceRatio = {
        '640': 2.34 / 2,
        '750': 1,
        '828': 1.81 / 2
      }
    } = config
    this.config = this.config || {}
    this.config.designWidth = designWidth
    this.config.deviceRatio = deviceRatio
  }
  
  export {
    onAndSyncApis,
    noPromiseApis,
    otherApis,
    initPxTransform
  }
  