apis.js 5.9 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
]

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

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

const location = [
  'getLocation',
  'chooseLocation',
  'openLocation',
L
lixu 已提交
49 50 51 52 53 54 55
  'createMapContext',
  'onLocationChange',
  'onLocationChangeError',
  'startLocationUpdate',
  'stopLocationUpdate',
  'offLocationChange',
  'offLocationChangeError'
fxy060608's avatar
fxy060608 已提交
56 57 58 59
]

const media = [
  'chooseImage',
60
  'chooseFile',
fxy060608's avatar
fxy060608 已提交
61
  'previewImage',
D
DCloud_LXH 已提交
62
  'closePreviewImage',
fxy060608's avatar
fxy060608 已提交
63
  'getImageInfo',
Q
qiang 已提交
64
  'getVideoInfo',
fxy060608's avatar
fxy060608 已提交
65 66
  'saveImageToPhotosAlbum',
  'compressImage',
Q
qiang 已提交
67
  'compressVideo',
fxy060608's avatar
fxy060608 已提交
68 69
  'getRecorderManager',
  'getBackgroundAudioManager',
Q
qiang 已提交
70
  'createAudioContext',
fxy060608's avatar
fxy060608 已提交
71 72 73 74 75
  'createInnerAudioContext',
  'chooseVideo',
  'saveVideoToPhotosAlbum',
  'createVideoContext',
  'createCameraContext',
76
  'createLivePlayerContext',
77
  'createLivePusherContext'
fxy060608's avatar
fxy060608 已提交
78 79 80 81 82
]

const device = [
  'getSystemInfo',
  'getSystemInfoSync',
83 84 85
  'getWindowInfo',
  'getDeviceInfo',
  'getAppBaseInfo',
fxy060608's avatar
fxy060608 已提交
86 87 88 89
  'canIUse',
  'onMemoryWarning',
  'getNetworkType',
  'onNetworkStatusChange',
90
  'offNetworkStatusChange',
fxy060608's avatar
fxy060608 已提交
91
  'onAccelerometerChange',
Q
qiang 已提交
92
  'offAccelerometerChange',
fxy060608's avatar
fxy060608 已提交
93 94 95
  'startAccelerometer',
  'stopAccelerometer',
  'onCompassChange',
Q
qiang 已提交
96
  'offCompassChange',
fxy060608's avatar
fxy060608 已提交
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 124 125 126 127 128 129
  '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',
130 131
  'closeBLEConnection',
  'setBLEMTU',
132
  'getBLEDeviceRSSI',
fxy060608's avatar
fxy060608 已提交
133 134 135 136
  'onBeaconServiceChange',
  'onBeaconUpdate',
  'getBeacons',
  'startBeaconDiscovery',
Q
qiang 已提交
137 138 139
  'stopBeaconDiscovery',
  'checkIsSupportSoterAuthentication',
  'checkIsSoterEnrolledInDevice',
140
  'startSoterAuthentication',
141
  'onThemeChange',
D
DCloud_LXH 已提交
142
  'offThemeChange',
143 144
  'onUIStyleChange',
  'getSystemSetting',
D
DCloud_LXH 已提交
145 146
  'getAppAuthorizeSetting',
  'openAppAuthorizeSetting'
fxy060608's avatar
fxy060608 已提交
147 148 149
]

const keyboard = [
150
  'hideKeyboard',
151
  'onKeyboardHeightChange',
152
  'offKeyboardHeightChange',
153
  'getSelectedTextRange'
fxy060608's avatar
fxy060608 已提交
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
]

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

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',
236
  'getUserProfile',
Q
qiang 已提交
237 238
  'preLogin',
  'closeAuthView',
239
  'getCheckBoxState',
240
  'getUniverifyManager',
fxy060608's avatar
fxy060608 已提交
241
  'share',
雪洛's avatar
雪洛 已提交
242
  'shareWithSystem',
fxy060608's avatar
fxy060608 已提交
243 244 245 246 247 248 249
  'showShareMenu',
  'hideShareMenu',
  'requestPayment',
  'subscribePush',
  'unsubscribePush',
  'onPush',
  'offPush',
fxy060608's avatar
fxy060608 已提交
250
  'requireNativePlugin',
Q
qiang 已提交
251 252
  'upx2px',
  'restoreGlobal',
Q
qiang 已提交
253
  'requireGlobal',
Q
qiang 已提交
254
  'getSubNVueById',
255
  'getCurrentSubNVue',
fxy060608's avatar
fxy060608 已提交
256
  'setPageMeta',
fxy060608's avatar
fxy060608 已提交
257
  'onHostEventReceive',
258 259
  'onNativeEventReceive',
  'sendNativeEvent',
Q
qiang 已提交
260 261
  'preloadPage',
  'unPreloadPage',
fxy060608's avatar
fxy060608 已提交
262 263
  'loadSubPackage',
  'sendHostEvent',
D
DCloud_LXH 已提交
264 265 266
  'navigateToMiniProgram',
  'getLaunchOptionsSync',
  'getEnterOptionsSync'
fxy060608's avatar
fxy060608 已提交
267
]
fxy060608's avatar
fxy060608 已提交
268

269
const ad = [
Q
qiang 已提交
270
  'createRewardedVideoAd',
271
  'createFullScreenVideoAd',
272
  'createInterstitialAd',
d-u-a's avatar
d-u-a 已提交
273
  'createInteractiveAd'
d-u-a's avatar
d-u-a 已提交
274 275
]

fxy060608's avatar
fxy060608 已提交
276 277
const plugin = [
  'invokePushCallback',
278
  'getPushClientId',
fxy060608's avatar
fxy060608 已提交
279
  'onPushMessage',
D
DCloud_LXH 已提交
280
  'offPushMessage',
fxy060608's avatar
fxy060608 已提交
281
  'createPushMessage'
fxy060608's avatar
fxy060608 已提交
282 283
]

fxy060608's avatar
fxy060608 已提交
284 285 286 287 288 289 290 291 292 293
const apis = [
  ...base,
  ...network,
  ...route,
  ...storage,
  ...location,
  ...media,
  ...device,
  ...keyboard,
  ...ui,
fxy060608's avatar
fxy060608 已提交
294 295
  ...event,
  ...file,
fxy060608's avatar
fxy060608 已提交
296
  ...canvas,
297
  ...third,
fxy060608's avatar
fxy060608 已提交
298 299
  ...ad,
  ...plugin
fxy060608's avatar
fxy060608 已提交
300 301
]

Q
qiang 已提交
302
module.exports = apis