apis.js 4.5 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2
const base = [
  'base64ToArrayBuffer',
fxy060608's avatar
fxy060608 已提交
3 4 5
  'arrayBufferToBase64',
  'addInterceptor',
  'removeInterceptor'
fxy060608's avatar
fxy060608 已提交
6 7 8 9 10 11 12 13 14 15 16 17
]

const network = [
  'request',
  'uploadFile',
  'downloadFile',
  'connectSocket',
  'onSocketOpen',
  'onSocketError',
  'sendSocketMessage',
  'onSocketMessage',
  'closeSocket',
18 19
  'onSocketClose',
  'getUpdateManager'
fxy060608's avatar
fxy060608 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
]

const route = [
  'navigateTo',
  'redirectTo',
  'reLaunch',
  'switchTab',
  'navigateBack'
]

const storage = [
  'setStorage',
  'setStorageSync',
  'getStorage',
  'getStorageSync',
  'getStorageInfo',
  'getStorageInfoSync',
  'removeStorage',
  'removeStorageSync',
  'clearStorage',
  'clearStorageSync'
]

const location = [
  'getLocation',
  'chooseLocation',
  'openLocation',
  'createMapContext'
]

const media = [
  'chooseImage',
  'previewImage',
  'getImageInfo',
  'saveImageToPhotosAlbum',
  'compressImage',
  'getRecorderManager',
  'getBackgroundAudioManager',
Q
qiang 已提交
58
  'createAudioContext',
fxy060608's avatar
fxy060608 已提交
59 60 61 62 63
  'createInnerAudioContext',
  'chooseVideo',
  'saveVideoToPhotosAlbum',
  'createVideoContext',
  'createCameraContext',
64
  'createLivePlayerContext',
65
  'createLivePusherContext'
fxy060608's avatar
fxy060608 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
]

const device = [
  'getSystemInfo',
  'getSystemInfoSync',
  'canIUse',
  'onMemoryWarning',
  'getNetworkType',
  'onNetworkStatusChange',
  'onAccelerometerChange',
  'startAccelerometer',
  'stopAccelerometer',
  'onCompassChange',
  'startCompass',
  'stopCompass',
  'onGyroscopeChange',
  'startGyroscope',
  'stopGyroscope',
  'makePhoneCall',
  'scanCode',
  'setClipboardData',
  'getClipboardData',
  'setScreenBrightness',
  'getScreenBrightness',
  'setKeepScreenOn',
  'onUserCaptureScreen',
  'vibrateLong',
  'vibrateShort',
  'addPhoneContact',
  'openBluetoothAdapter',
  'startBluetoothDevicesDiscovery',
  'onBluetoothDeviceFound',
  'stopBluetoothDevicesDiscovery',
  'onBluetoothAdapterStateChange',
  'getConnectedBluetoothDevices',
  'getBluetoothDevices',
  'getBluetoothAdapterState',
  'closeBluetoothAdapter',
  'writeBLECharacteristicValue',
  'readBLECharacteristicValue',
  'onBLEConnectionStateChange',
  'onBLECharacteristicValueChange',
  'notifyBLECharacteristicValueChange',
  'getBLEDeviceServices',
  'getBLEDeviceCharacteristics',
  'createBLEConnection',
  'closeBLEConnection',
  'onBeaconServiceChange',
  'onBeaconUpdate',
  'getBeacons',
  'startBeaconDiscovery',
Q
qiang 已提交
117 118 119
  'stopBeaconDiscovery',
  'checkIsSupportSoterAuthentication',
  'checkIsSoterEnrolledInDevice',
120
  'startSoterAuthentication',
d-u-a's avatar
d-u-a 已提交
121
  'onUIStyleChange'
fxy060608's avatar
fxy060608 已提交
122 123 124
]

const keyboard = [
125
  'hideKeyboard',
126
  'onKeyboardHeightChange'
fxy060608's avatar
fxy060608 已提交
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
]

const ui = [
  'showToast',
  'hideToast',
  'showLoading',
  'hideLoading',
  'showModal',
  'showActionSheet',
  'setNavigationBarTitle',
  'setNavigationBarColor',
  'showNavigationBarLoading',
  'hideNavigationBarLoading',
  'setTabBarItem',
  'setTabBarStyle',
  'hideTabBar',
  'showTabBar',
  'setTabBarBadge',
  'removeTabBarBadge',
  'showTabBarRedDot',
  'hideTabBarRedDot',
148
  'onTabBarMidButtonTap',
fxy060608's avatar
fxy060608 已提交
149 150 151 152 153 154 155 156 157 158
  'setBackgroundColor',
  'setBackgroundTextStyle',
  'createAnimation',
  'pageScrollTo',
  'onWindowResize',
  'offWindowResize',
  'loadFontFace',
  'startPullDownRefresh',
  'stopPullDownRefresh',
  'createSelectorQuery',
159
  'createIntersectionObserver',
160
  'getMenuButtonBoundingClientRect'
fxy060608's avatar
fxy060608 已提交
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
]

const event = [
  '$emit',
  '$on',
  '$once',
  '$off'
]

const file = [
  'saveFile',
  'getSavedFileList',
  'getSavedFileInfo',
  'removeSavedFile',
  'getFileInfo',
  'openDocument',
  'getFileSystemManager'
]

const canvas = [
  'createOffscreenCanvas',
  'createCanvasContext',
  'canvasToTempFilePath',
  'canvasPutImageData',
  'canvasGetImageData'
]

const third = [
  'getProvider',
  'login',
  'checkSession',
  'getUserInfo',
  'share',
雪洛's avatar
雪洛 已提交
194
  'shareWithSystem',
fxy060608's avatar
fxy060608 已提交
195 196 197 198 199 200 201
  'showShareMenu',
  'hideShareMenu',
  'requestPayment',
  'subscribePush',
  'unsubscribePush',
  'onPush',
  'offPush',
fxy060608's avatar
fxy060608 已提交
202
  'requireNativePlugin',
Q
qiang 已提交
203 204 205
  'upx2px',
  'restoreGlobal',
  'getSubNVueById',
206 207 208 209
  'getCurrentSubNVue',
  'setPageMeta',
  'onNativeEventReceive',
  'sendNativeEvent',
Q
qiang 已提交
210 211
  'preloadPage',
  'unPreloadPage',
fxy060608's avatar
fxy060608 已提交
212
  'loadSubPackage'
fxy060608's avatar
fxy060608 已提交
213
]
fxy060608's avatar
fxy060608 已提交
214

215
const ad = [
d-u-a's avatar
d-u-a 已提交
216 217 218
  'createRewardedVideoAd'
]

fxy060608's avatar
fxy060608 已提交
219 220 221 222 223 224 225 226 227 228
const apis = [
  ...base,
  ...network,
  ...route,
  ...storage,
  ...location,
  ...media,
  ...device,
  ...keyboard,
  ...ui,
fxy060608's avatar
fxy060608 已提交
229 230
  ...event,
  ...file,
fxy060608's avatar
fxy060608 已提交
231
  ...canvas,
232
  ...third,
d-u-a's avatar
d-u-a 已提交
233
  ...ad
fxy060608's avatar
fxy060608 已提交
234 235
]

236
module.exports = apis