apis.js 5.6 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
  'onSocketClose',
D
DCloud_LXH 已提交
20 21
  'getUpdateManager',
  'configMTLS'
fxy060608's avatar
fxy060608 已提交
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
]

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

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

const keyboard = [
140
  'hideKeyboard',
141
  'onKeyboardHeightChange',
142
  'offKeyboardHeightChange',
143
  'getSelectedTextRange'
fxy060608's avatar
fxy060608 已提交
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
]

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

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',
226
  'getUserProfile',
Q
qiang 已提交
227 228
  'preLogin',
  'closeAuthView',
229
  'getCheckBoxState',
230
  'getUniverifyManager',
fxy060608's avatar
fxy060608 已提交
231
  'share',
雪洛's avatar
雪洛 已提交
232
  'shareWithSystem',
fxy060608's avatar
fxy060608 已提交
233 234 235 236 237 238 239
  'showShareMenu',
  'hideShareMenu',
  'requestPayment',
  'subscribePush',
  'unsubscribePush',
  'onPush',
  'offPush',
fxy060608's avatar
fxy060608 已提交
240
  'requireNativePlugin',
Q
qiang 已提交
241 242
  'upx2px',
  'restoreGlobal',
Q
qiang 已提交
243
  'requireGlobal',
Q
qiang 已提交
244
  'getSubNVueById',
245
  'getCurrentSubNVue',
fxy060608's avatar
fxy060608 已提交
246
  'setPageMeta',
fxy060608's avatar
fxy060608 已提交
247
  'onHostEventReceive',
248 249
  'onNativeEventReceive',
  'sendNativeEvent',
Q
qiang 已提交
250 251
  'preloadPage',
  'unPreloadPage',
fxy060608's avatar
fxy060608 已提交
252 253
  'loadSubPackage',
  'sendHostEvent',
D
DCloud_LXH 已提交
254 255 256
  'navigateToMiniProgram',
  'getLaunchOptionsSync',
  'getEnterOptionsSync'
fxy060608's avatar
fxy060608 已提交
257
]
fxy060608's avatar
fxy060608 已提交
258

259
const ad = [
Q
qiang 已提交
260
  'createRewardedVideoAd',
261
  'createFullScreenVideoAd',
262
  'createInterstitialAd',
d-u-a's avatar
d-u-a 已提交
263
  'createInteractiveAd'
d-u-a's avatar
d-u-a 已提交
264 265
]

fxy060608's avatar
fxy060608 已提交
266 267 268 269 270 271 272
const plugin = [
  'invokePushCallback',
  'getPushCid',
  'onPushMessage',
  'offPushMessage',
]

fxy060608's avatar
fxy060608 已提交
273 274 275 276 277 278 279 280 281 282
const apis = [
  ...base,
  ...network,
  ...route,
  ...storage,
  ...location,
  ...media,
  ...device,
  ...keyboard,
  ...ui,
fxy060608's avatar
fxy060608 已提交
283 284
  ...event,
  ...file,
fxy060608's avatar
fxy060608 已提交
285
  ...canvas,
286
  ...third,
fxy060608's avatar
fxy060608 已提交
287 288
  ...ad,
  ...plugin
fxy060608's avatar
fxy060608 已提交
289 290
]

Q
qiang 已提交
291
module.exports = apis