@mpxjs/api-proxy 2.10.16 → 2.10.17-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/@types/index.d.ts CHANGED
@@ -45,9 +45,36 @@ export const offError: WechatMiniprogram.Wx['offError']
45
45
  export const createInnerAudioContext: WechatMiniprogram.Wx['createInnerAudioContext']
46
46
  export const base64ToArrayBuffer: WechatMiniprogram.Wx['base64ToArrayBuffer']
47
47
  export const arrayBufferToBase64: WechatMiniprogram.Wx['arrayBufferToBase64']
48
+ export const openBluetoothAdapter: WechatMiniprogram.Wx['openBluetoothAdapter']
49
+ export const closeBluetoothAdapter: WechatMiniprogram.Wx['closeBluetoothAdapter']
50
+ export const startBluetoothDevicesDiscovery: WechatMiniprogram.Wx['startBluetoothDevicesDiscovery']
51
+ export const stopBluetoothDevicesDiscovery: WechatMiniprogram.Wx['stopBluetoothDevicesDiscovery']
52
+ export const onBluetoothDeviceFound: WechatMiniprogram.Wx['onBluetoothDeviceFound']
53
+ export const offBluetoothDeviceFound: WechatMiniprogram.Wx['offBluetoothDeviceFound']
54
+ export const getConnectedBluetoothDevices: WechatMiniprogram.Wx['getConnectedBluetoothDevices']
55
+ export const getBluetoothAdapterState: WechatMiniprogram.Wx['getBluetoothAdapterState']
56
+ export const onBluetoothAdapterStateChange: WechatMiniprogram.Wx['onBluetoothAdapterStateChange']
57
+ export const offBluetoothAdapterStateChange: WechatMiniprogram.Wx['offBluetoothAdapterStateChange']
58
+ export const getBluetoothDevices: WechatMiniprogram.Wx['getBluetoothDevices']
59
+ export const writeBLECharacteristicValue: WechatMiniprogram.Wx['writeBLECharacteristicValue']
60
+ export const readBLECharacteristicValue: WechatMiniprogram.Wx['readBLECharacteristicValue']
61
+ export const notifyBLECharacteristicValueChange: WechatMiniprogram.Wx['notifyBLECharacteristicValueChange']
62
+ export const onBLECharacteristicValueChange: WechatMiniprogram.Wx['onBLECharacteristicValueChange']
63
+ export const offBLECharacteristicValueChange: WechatMiniprogram.Wx['offBLECharacteristicValueChange']
64
+ export const setBLEMTU: WechatMiniprogram.Wx['setBLEMTU']
65
+ export const getBLEDeviceRSSI: WechatMiniprogram.Wx['getBLEDeviceRSSI']
66
+ export const getBLEDeviceServices: WechatMiniprogram.Wx['getBLEDeviceServices']
67
+ export const getBLEDeviceCharacteristics: WechatMiniprogram.Wx['getBLEDeviceCharacteristics']
48
68
  export const closeBLEConnection: WechatMiniprogram.Wx['closeBLEConnection']
49
69
  export const createBLEConnection: WechatMiniprogram.Wx['createBLEConnection']
50
70
  export const onBLEConnectionStateChange: WechatMiniprogram.Wx['onBLEConnectionStateChange']
71
+ export const offBLEConnectionStateChange: WechatMiniprogram.Wx['offBLEConnectionStateChange']
72
+ export const startWifi: WechatMiniprogram.Wx['startWifi']
73
+ export const stopWifi: WechatMiniprogram.Wx['stopWifi']
74
+ export const getWifiList: WechatMiniprogram.Wx['getWifiList']
75
+ export const onGetWifiList: WechatMiniprogram.Wx['onGetWifiList']
76
+ export const offGetWifiList: WechatMiniprogram.Wx['offGetWifiList']
77
+ export const getConnectedWifi: WechatMiniprogram.Wx['getConnectedWifi']
51
78
  export const createCanvasContext: WechatMiniprogram.Wx['createCanvasContext']
52
79
  export const canvasToTempFilePath: WechatMiniprogram.Wx['canvasToTempFilePath']
53
80
  export const canvasGetImageData: WechatMiniprogram.Wx['canvasGetImageData']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/api-proxy",
3
- "version": "2.10.16",
3
+ "version": "2.10.17-beta.4",
4
4
  "description": "convert miniprogram API at each end",
5
5
  "module": "src/index.js",
6
6
  "types": "@types/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://github.com/didi/mpx#readme",
39
39
  "dependencies": {
40
- "@mpxjs/utils": "^2.10.16",
40
+ "@mpxjs/utils": "^2.10.17",
41
41
  "axios": "^1.7.3"
42
42
  },
43
43
  "peerDependencies": {
@@ -46,7 +46,9 @@
46
46
  "react-native-device-info": "*",
47
47
  "react-native-get-location": "*",
48
48
  "react-native-haptic-feedback": "*",
49
- "react-native-safe-area-context": "*"
49
+ "react-native-safe-area-context": "*",
50
+ "react-native-ble-manager": "*",
51
+ "react-native-wifi-reborn": "*"
50
52
  },
51
53
  "peerDependenciesMeta": {
52
54
  "@react-native-async-storage/async-storage": {
@@ -66,7 +68,12 @@
66
68
  },
67
69
  "react-native-haptic-feedback": {
68
70
  "optional": true
71
+ },
72
+ "react-native-ble-manager": {
73
+ "optional": true
74
+ },
75
+ "react-native-wifi-reborn": {
76
+ "optional": true
69
77
  }
70
- },
71
- "gitHead": "be4129320e298edf935ea35f9ca3d375f75ac51c"
78
+ }
72
79
  }
@@ -3,7 +3,8 @@ import { noop } from '@mpxjs/utils'
3
3
 
4
4
  function showActionSheet (options = {}) {
5
5
  const opts = changeOpts(options, {
6
- itemList: 'items'
6
+ itemList: 'items',
7
+ alertText: 'title'
7
8
  })
8
9
 
9
10
  const cacheSuc = opts.success || noop
@@ -0,0 +1,13 @@
1
+ import { ENV_OBJ, changeOpts } from '../../../common/js'
2
+
3
+ function createAnimation (options = {}) {
4
+ const opts = changeOpts(options, {
5
+ timingFunction: 'timeFunction'
6
+ })
7
+
8
+ return ENV_OBJ.createAnimation(opts)
9
+ }
10
+
11
+ export {
12
+ createAnimation
13
+ }
@@ -1,4 +1,4 @@
1
- import { ENV_OBJ } from '../../../common/js'
1
+ import { ENV_OBJ, envError } from '../../../common/js'
2
2
 
3
3
  function closeBLEConnection (options = {}) {
4
4
  return ENV_OBJ.disconnectBLEDevice(options)
@@ -12,8 +12,73 @@ function onBLEConnectionStateChange (callback) {
12
12
  return ENV_OBJ.onBLEConnectionStateChanged(callback)
13
13
  }
14
14
 
15
+ function offBLEConnectionStateChange (callback) {
16
+ return ENV_OBJ.offBLEConnectionStateChanged(callback)
17
+ }
18
+
19
+ const openBluetoothAdapter = ENV_OBJ.openBluetoothAdapter || envError('openBluetoothAdapter')
20
+
21
+ const closeBluetoothAdapter = ENV_OBJ.closeBluetoothAdapter || envError('closeBluetoothAdapter')
22
+
23
+ const startBluetoothDevicesDiscovery = ENV_OBJ.startBluetoothDevicesDiscovery || envError('startBluetoothDevicesDiscovery')
24
+
25
+ const stopBluetoothDevicesDiscovery = ENV_OBJ.stopBluetoothDevicesDiscovery || envError('stopBluetoothDevicesDiscovery')
26
+
27
+ const onBluetoothDeviceFound = ENV_OBJ.onBluetoothDeviceFound || envError('onBluetoothDeviceFound')
28
+
29
+ const offBluetoothDeviceFound = ENV_OBJ.offBluetoothDeviceFound || envError('offBluetoothDeviceFound')
30
+
31
+ const getConnectedBluetoothDevices = ENV_OBJ.getConnectedBluetoothDevices || envError('getConnectedBluetoothDevices')
32
+
33
+ const getBluetoothAdapterState = ENV_OBJ.getBluetoothAdapterState || envError('getBluetoothAdapterState')
34
+
35
+ const onBluetoothAdapterStateChange = ENV_OBJ.onBluetoothAdapterStateChange || envError('onBluetoothAdapterStateChange')
36
+
37
+ const offBluetoothAdapterStateChange = ENV_OBJ.offBluetoothAdapterStateChange || envError('offBluetoothAdapterStateChange')
38
+
39
+ const getBluetoothDevices = ENV_OBJ.getBluetoothDevices || envError('getBluetoothDevices')
40
+
41
+ const writeBLECharacteristicValue = ENV_OBJ.writeBLECharacteristicValue || envError('writeBLECharacteristicValue')
42
+
43
+ const readBLECharacteristicValue = ENV_OBJ.readBLECharacteristicValue || envError('readBLECharacteristicValue')
44
+
45
+ const notifyBLECharacteristicValueChange = ENV_OBJ.notifyBLECharacteristicValueChange || envError('notifyBLECharacteristicValueChange')
46
+
47
+ const onBLECharacteristicValueChange = ENV_OBJ.onBLECharacteristicValueChange || envError('onBLECharacteristicValueChange')
48
+
49
+ const offBLECharacteristicValueChange = ENV_OBJ.offBLECharacteristicValueChange || envError('offBLECharacteristicValueChange')
50
+
51
+ const setBLEMTU = ENV_OBJ.setBLEMTU || envError('setBLEMTU')
52
+
53
+ const getBLEDeviceRSSI = ENV_OBJ.getBLEDeviceRSSI || envError('getBLEDeviceRSSI')
54
+
55
+ const getBLEDeviceServices = ENV_OBJ.getBLEDeviceServices || envError('getBLEDeviceServices')
56
+
57
+ const getBLEDeviceCharacteristics = ENV_OBJ.getBLEDeviceCharacteristics || envError('getBLEDeviceCharacteristics')
58
+
15
59
  export {
16
60
  closeBLEConnection,
17
61
  createBLEConnection,
18
- onBLEConnectionStateChange
62
+ onBLEConnectionStateChange,
63
+ offBLEConnectionStateChange,
64
+ openBluetoothAdapter,
65
+ closeBluetoothAdapter,
66
+ startBluetoothDevicesDiscovery,
67
+ stopBluetoothDevicesDiscovery,
68
+ onBluetoothDeviceFound,
69
+ offBluetoothDeviceFound,
70
+ getConnectedBluetoothDevices,
71
+ getBluetoothAdapterState,
72
+ onBluetoothAdapterStateChange,
73
+ offBluetoothAdapterStateChange,
74
+ getBluetoothDevices,
75
+ writeBLECharacteristicValue,
76
+ readBLECharacteristicValue,
77
+ notifyBLECharacteristicValueChange,
78
+ onBLECharacteristicValueChange,
79
+ offBLECharacteristicValueChange,
80
+ setBLEMTU,
81
+ getBLEDeviceRSSI,
82
+ getBLEDeviceServices,
83
+ getBLEDeviceCharacteristics
19
84
  }