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

const network = [
  'request',
  'uploadFile',
  'downloadFile',
  'connectSocket',
  'onSocketOpen',
  'onSocketError',
  'sendSocketMessage',
  'onSocketMessage',
  'closeSocket',
19 20
  'onSocketClose',
  'getUpdateManager'
fxy060608's avatar
fxy060608 已提交
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
]

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',
53
  'chooseFile',
fxy060608's avatar
fxy060608 已提交
54 55
  'previewImage',
  'getImageInfo',
Q
qiang 已提交
56
  'getVideoInfo',
fxy060608's avatar
fxy060608 已提交
57 58
  'saveImageToPhotosAlbum',
  'compressImage',
Q
qiang 已提交
59
  'compressVideo',
fxy060608's avatar
fxy060608 已提交
60 61
  'getRecorderManager',
  'getBackgroundAudioManager',
Q
qiang 已提交
62
  'createAudioContext',
fxy060608's avatar
fxy060608 已提交
63 64 65 66 67
  'createInnerAudioContext',
  'chooseVideo',
  'saveVideoToPhotosAlbum',
  'createVideoContext',
  'createCameraContext',
68
  'createLivePlayerContext',
69
  'createLivePusherContext'
fxy060608's avatar
fxy060608 已提交
70 71 72 73 74 75 76 77 78
]

const device = [
  'getSystemInfo',
  'getSystemInfoSync',
  'canIUse',
  'onMemoryWarning',
  'getNetworkType',
  'onNetworkStatusChange',
79
  'offNetworkStatusChange',
fxy060608's avatar
fxy060608 已提交
80
  'onAccelerometerChange',
Q
qiang 已提交
81
  'offAccelerometerChange',
fxy060608's avatar
fxy060608 已提交
82 83 84
  'startAccelerometer',
  'stopAccelerometer',
  'onCompassChange',
Q
qiang 已提交
85
  'offCompassChange',
fxy060608's avatar
fxy060608 已提交
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 117 118
  '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',
119 120
  'closeBLEConnection',
  'setBLEMTU',
121
  'getBLEDeviceRSSI',
fxy060608's avatar
fxy060608 已提交
122 123 124 125
  'onBeaconServiceChange',
  'onBeaconUpdate',
  'getBeacons',
  'startBeaconDiscovery',
Q
qiang 已提交
126 127 128
  'stopBeaconDiscovery',
  'checkIsSupportSoterAuthentication',
  'checkIsSoterEnrolledInDevice',
129
  'startSoterAuthentication',
130
  'onThemeChange',
d-u-a's avatar
d-u-a 已提交
131
  'onUIStyleChange'
fxy060608's avatar
fxy060608 已提交
132 133 134
]

const keyboard = [
135
  'hideKeyboard',
136
  'onKeyboardHeightChange',
137
  'offKeyboardHeightChange',
138
  'getSelectedTextRange'
fxy060608's avatar
fxy060608 已提交
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
]

const ui = [
  'showToast',
  'hideToast',
  'showLoading',
  'hideLoading',
  'showModal',
  'showActionSheet',
  'setNavigationBarTitle',
  'setNavigationBarColor',
  'showNavigationBarLoading',
  'hideNavigationBarLoading',
  'setTabBarItem',
  'setTabBarStyle',
  'hideTabBar',
  'showTabBar',
  'setTabBarBadge',
  'removeTabBarBadge',
  'showTabBarRedDot',
  'hideTabBarRedDot',
160
  'onTabBarMidButtonTap',
fxy060608's avatar
fxy060608 已提交
161 162 163 164 165 166 167 168 169 170
  'setBackgroundColor',
  'setBackgroundTextStyle',
  'createAnimation',
  'pageScrollTo',
  'onWindowResize',
  'offWindowResize',
  'loadFontFace',
  'startPullDownRefresh',
  'stopPullDownRefresh',
  'createSelectorQuery',
171
  'createIntersectionObserver',
172
  'createMediaQueryObserver',
Q
qiang 已提交
173 174 175 176 177 178
  'getMenuButtonBoundingClientRect',
  'showTopWindow',
  'showLeftWindow',
  'showRightWindow',
  'hideTopWindow',
  'hideLeftWindow',
inkwalk's avatar
inkwalk 已提交
179
  'hideRightWindow',
180 181 182
  'getTopWindowStyle',
  'getLeftWindowStyle',
  'getRightWindowStyle',
inkwalk's avatar
inkwalk 已提交
183 184 185
  'setTopWindowStyle',
  'setLeftWindowStyle',
  'setRightWindowStyle'
fxy060608's avatar
fxy060608 已提交
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
]

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',
218
  'getUserProfile',
Q
qiang 已提交
219 220
  'preLogin',
  'closeAuthView',
fxy060608's avatar
fxy060608 已提交
221
  'share',
雪洛's avatar
雪洛 已提交
222
  'shareWithSystem',
fxy060608's avatar
fxy060608 已提交
223 224 225 226 227 228 229
  'showShareMenu',
  'hideShareMenu',
  'requestPayment',
  'subscribePush',
  'unsubscribePush',
  'onPush',
  'offPush',
fxy060608's avatar
fxy060608 已提交
230
  'requireNativePlugin',
Q
qiang 已提交
231 232 233
  'upx2px',
  'restoreGlobal',
  'getSubNVueById',
234 235 236 237
  'getCurrentSubNVue',
  'setPageMeta',
  'onNativeEventReceive',
  'sendNativeEvent',
Q
qiang 已提交
238 239
  'preloadPage',
  'unPreloadPage',
fxy060608's avatar
fxy060608 已提交
240
  'loadSubPackage'
fxy060608's avatar
fxy060608 已提交
241
]
fxy060608's avatar
fxy060608 已提交
242

243
const ad = [
Q
qiang 已提交
244
  'createRewardedVideoAd',
245
  'createFullScreenVideoAd',
246
  'createInterstitialAd',
d-u-a's avatar
d-u-a 已提交
247
  'createInteractiveAd'
d-u-a's avatar
d-u-a 已提交
248 249
]

fxy060608's avatar
fxy060608 已提交
250 251 252 253 254 255 256 257 258 259
const apis = [
  ...base,
  ...network,
  ...route,
  ...storage,
  ...location,
  ...media,
  ...device,
  ...keyboard,
  ...ui,
fxy060608's avatar
fxy060608 已提交
260 261
  ...event,
  ...file,
fxy060608's avatar
fxy060608 已提交
262
  ...canvas,
263
  ...third,
d-u-a's avatar
d-u-a 已提交
264
  ...ad
fxy060608's avatar
fxy060608 已提交
265 266
]

267
module.exports = apis