@doubao-apps/taro-runtime 0.0.24 → 0.0.25
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/dist/api/device/accelerometer.d.ts +9 -0
- package/dist/api/device/accelerometer.js +11 -0
- package/dist/api/device/accessibility.d.ts +6 -0
- package/dist/api/device/accessibility.js +12 -0
- package/dist/api/device/battery.d.ts +6 -0
- package/dist/api/device/battery.js +13 -0
- package/dist/api/device/beacon.d.ts +12 -0
- package/dist/api/device/beacon.js +30 -0
- package/dist/api/device/bluetooth.d.ts +60 -0
- package/dist/api/device/bluetooth.js +187 -0
- package/dist/api/device/calendar.d.ts +9 -0
- package/dist/api/device/calendar.js +45 -0
- package/dist/api/device/capabilities.d.ts +16 -0
- package/dist/api/device/capabilities.js +16 -0
- package/dist/api/device/clipboard.d.ts +6 -0
- package/dist/api/device/clipboard.js +12 -0
- package/dist/api/device/compass.d.ts +9 -0
- package/dist/api/device/compass.js +9 -0
- package/dist/api/device/contact.d.ts +11 -0
- package/dist/api/device/contact.js +18 -0
- package/dist/api/device/crypto.d.ts +6 -0
- package/dist/api/device/crypto.js +14 -0
- package/dist/api/device/device-motion.d.ts +7 -0
- package/dist/api/device/device-motion.js +11 -0
- package/dist/api/device/gyroscope.d.ts +9 -0
- package/dist/api/device/gyroscope.js +11 -0
- package/dist/api/device/hce.d.ts +11 -0
- package/dist/api/device/hce.js +19 -0
- package/dist/api/device/index.d.ts +21 -0
- package/dist/api/device/index.js +21 -0
- package/dist/api/device/keyboard.d.ts +9 -0
- package/dist/api/device/keyboard.js +16 -0
- package/dist/api/device/network.d.ts +6 -0
- package/dist/api/device/network.js +13 -0
- package/dist/api/device/scan.d.ts +6 -0
- package/dist/api/device/scan.js +19 -0
- package/dist/api/device/screen.d.ts +12 -0
- package/dist/api/device/screen.js +18 -0
- package/dist/api/device/sms.d.ts +6 -0
- package/dist/api/device/sms.js +16 -0
- package/dist/api/device/vibration.d.ts +9 -0
- package/dist/api/device/vibration.js +11 -0
- package/dist/api/device/wifi.d.ts +21 -0
- package/dist/api/device/wifi.js +70 -0
- package/dist/api/device/wireless.d.ts +4 -0
- package/dist/api/device/wireless.js +4 -0
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +3 -1
- package/dist/api/system/index.js +6 -0
- package/dist/api/utils.d.ts +2 -2
- package/dist/api/utils.js +4 -8
- package/dist/components/Map/index.jsx +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartAccelerometerOption = Parameters<typeof Taro.startAccelerometer>[0];
|
|
3
|
+
type TaroStartAccelerometerResult = Awaited<ReturnType<typeof Taro.startAccelerometer>>;
|
|
4
|
+
type TaroStopAccelerometerOption = Parameters<typeof Taro.stopAccelerometer>[0];
|
|
5
|
+
type TaroStopAccelerometerResult = Awaited<ReturnType<typeof Taro.stopAccelerometer>>;
|
|
6
|
+
export declare function startAccelerometer(option?: TaroStartAccelerometerOption): Promise<TaroStartAccelerometerResult>;
|
|
7
|
+
export declare function stopAccelerometer(option?: TaroStopAccelerometerOption): Promise<TaroStopAccelerometerResult>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=accelerometer.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function startAccelerometer(option) {
|
|
4
|
+
return runCallbackApi('startAccelerometer', option, () => appFrameworkApi.startAccelerometer({
|
|
5
|
+
interval: option?.interval
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
export async function stopAccelerometer(option) {
|
|
9
|
+
return runCallbackApi('stopAccelerometer', option, () => appFrameworkApi.stopAccelerometer({}));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=accelerometer.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroCheckIsOpenAccessibilityOption = Taro.checkIsOpenAccessibility.Option;
|
|
3
|
+
type TaroCheckIsOpenAccessibilityResult = Taro.checkIsOpenAccessibility.SuccessCallbackResult;
|
|
4
|
+
export declare function checkIsOpenAccessibility(option?: TaroCheckIsOpenAccessibilityOption): Promise<TaroCheckIsOpenAccessibilityResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=accessibility.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildCheckIsOpenAccessibilityResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
open: Boolean(result.open),
|
|
6
|
+
...buildOkCallbackResult('checkIsOpenAccessibility')
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export async function checkIsOpenAccessibility(option) {
|
|
10
|
+
return runTaroApi('checkIsOpenAccessibility', option, async () => buildCheckIsOpenAccessibilityResult(await appFrameworkApi.checkIsOpenAccessibility({})));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=accessibility.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroGetBatteryInfoOption = Parameters<typeof Taro.getBatteryInfo>[0];
|
|
3
|
+
type TaroGetBatteryInfoResult = Awaited<ReturnType<typeof Taro.getBatteryInfo>>;
|
|
4
|
+
export declare function getBatteryInfo(option?: TaroGetBatteryInfoOption): Promise<TaroGetBatteryInfoResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=battery.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildGetBatteryInfoResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
isCharging: Boolean(result.isCharging),
|
|
6
|
+
level: typeof result.level === 'number' ? result.level : 0,
|
|
7
|
+
...buildOkCallbackResult('getBatteryInfo')
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export async function getBatteryInfo(option) {
|
|
11
|
+
return runTaroApi('getBatteryInfo', option, async () => buildGetBatteryInfoResult(await appFrameworkApi.getBatteryInfo({})));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=battery.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartBeaconDiscoveryOption = Parameters<typeof Taro.startBeaconDiscovery>[0];
|
|
3
|
+
type TaroStartBeaconDiscoveryResult = Awaited<ReturnType<typeof Taro.startBeaconDiscovery>>;
|
|
4
|
+
type TaroStopBeaconDiscoveryOption = Parameters<typeof Taro.stopBeaconDiscovery>[0];
|
|
5
|
+
type TaroStopBeaconDiscoveryResult = Awaited<ReturnType<typeof Taro.stopBeaconDiscovery>>;
|
|
6
|
+
type TaroGetBeaconsOption = Parameters<typeof Taro.getBeacons>[0];
|
|
7
|
+
type TaroGetBeaconsResult = Awaited<ReturnType<typeof Taro.getBeacons>>;
|
|
8
|
+
export declare function startBeaconDiscovery(option: TaroStartBeaconDiscoveryOption): Promise<TaroStartBeaconDiscoveryResult>;
|
|
9
|
+
export declare function stopBeaconDiscovery(option?: TaroStopBeaconDiscoveryOption): Promise<TaroStopBeaconDiscoveryResult>;
|
|
10
|
+
export declare function getBeacons(option?: TaroGetBeaconsOption): Promise<TaroGetBeaconsResult>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=beacon.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildGetBeaconsResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
beacons: Array.isArray(result.beacons) ? result.beacons : [],
|
|
6
|
+
...buildOkCallbackResult('getBeacons')
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function buildIBeaconOkResult(apiName) {
|
|
10
|
+
return buildOkCallbackResult(apiName);
|
|
11
|
+
}
|
|
12
|
+
export async function startBeaconDiscovery(option) {
|
|
13
|
+
return runTaroApi('startBeaconDiscovery', option, async () => {
|
|
14
|
+
await appFrameworkApi.startBeaconDiscovery({
|
|
15
|
+
uuids: option.uuids,
|
|
16
|
+
ignoreBluetoothAvailable: option.ignoreBluetoothAvailable
|
|
17
|
+
});
|
|
18
|
+
return buildIBeaconOkResult('startBeaconDiscovery');
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export async function stopBeaconDiscovery(option) {
|
|
22
|
+
return runTaroApi('stopBeaconDiscovery', option, async () => {
|
|
23
|
+
await appFrameworkApi.stopBeaconDiscovery({});
|
|
24
|
+
return buildIBeaconOkResult('stopBeaconDiscovery');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export async function getBeacons(option) {
|
|
28
|
+
return runTaroApi('getBeacons', option, async () => buildGetBeaconsResult(await appFrameworkApi.getBeacons({})));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=beacon.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroOpenBluetoothAdapterOption = Parameters<typeof Taro.openBluetoothAdapter>[0];
|
|
3
|
+
type TaroOpenBluetoothAdapterResult = Awaited<ReturnType<typeof Taro.openBluetoothAdapter>>;
|
|
4
|
+
type TaroStartBluetoothDevicesDiscoveryOption = Parameters<typeof Taro.startBluetoothDevicesDiscovery>[0];
|
|
5
|
+
type TaroStartBluetoothDevicesDiscoveryResult = Awaited<ReturnType<typeof Taro.startBluetoothDevicesDiscovery>>;
|
|
6
|
+
type TaroStopBluetoothDevicesDiscoveryOption = Parameters<typeof Taro.stopBluetoothDevicesDiscovery>[0];
|
|
7
|
+
type TaroStopBluetoothDevicesDiscoveryResult = Awaited<ReturnType<typeof Taro.stopBluetoothDevicesDiscovery>>;
|
|
8
|
+
type TaroGetBluetoothAdapterStateOption = Parameters<typeof Taro.getBluetoothAdapterState>[0];
|
|
9
|
+
type TaroGetBluetoothAdapterStateResult = Awaited<ReturnType<typeof Taro.getBluetoothAdapterState>>;
|
|
10
|
+
type TaroGetBluetoothDevicesOption = Parameters<typeof Taro.getBluetoothDevices>[0];
|
|
11
|
+
type TaroGetBluetoothDevicesResult = Awaited<ReturnType<typeof Taro.getBluetoothDevices>>;
|
|
12
|
+
type TaroGetConnectedBluetoothDevicesOption = Parameters<typeof Taro.getConnectedBluetoothDevices>[0];
|
|
13
|
+
type TaroGetConnectedBluetoothDevicesResult = Awaited<ReturnType<typeof Taro.getConnectedBluetoothDevices>>;
|
|
14
|
+
type TaroMakeBluetoothPairOption = Parameters<typeof Taro.makeBluetoothPair>[0];
|
|
15
|
+
type TaroMakeBluetoothPairResult = Awaited<ReturnType<typeof Taro.makeBluetoothPair>>;
|
|
16
|
+
type TaroIsBluetoothDevicePairedOption = Parameters<typeof Taro.isBluetoothDevicePaired>[0];
|
|
17
|
+
type TaroIsBluetoothDevicePairedResult = Awaited<ReturnType<typeof Taro.isBluetoothDevicePaired>>;
|
|
18
|
+
type TaroCloseBluetoothAdapterOption = Parameters<typeof Taro.closeBluetoothAdapter>[0];
|
|
19
|
+
type TaroCloseBluetoothAdapterResult = Awaited<ReturnType<typeof Taro.closeBluetoothAdapter>>;
|
|
20
|
+
type TaroCreateBLEConnectionOption = Parameters<typeof Taro.createBLEConnection>[0];
|
|
21
|
+
type TaroCreateBLEConnectionResult = Awaited<ReturnType<typeof Taro.createBLEConnection>>;
|
|
22
|
+
type TaroCloseBLEConnectionOption = Parameters<typeof Taro.closeBLEConnection>[0];
|
|
23
|
+
type TaroCloseBLEConnectionResult = Awaited<ReturnType<typeof Taro.closeBLEConnection>>;
|
|
24
|
+
type TaroGetBLEDeviceServicesOption = Parameters<typeof Taro.getBLEDeviceServices>[0];
|
|
25
|
+
type TaroGetBLEDeviceServicesResult = Awaited<ReturnType<typeof Taro.getBLEDeviceServices>>;
|
|
26
|
+
type TaroGetBLEDeviceCharacteristicsOption = Parameters<typeof Taro.getBLEDeviceCharacteristics>[0];
|
|
27
|
+
type TaroGetBLEDeviceCharacteristicsResult = Awaited<ReturnType<typeof Taro.getBLEDeviceCharacteristics>>;
|
|
28
|
+
type TaroGetBLEDeviceRSSIOption = Parameters<typeof Taro.getBLEDeviceRSSI>[0];
|
|
29
|
+
type TaroGetBLEDeviceRSSIResult = Awaited<ReturnType<typeof Taro.getBLEDeviceRSSI>>;
|
|
30
|
+
type TaroGetBLEMTUOption = Parameters<typeof Taro.getBLEMTU>[0];
|
|
31
|
+
type TaroGetBLEMTUResult = Awaited<ReturnType<typeof Taro.getBLEMTU>>;
|
|
32
|
+
type TaroNotifyBLECharacteristicValueChangeOption = Parameters<typeof Taro.notifyBLECharacteristicValueChange>[0];
|
|
33
|
+
type TaroNotifyBLECharacteristicValueChangeResult = Awaited<ReturnType<typeof Taro.notifyBLECharacteristicValueChange>>;
|
|
34
|
+
type TaroReadBLECharacteristicValueOption = Parameters<typeof Taro.readBLECharacteristicValue>[0];
|
|
35
|
+
type TaroReadBLECharacteristicValueResult = Awaited<ReturnType<typeof Taro.readBLECharacteristicValue>>;
|
|
36
|
+
type TaroSetBLEMTUOption = Parameters<typeof Taro.setBLEMTU>[0];
|
|
37
|
+
type TaroSetBLEMTUResult = Awaited<ReturnType<typeof Taro.setBLEMTU>>;
|
|
38
|
+
type TaroWriteBLECharacteristicValueOption = Parameters<typeof Taro.writeBLECharacteristicValue>[0];
|
|
39
|
+
type TaroWriteBLECharacteristicValueResult = Awaited<ReturnType<typeof Taro.writeBLECharacteristicValue>>;
|
|
40
|
+
export declare function openBluetoothAdapter(option?: TaroOpenBluetoothAdapterOption): Promise<TaroOpenBluetoothAdapterResult>;
|
|
41
|
+
export declare function startBluetoothDevicesDiscovery(option: TaroStartBluetoothDevicesDiscoveryOption): Promise<TaroStartBluetoothDevicesDiscoveryResult>;
|
|
42
|
+
export declare function stopBluetoothDevicesDiscovery(option?: TaroStopBluetoothDevicesDiscoveryOption): Promise<TaroStopBluetoothDevicesDiscoveryResult>;
|
|
43
|
+
export declare function getBluetoothAdapterState(option?: TaroGetBluetoothAdapterStateOption): Promise<TaroGetBluetoothAdapterStateResult>;
|
|
44
|
+
export declare function getBluetoothDevices(option?: TaroGetBluetoothDevicesOption): Promise<TaroGetBluetoothDevicesResult>;
|
|
45
|
+
export declare function getConnectedBluetoothDevices(option: TaroGetConnectedBluetoothDevicesOption): Promise<TaroGetConnectedBluetoothDevicesResult>;
|
|
46
|
+
export declare function makeBluetoothPair(option: TaroMakeBluetoothPairOption): Promise<TaroMakeBluetoothPairResult>;
|
|
47
|
+
export declare function isBluetoothDevicePaired(option: TaroIsBluetoothDevicePairedOption): Promise<TaroIsBluetoothDevicePairedResult>;
|
|
48
|
+
export declare function closeBluetoothAdapter(option?: TaroCloseBluetoothAdapterOption): Promise<TaroCloseBluetoothAdapterResult>;
|
|
49
|
+
export declare function createBLEConnection(option: TaroCreateBLEConnectionOption): Promise<TaroCreateBLEConnectionResult>;
|
|
50
|
+
export declare function closeBLEConnection(option: TaroCloseBLEConnectionOption): Promise<TaroCloseBLEConnectionResult>;
|
|
51
|
+
export declare function getBLEDeviceServices(option: TaroGetBLEDeviceServicesOption): Promise<TaroGetBLEDeviceServicesResult>;
|
|
52
|
+
export declare function getBLEDeviceCharacteristics(option: TaroGetBLEDeviceCharacteristicsOption): Promise<TaroGetBLEDeviceCharacteristicsResult>;
|
|
53
|
+
export declare function getBLEDeviceRSSI(option: TaroGetBLEDeviceRSSIOption): Promise<TaroGetBLEDeviceRSSIResult>;
|
|
54
|
+
export declare function getBLEMTU(option: TaroGetBLEMTUOption): Promise<TaroGetBLEMTUResult>;
|
|
55
|
+
export declare function notifyBLECharacteristicValueChange(option: TaroNotifyBLECharacteristicValueChangeOption): Promise<TaroNotifyBLECharacteristicValueChangeResult>;
|
|
56
|
+
export declare function readBLECharacteristicValue(option: TaroReadBLECharacteristicValueOption): Promise<TaroReadBLECharacteristicValueResult>;
|
|
57
|
+
export declare function setBLEMTU(option: TaroSetBLEMTUOption): Promise<TaroSetBLEMTUResult>;
|
|
58
|
+
export declare function writeBLECharacteristicValue(option: TaroWriteBLECharacteristicValueOption): Promise<TaroWriteBLECharacteristicValueResult>;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=bluetooth.d.ts.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runCallbackApi, runTaroApi } from '../utils.js';
|
|
3
|
+
function toNumber(value) {
|
|
4
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
8
|
+
const parsed = Number(value);
|
|
9
|
+
if (Number.isFinite(parsed)) {
|
|
10
|
+
return parsed;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
function mapBluetoothDevice(device) {
|
|
16
|
+
return {
|
|
17
|
+
RSSI: device.rssi,
|
|
18
|
+
advertisData: device.advertisingData,
|
|
19
|
+
advertisServiceUUIDs: device.advertisingServiceUuids,
|
|
20
|
+
deviceId: device.deviceId,
|
|
21
|
+
localName: device.localName,
|
|
22
|
+
name: device.name,
|
|
23
|
+
serviceData: device.serviceData ?? {},
|
|
24
|
+
connectable: typeof device.connectable === 'boolean' ? device.connectable : undefined
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function buildBluetoothAdapterStateResult(result) {
|
|
28
|
+
return {
|
|
29
|
+
available: Boolean(result.available),
|
|
30
|
+
discovering: Boolean(result.discovering),
|
|
31
|
+
...buildOkCallbackResult('getBluetoothAdapterState')
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function buildBluetoothDevicesResult(result) {
|
|
35
|
+
return {
|
|
36
|
+
devices: Array.isArray(result.devices) ? result.devices.map(mapBluetoothDevice) : [],
|
|
37
|
+
...buildOkCallbackResult('getBluetoothDevices')
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function buildConnectedBluetoothDevicesResult(result) {
|
|
41
|
+
return {
|
|
42
|
+
devices: Array.isArray(result.devices) ? result.devices : [],
|
|
43
|
+
...buildOkCallbackResult('getConnectedBluetoothDevices')
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function buildBLEDeviceServicesResult(result) {
|
|
47
|
+
return {
|
|
48
|
+
services: Array.isArray(result.services) ? result.services : [],
|
|
49
|
+
...buildOkCallbackResult('getBLEDeviceServices')
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function buildBLEDeviceCharacteristicsResult(result) {
|
|
53
|
+
return {
|
|
54
|
+
characteristics: Array.isArray(result.characteristics) ? result.characteristics : [],
|
|
55
|
+
...buildOkCallbackResult('getBLEDeviceCharacteristics')
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function buildBLEDeviceRSSIResult(result) {
|
|
59
|
+
return {
|
|
60
|
+
RSSI: result.rssi ?? 0,
|
|
61
|
+
...buildOkCallbackResult('getBLEDeviceRSSI')
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function buildBLEMTUResult(result) {
|
|
65
|
+
return {
|
|
66
|
+
mtu: typeof result.mtu === 'number' ? result.mtu : 0,
|
|
67
|
+
...buildOkCallbackResult('getBLEMTU')
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function buildSetBLEMTUResult(result) {
|
|
71
|
+
return {
|
|
72
|
+
mtu: result.mtu,
|
|
73
|
+
...buildOkCallbackResult('setBLEMTU')
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function buildBluetoothOkResult(apiName) {
|
|
77
|
+
return buildOkCallbackResult(apiName);
|
|
78
|
+
}
|
|
79
|
+
export async function openBluetoothAdapter(option) {
|
|
80
|
+
const params = option?.mode ? { mode: option.mode } : {};
|
|
81
|
+
return runCallbackApi('openBluetoothAdapter', option, () => appFrameworkApi.openBluetoothAdapter(params));
|
|
82
|
+
}
|
|
83
|
+
export async function startBluetoothDevicesDiscovery(option) {
|
|
84
|
+
const { success: _success, fail: _fail, complete: _complete, ...params } = option;
|
|
85
|
+
return runCallbackApi('startBluetoothDevicesDiscovery', option, () => appFrameworkApi.startBluetoothDevicesDiscovery(params));
|
|
86
|
+
}
|
|
87
|
+
export async function stopBluetoothDevicesDiscovery(option) {
|
|
88
|
+
return runCallbackApi('stopBluetoothDevicesDiscovery', option, () => appFrameworkApi.stopBluetoothDevicesDiscovery({}));
|
|
89
|
+
}
|
|
90
|
+
export async function getBluetoothAdapterState(option) {
|
|
91
|
+
return runTaroApi('getBluetoothAdapterState', option, async () => buildBluetoothAdapterStateResult(await appFrameworkApi.getBluetoothAdapterState({})));
|
|
92
|
+
}
|
|
93
|
+
export async function getBluetoothDevices(option) {
|
|
94
|
+
return runTaroApi('getBluetoothDevices', option, async () => buildBluetoothDevicesResult(await appFrameworkApi.getBluetoothDevices({})));
|
|
95
|
+
}
|
|
96
|
+
export async function getConnectedBluetoothDevices(option) {
|
|
97
|
+
return runTaroApi('getConnectedBluetoothDevices', option, async () => buildConnectedBluetoothDevicesResult(await appFrameworkApi.getConnectedBluetoothDevices({ services: option.services })));
|
|
98
|
+
}
|
|
99
|
+
export async function makeBluetoothPair(option) {
|
|
100
|
+
const timeout = toNumber(option.timeout);
|
|
101
|
+
return runCallbackApi('makeBluetoothPair', option, () => appFrameworkApi.makeBluetoothPair({
|
|
102
|
+
deviceId: option.deviceId,
|
|
103
|
+
pin: option.pin,
|
|
104
|
+
...(timeout !== undefined ? { timeout } : {})
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
export async function isBluetoothDevicePaired(option) {
|
|
108
|
+
return runCallbackApi('isBluetoothDevicePaired', option, () => appFrameworkApi.isBluetoothDevicePaired({ deviceId: option.deviceId }));
|
|
109
|
+
}
|
|
110
|
+
export async function closeBluetoothAdapter(option) {
|
|
111
|
+
return runCallbackApi('closeBluetoothAdapter', option, () => appFrameworkApi.closeBluetoothAdapter({}));
|
|
112
|
+
}
|
|
113
|
+
export async function createBLEConnection(option) {
|
|
114
|
+
const timeout = toNumber(option.timeout);
|
|
115
|
+
return runTaroApi('createBLEConnection', option, async () => {
|
|
116
|
+
await appFrameworkApi.createBLEConnection({
|
|
117
|
+
deviceId: option.deviceId,
|
|
118
|
+
...(timeout !== undefined ? { timeout } : {})
|
|
119
|
+
});
|
|
120
|
+
return buildBluetoothOkResult('createBLEConnection');
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
export async function closeBLEConnection(option) {
|
|
124
|
+
return runTaroApi('closeBLEConnection', option, async () => {
|
|
125
|
+
await appFrameworkApi.closeBLEConnection({ deviceId: option.deviceId });
|
|
126
|
+
return buildBluetoothOkResult('closeBLEConnection');
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
export async function getBLEDeviceServices(option) {
|
|
130
|
+
return runTaroApi('getBLEDeviceServices', option, async () => buildBLEDeviceServicesResult(await appFrameworkApi.getBLEDeviceServices({ deviceId: option.deviceId })));
|
|
131
|
+
}
|
|
132
|
+
export async function getBLEDeviceCharacteristics(option) {
|
|
133
|
+
return runTaroApi('getBLEDeviceCharacteristics', option, async () => buildBLEDeviceCharacteristicsResult(await appFrameworkApi.getBLEDeviceCharacteristics({
|
|
134
|
+
deviceId: option.deviceId,
|
|
135
|
+
serviceId: option.serviceId
|
|
136
|
+
})));
|
|
137
|
+
}
|
|
138
|
+
export async function getBLEDeviceRSSI(option) {
|
|
139
|
+
return runTaroApi('getBLEDeviceRSSI', option, async () => buildBLEDeviceRSSIResult(await appFrameworkApi.getBLEDeviceRSSI({ deviceId: option.deviceId })));
|
|
140
|
+
}
|
|
141
|
+
export async function getBLEMTU(option) {
|
|
142
|
+
return runTaroApi('getBLEMTU', option, async () => buildBLEMTUResult(await appFrameworkApi.getBLEMTU({
|
|
143
|
+
deviceId: option.deviceId,
|
|
144
|
+
writeType: option.writeType
|
|
145
|
+
})));
|
|
146
|
+
}
|
|
147
|
+
export async function notifyBLECharacteristicValueChange(option) {
|
|
148
|
+
return runTaroApi('notifyBLECharacteristicValueChange', option, async () => {
|
|
149
|
+
await appFrameworkApi.notifyBLECharacteristicValueChange({
|
|
150
|
+
deviceId: option.deviceId,
|
|
151
|
+
serviceId: option.serviceId,
|
|
152
|
+
characteristicId: option.characteristicId,
|
|
153
|
+
state: option.state,
|
|
154
|
+
type: option.type
|
|
155
|
+
});
|
|
156
|
+
return buildBluetoothOkResult('notifyBLECharacteristicValueChange');
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
export async function readBLECharacteristicValue(option) {
|
|
160
|
+
return runTaroApi('readBLECharacteristicValue', option, async () => {
|
|
161
|
+
await appFrameworkApi.readBLECharacteristicValue({
|
|
162
|
+
deviceId: option.deviceId,
|
|
163
|
+
serviceId: option.serviceId,
|
|
164
|
+
characteristicId: option.characteristicId
|
|
165
|
+
});
|
|
166
|
+
return buildBluetoothOkResult('readBLECharacteristicValue');
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
export async function setBLEMTU(option) {
|
|
170
|
+
return runTaroApi('setBLEMTU', option, async () => buildSetBLEMTUResult(await appFrameworkApi.setBLEMTU({
|
|
171
|
+
deviceId: option.deviceId,
|
|
172
|
+
mtu: option.mtu
|
|
173
|
+
})));
|
|
174
|
+
}
|
|
175
|
+
export async function writeBLECharacteristicValue(option) {
|
|
176
|
+
return runTaroApi('writeBLECharacteristicValue', option, async () => {
|
|
177
|
+
await appFrameworkApi.writeBLECharacteristicValue({
|
|
178
|
+
deviceId: option.deviceId,
|
|
179
|
+
serviceId: option.serviceId,
|
|
180
|
+
characteristicId: option.characteristicId,
|
|
181
|
+
value: option.value,
|
|
182
|
+
writeType: option.writeType
|
|
183
|
+
});
|
|
184
|
+
return buildBluetoothOkResult('writeBLECharacteristicValue');
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=bluetooth.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroAddPhoneCalendarOption = Parameters<typeof Taro.addPhoneCalendar>[0];
|
|
3
|
+
type TaroAddPhoneCalendarResult = Awaited<ReturnType<typeof Taro.addPhoneCalendar>>;
|
|
4
|
+
type TaroAddPhoneRepeatCalendarOption = Parameters<typeof Taro.addPhoneRepeatCalendar>[0];
|
|
5
|
+
type TaroAddPhoneRepeatCalendarResult = Awaited<ReturnType<typeof Taro.addPhoneRepeatCalendar>>;
|
|
6
|
+
export declare function addPhoneCalendar(option: TaroAddPhoneCalendarOption): Promise<TaroAddPhoneCalendarResult>;
|
|
7
|
+
export declare function addPhoneRepeatCalendar(option: TaroAddPhoneRepeatCalendarOption): Promise<TaroAddPhoneRepeatCalendarResult>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
function toNumber(value) {
|
|
4
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
8
|
+
const parsed = Number(value);
|
|
9
|
+
if (Number.isFinite(parsed)) {
|
|
10
|
+
return parsed;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
export async function addPhoneCalendar(option) {
|
|
16
|
+
const endTime = toNumber(option.endTime);
|
|
17
|
+
const params = {
|
|
18
|
+
title: option.title,
|
|
19
|
+
startTime: option.startTime,
|
|
20
|
+
...(option.allDay !== undefined ? { allDay: option.allDay } : {}),
|
|
21
|
+
...(option.description !== undefined ? { description: option.description } : {}),
|
|
22
|
+
...(option.location !== undefined ? { location: option.location } : {}),
|
|
23
|
+
...(endTime !== undefined ? { endTime } : {}),
|
|
24
|
+
...(option.alarm !== undefined ? { alarm: option.alarm } : {}),
|
|
25
|
+
...(option.alarmOffset !== undefined ? { alarmOffset: option.alarmOffset } : {})
|
|
26
|
+
};
|
|
27
|
+
return runCallbackApi('addPhoneCalendar', option, () => appFrameworkApi.addPhoneCalendar(params));
|
|
28
|
+
}
|
|
29
|
+
export async function addPhoneRepeatCalendar(option) {
|
|
30
|
+
const endTime = toNumber(option.endTime);
|
|
31
|
+
const params = {
|
|
32
|
+
title: option.title,
|
|
33
|
+
startTime: option.startTime,
|
|
34
|
+
...(option.allDay !== undefined ? { allDay: option.allDay } : {}),
|
|
35
|
+
...(option.description !== undefined ? { description: option.description } : {}),
|
|
36
|
+
...(option.location !== undefined ? { location: option.location } : {}),
|
|
37
|
+
...(endTime !== undefined ? { endTime } : {}),
|
|
38
|
+
...(option.alarm !== undefined ? { alarm: option.alarm } : {}),
|
|
39
|
+
...(option.alarmOffset !== undefined ? { alarmOffset: option.alarmOffset } : {}),
|
|
40
|
+
...(option.repeatInterval !== undefined ? { repeatInterval: option.repeatInterval } : {}),
|
|
41
|
+
...(option.repeatEndTime !== undefined ? { repeatEndTime: option.repeatEndTime } : {})
|
|
42
|
+
};
|
|
43
|
+
return runCallbackApi('addPhoneRepeatCalendar', option, () => appFrameworkApi.addPhoneRepeatCalendar(params));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './accessibility.js';
|
|
2
|
+
export * from './accelerometer.js';
|
|
3
|
+
export * from './battery.js';
|
|
4
|
+
export * from './calendar.js';
|
|
5
|
+
export * from './clipboard.js';
|
|
6
|
+
export * from './compass.js';
|
|
7
|
+
export * from './contact.js';
|
|
8
|
+
export * from './crypto.js';
|
|
9
|
+
export * from './device-motion.js';
|
|
10
|
+
export * from './gyroscope.js';
|
|
11
|
+
export * from './keyboard.js';
|
|
12
|
+
export * from './network.js';
|
|
13
|
+
export * from './scan.js';
|
|
14
|
+
export * from './screen.js';
|
|
15
|
+
export * from './vibration.js';
|
|
16
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './accessibility.js';
|
|
2
|
+
export * from './accelerometer.js';
|
|
3
|
+
export * from './battery.js';
|
|
4
|
+
export * from './calendar.js';
|
|
5
|
+
export * from './clipboard.js';
|
|
6
|
+
export * from './compass.js';
|
|
7
|
+
export * from './contact.js';
|
|
8
|
+
export * from './crypto.js';
|
|
9
|
+
export * from './device-motion.js';
|
|
10
|
+
export * from './gyroscope.js';
|
|
11
|
+
export * from './keyboard.js';
|
|
12
|
+
export * from './network.js';
|
|
13
|
+
export * from './scan.js';
|
|
14
|
+
export * from './screen.js';
|
|
15
|
+
export * from './vibration.js';
|
|
16
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroGetClipboardDataOption = Parameters<typeof Taro.getClipboardData>[0];
|
|
3
|
+
type TaroGetClipboardDataResult = Awaited<ReturnType<typeof Taro.getClipboardData>>;
|
|
4
|
+
export declare function getClipboardData(option?: TaroGetClipboardDataOption): Promise<TaroGetClipboardDataResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildGetClipboardDataResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
data: result.data ?? '',
|
|
6
|
+
...buildOkCallbackResult('getClipboardData')
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export async function getClipboardData(option) {
|
|
10
|
+
return runTaroApi('getClipboardData', option, async () => buildGetClipboardDataResult(await appFrameworkApi.getClipboardData({})));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartCompassOption = Parameters<typeof Taro.startCompass>[0];
|
|
3
|
+
type TaroStartCompassResult = Awaited<ReturnType<typeof Taro.startCompass>>;
|
|
4
|
+
type TaroStopCompassOption = Parameters<typeof Taro.stopCompass>[0];
|
|
5
|
+
type TaroStopCompassResult = Awaited<ReturnType<typeof Taro.stopCompass>>;
|
|
6
|
+
export declare function startCompass(option?: TaroStartCompassOption): Promise<TaroStartCompassResult>;
|
|
7
|
+
export declare function stopCompass(option?: TaroStopCompassOption): Promise<TaroStopCompassResult>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=compass.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function startCompass(option) {
|
|
4
|
+
return runCallbackApi('startCompass', option, () => appFrameworkApi.startCompass({}));
|
|
5
|
+
}
|
|
6
|
+
export async function stopCompass(option) {
|
|
7
|
+
return runCallbackApi('stopCompass', option, () => appFrameworkApi.stopCompass({}));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=compass.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroChooseContactOption = Parameters<typeof Taro.chooseContact>[0];
|
|
3
|
+
type TaroChooseContactResult = Omit<Taro.chooseContact.SuccessCallbackResult, 'phoneNumberList'> & {
|
|
4
|
+
phoneNumberList: string[];
|
|
5
|
+
};
|
|
6
|
+
type TaroAddPhoneContactOption = Parameters<typeof Taro.addPhoneContact>[0];
|
|
7
|
+
type TaroAddPhoneContactResult = Awaited<ReturnType<typeof Taro.addPhoneContact>>;
|
|
8
|
+
export declare function chooseContact(option: TaroChooseContactOption): Promise<TaroChooseContactResult>;
|
|
9
|
+
export declare function addPhoneContact(option: TaroAddPhoneContactOption): Promise<TaroAddPhoneContactResult>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=contact.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runCallbackApi, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildChooseContactResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
phoneNumber: result.phoneNumber ?? '',
|
|
6
|
+
displayName: result.displayName ?? '',
|
|
7
|
+
phoneNumberList: Array.isArray(result.phoneNumberList) ? result.phoneNumberList : [],
|
|
8
|
+
...buildOkCallbackResult('chooseContact')
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export async function chooseContact(option) {
|
|
12
|
+
return runTaroApi('chooseContact', option, async () => buildChooseContactResult(await appFrameworkApi.chooseContact({})));
|
|
13
|
+
}
|
|
14
|
+
export async function addPhoneContact(option) {
|
|
15
|
+
const { success: _success, fail: _fail, complete: _complete, ...params } = option;
|
|
16
|
+
return runCallbackApi('addPhoneContact', option, () => appFrameworkApi.addPhoneContact(params));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=contact.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroGetRandomValuesOption = Parameters<typeof Taro.getRandomValues>[0];
|
|
3
|
+
type TaroGetRandomValuesResult = Awaited<ReturnType<typeof Taro.getRandomValues>>;
|
|
4
|
+
export declare function getRandomValues(option: TaroGetRandomValuesOption): Promise<TaroGetRandomValuesResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildGetRandomValuesResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
randomValues: result.randomValues ?? new ArrayBuffer(0),
|
|
6
|
+
...buildOkCallbackResult('getRandomValues')
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export async function getRandomValues(option) {
|
|
10
|
+
return runTaroApi('getRandomValues', option, async () => buildGetRandomValuesResult(await appFrameworkApi.getRandomValues({
|
|
11
|
+
length: option.length
|
|
12
|
+
})));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartDeviceMotionListeningOption = Taro.startDeviceMotionListening.Option;
|
|
3
|
+
type TaroStopDeviceMotionListeningOption = Taro.stopDeviceMotionListening.Option;
|
|
4
|
+
export declare function startDeviceMotionListening(option: TaroStartDeviceMotionListeningOption): Promise<TaroGeneral.CallbackResult>;
|
|
5
|
+
export declare function stopDeviceMotionListening(option?: TaroStopDeviceMotionListeningOption): Promise<TaroGeneral.CallbackResult>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=device-motion.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function startDeviceMotionListening(option) {
|
|
4
|
+
return runCallbackApi('startDeviceMotionListening', option, () => appFrameworkApi.startDeviceMotionListening({
|
|
5
|
+
interval: option.interval
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
export async function stopDeviceMotionListening(option) {
|
|
9
|
+
return runCallbackApi('stopDeviceMotionListening', option, () => appFrameworkApi.stopDeviceMotionListening({}));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=device-motion.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartGyroscopeOption = Parameters<typeof Taro.startGyroscope>[0];
|
|
3
|
+
type TaroStartGyroscopeResult = Awaited<ReturnType<typeof Taro.startGyroscope>>;
|
|
4
|
+
type TaroStopGyroscopeOption = Parameters<typeof Taro.stopGyroscope>[0];
|
|
5
|
+
type TaroStopGyroscopeResult = Awaited<ReturnType<typeof Taro.stopGyroscope>>;
|
|
6
|
+
export declare function startGyroscope(option: TaroStartGyroscopeOption): Promise<TaroStartGyroscopeResult>;
|
|
7
|
+
export declare function stopGyroscope(option?: TaroStopGyroscopeOption): Promise<TaroStopGyroscopeResult>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=gyroscope.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function startGyroscope(option) {
|
|
4
|
+
return runCallbackApi('startGyroscope', option, () => appFrameworkApi.startGyroscope({
|
|
5
|
+
interval: option.interval
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
export async function stopGyroscope(option) {
|
|
9
|
+
return runCallbackApi('stopGyroscope', option, () => appFrameworkApi.stopGyroscope({}));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=gyroscope.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartHCEOption = Taro.startHCE.Option;
|
|
3
|
+
type TaroStopHCEOption = Taro.stopHCE.Option;
|
|
4
|
+
type TaroSendHCEMessageOption = Taro.sendHCEMessage.Option;
|
|
5
|
+
type TaroGetHCEStateOption = Taro.getHCEState.Option;
|
|
6
|
+
export declare function startHCE(option: TaroStartHCEOption): Promise<TaroGeneral.CallbackResult>;
|
|
7
|
+
export declare function stopHCE(option?: TaroStopHCEOption): Promise<TaroGeneral.CallbackResult>;
|
|
8
|
+
export declare function sendHCEMessage(option: TaroSendHCEMessageOption): Promise<TaroGeneral.CallbackResult>;
|
|
9
|
+
export declare function getHCEState(option?: TaroGetHCEStateOption): Promise<TaroGeneral.CallbackResult>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=hce.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function startHCE(option) {
|
|
4
|
+
return runCallbackApi('startHCE', option, () => appFrameworkApi.startHCE({
|
|
5
|
+
aidList: option.aid_list
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
export async function stopHCE(option) {
|
|
9
|
+
return runCallbackApi('stopHCE', option, () => appFrameworkApi.stopHCE({}));
|
|
10
|
+
}
|
|
11
|
+
export async function sendHCEMessage(option) {
|
|
12
|
+
return runCallbackApi('sendHCEMessage', option, () => appFrameworkApi.sendHCEMessage({
|
|
13
|
+
data: option.data
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
export async function getHCEState(option) {
|
|
17
|
+
return runCallbackApi('getHCEState', option, () => appFrameworkApi.getHCEState({}));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=hce.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './sms.js';
|
|
2
|
+
export * from './accessibility.js';
|
|
3
|
+
export * from './accelerometer.js';
|
|
4
|
+
export * from './battery.js';
|
|
5
|
+
export * from './beacon.js';
|
|
6
|
+
export * from './bluetooth.js';
|
|
7
|
+
export * from './calendar.js';
|
|
8
|
+
export * from './clipboard.js';
|
|
9
|
+
export * from './compass.js';
|
|
10
|
+
export * from './contact.js';
|
|
11
|
+
export * from './crypto.js';
|
|
12
|
+
export * from './device-motion.js';
|
|
13
|
+
export * from './gyroscope.js';
|
|
14
|
+
export * from './hce.js';
|
|
15
|
+
export * from './keyboard.js';
|
|
16
|
+
export * from './network.js';
|
|
17
|
+
export * from './scan.js';
|
|
18
|
+
export * from './screen.js';
|
|
19
|
+
export * from './vibration.js';
|
|
20
|
+
export * from './wifi.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './sms.js';
|
|
2
|
+
export * from './accessibility.js';
|
|
3
|
+
export * from './accelerometer.js';
|
|
4
|
+
export * from './battery.js';
|
|
5
|
+
export * from './beacon.js';
|
|
6
|
+
export * from './bluetooth.js';
|
|
7
|
+
export * from './calendar.js';
|
|
8
|
+
export * from './clipboard.js';
|
|
9
|
+
export * from './compass.js';
|
|
10
|
+
export * from './contact.js';
|
|
11
|
+
export * from './crypto.js';
|
|
12
|
+
export * from './device-motion.js';
|
|
13
|
+
export * from './gyroscope.js';
|
|
14
|
+
export * from './hce.js';
|
|
15
|
+
export * from './keyboard.js';
|
|
16
|
+
export * from './network.js';
|
|
17
|
+
export * from './scan.js';
|
|
18
|
+
export * from './screen.js';
|
|
19
|
+
export * from './vibration.js';
|
|
20
|
+
export * from './wifi.js';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroHideKeyboardOption = Parameters<typeof Taro.hideKeyboard>[0];
|
|
3
|
+
type TaroHideKeyboardResult = Awaited<ReturnType<typeof Taro.hideKeyboard>>;
|
|
4
|
+
type TaroGetSelectedTextRangeOption = Parameters<typeof Taro.getSelectedTextRange>[0];
|
|
5
|
+
type TaroGetSelectedTextRangeResult = Awaited<ReturnType<typeof Taro.getSelectedTextRange>>;
|
|
6
|
+
export declare function hideKeyboard(option?: TaroHideKeyboardOption): Promise<TaroHideKeyboardResult>;
|
|
7
|
+
export declare function getSelectedTextRange(option?: TaroGetSelectedTextRangeOption): Promise<TaroGetSelectedTextRangeResult>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runCallbackApi, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildGetSelectedTextRangeResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
start: typeof result.start === 'number' ? result.start : 0,
|
|
6
|
+
end: typeof result.end === 'number' ? result.end : 0,
|
|
7
|
+
...buildOkCallbackResult('getSelectedTextRange')
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export async function hideKeyboard(option) {
|
|
11
|
+
return runCallbackApi('hideKeyboard', option, () => appFrameworkApi.hideKeyboard({}));
|
|
12
|
+
}
|
|
13
|
+
export async function getSelectedTextRange(option) {
|
|
14
|
+
return runTaroApi('getSelectedTextRange', option, async () => buildGetSelectedTextRangeResult(await appFrameworkApi.getSelectedTextRange({})));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=keyboard.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroGetLocalIPAddressOption = Parameters<typeof Taro.getLocalIPAddress>[0];
|
|
3
|
+
type TaroGetLocalIPAddressResult = Awaited<ReturnType<typeof Taro.getLocalIPAddress>>;
|
|
4
|
+
export declare function getLocalIPAddress(option?: TaroGetLocalIPAddressOption): Promise<TaroGetLocalIPAddressResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildGetLocalIPAddressResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
localip: result.localIp ?? '',
|
|
6
|
+
netmask: result.netmask,
|
|
7
|
+
...buildOkCallbackResult('getLocalIPAddress')
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export async function getLocalIPAddress(option) {
|
|
11
|
+
return runTaroApi('getLocalIPAddress', option, async () => buildGetLocalIPAddressResult(await appFrameworkApi.getLocalIPAddress({})));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroScanCodeOption = Parameters<typeof Taro.scanCode>[0];
|
|
3
|
+
type TaroScanCodeResult = Awaited<ReturnType<typeof Taro.scanCode>>;
|
|
4
|
+
export declare function scanCode(option: TaroScanCodeOption): Promise<TaroScanCodeResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildScanCodeResult(result) {
|
|
4
|
+
return {
|
|
5
|
+
charSet: result.characterSet ?? '',
|
|
6
|
+
path: result.path ?? '',
|
|
7
|
+
rawData: result.rawData ?? '',
|
|
8
|
+
result: result.result ?? '',
|
|
9
|
+
scanType: result.scanType ?? 'QR_CODE',
|
|
10
|
+
...buildOkCallbackResult('scanCode')
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export async function scanCode(option) {
|
|
14
|
+
return runTaroApi('scanCode', option, async () => buildScanCodeResult(await appFrameworkApi.scanCode({
|
|
15
|
+
onlyFromCamera: option.onlyFromCamera,
|
|
16
|
+
scanType: option.scanType
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroSetVisualEffectOnCaptureOption = Parameters<typeof Taro.setVisualEffectOnCapture>[0];
|
|
3
|
+
type TaroSetVisualEffectOnCaptureResult = Awaited<ReturnType<typeof Taro.setVisualEffectOnCapture>>;
|
|
4
|
+
type TaroSetScreenBrightnessOption = Parameters<typeof Taro.setScreenBrightness>[0];
|
|
5
|
+
type TaroSetScreenBrightnessResult = Awaited<ReturnType<typeof Taro.setScreenBrightness>>;
|
|
6
|
+
type TaroSetKeepScreenOnOption = Parameters<typeof Taro.setKeepScreenOn>[0];
|
|
7
|
+
type TaroSetKeepScreenOnResult = Awaited<ReturnType<typeof Taro.setKeepScreenOn>>;
|
|
8
|
+
export declare function setVisualEffectOnCapture(option: TaroSetVisualEffectOnCaptureOption): Promise<TaroSetVisualEffectOnCaptureResult>;
|
|
9
|
+
export declare function setScreenBrightness(option: TaroSetScreenBrightnessOption): Promise<TaroSetScreenBrightnessResult>;
|
|
10
|
+
export declare function setKeepScreenOn(option: TaroSetKeepScreenOnOption): Promise<TaroSetKeepScreenOnResult>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function setVisualEffectOnCapture(option) {
|
|
4
|
+
return runCallbackApi('setVisualEffectOnCapture', option, () => appFrameworkApi.setVisualEffectOnCapture({
|
|
5
|
+
visualEffect: option.visualEffect
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
export async function setScreenBrightness(option) {
|
|
9
|
+
return runCallbackApi('setScreenBrightness', option, () => appFrameworkApi.setScreenBrightness({
|
|
10
|
+
value: option.value
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
export async function setKeepScreenOn(option) {
|
|
14
|
+
return runCallbackApi('setKeepScreenOn', option, () => appFrameworkApi.setKeepScreenOn({
|
|
15
|
+
keepScreenOn: option.keepScreenOn
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=screen.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroSendSmsOption = Taro.sendSms.Option;
|
|
3
|
+
type TaroSendSmsResult = TaroGeneral.CallbackResult;
|
|
4
|
+
export declare function sendSms(option?: TaroSendSmsOption): Promise<TaroSendSmsResult>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=sms.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sendSms as appSendSms } from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
function buildFrameworkParams(option) {
|
|
4
|
+
const params = {};
|
|
5
|
+
if (typeof option?.phoneNumber === 'string') {
|
|
6
|
+
params.phoneNumber = option.phoneNumber;
|
|
7
|
+
}
|
|
8
|
+
if (typeof option?.content === 'string') {
|
|
9
|
+
params.message = option.content;
|
|
10
|
+
}
|
|
11
|
+
return params;
|
|
12
|
+
}
|
|
13
|
+
export async function sendSms(option = {}) {
|
|
14
|
+
return runCallbackApi('sendSms', option, () => appSendSms(buildFrameworkParams(option)));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sms.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroVibrateShortOption = Parameters<typeof Taro.vibrateShort>[0];
|
|
3
|
+
type TaroVibrateShortResult = Awaited<ReturnType<typeof Taro.vibrateShort>>;
|
|
4
|
+
type TaroVibrateLongOption = Parameters<typeof Taro.vibrateLong>[0];
|
|
5
|
+
type TaroVibrateLongResult = Awaited<ReturnType<typeof Taro.vibrateLong>>;
|
|
6
|
+
export declare function vibrateShort(option?: TaroVibrateShortOption): Promise<TaroVibrateShortResult>;
|
|
7
|
+
export declare function vibrateLong(option?: TaroVibrateLongOption): Promise<TaroVibrateLongResult>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=vibration.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { runCallbackApi } from '../utils.js';
|
|
3
|
+
export async function vibrateShort(option) {
|
|
4
|
+
return runCallbackApi('vibrateShort', option, () => appFrameworkApi.vibrateShort({
|
|
5
|
+
type: option?.type
|
|
6
|
+
}));
|
|
7
|
+
}
|
|
8
|
+
export async function vibrateLong(option) {
|
|
9
|
+
return runCallbackApi('vibrateLong', option, () => appFrameworkApi.vibrateLong({}));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=vibration.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type Taro from '@tarojs/taro';
|
|
2
|
+
type TaroStartWifiOption = Parameters<typeof Taro.startWifi>[0];
|
|
3
|
+
type TaroStartWifiResult = Awaited<ReturnType<typeof Taro.startWifi>>;
|
|
4
|
+
type TaroStopWifiOption = Parameters<typeof Taro.stopWifi>[0];
|
|
5
|
+
type TaroStopWifiResult = Awaited<ReturnType<typeof Taro.stopWifi>>;
|
|
6
|
+
type TaroSetWifiListOption = Parameters<typeof Taro.setWifiList>[0];
|
|
7
|
+
type TaroSetWifiListResult = Awaited<ReturnType<typeof Taro.setWifiList>>;
|
|
8
|
+
type TaroConnectWifiOption = Parameters<typeof Taro.connectWifi>[0];
|
|
9
|
+
type TaroConnectWifiResult = Awaited<ReturnType<typeof Taro.connectWifi>>;
|
|
10
|
+
type TaroGetConnectedWifiOption = Parameters<typeof Taro.getConnectedWifi>[0];
|
|
11
|
+
type TaroGetConnectedWifiResult = Taro.getConnectedWifi.SuccessCallbackResult;
|
|
12
|
+
type TaroGetWifiListOption = Parameters<typeof Taro.getWifiList>[0];
|
|
13
|
+
type TaroGetWifiListResult = Awaited<ReturnType<typeof Taro.getWifiList>>;
|
|
14
|
+
export declare function startWifi(option?: TaroStartWifiOption): Promise<TaroStartWifiResult>;
|
|
15
|
+
export declare function stopWifi(option?: TaroStopWifiOption): Promise<TaroStopWifiResult>;
|
|
16
|
+
export declare function setWifiList(option: TaroSetWifiListOption): Promise<TaroSetWifiListResult>;
|
|
17
|
+
export declare function connectWifi(option: TaroConnectWifiOption): Promise<TaroConnectWifiResult>;
|
|
18
|
+
export declare function getConnectedWifi(option?: TaroGetConnectedWifiOption): Promise<TaroGetConnectedWifiResult>;
|
|
19
|
+
export declare function getWifiList(option?: TaroGetWifiListOption): Promise<TaroGetWifiListResult>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=wifi.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as appFrameworkApi from '@byted-doubao-apps/framework/api';
|
|
2
|
+
import { buildOkCallbackResult, runTaroApi } from '../utils.js';
|
|
3
|
+
function mapWifiInfo(wifi) {
|
|
4
|
+
return {
|
|
5
|
+
SSID: wifi?.ssid ?? '',
|
|
6
|
+
BSSID: wifi?.bssid ?? '',
|
|
7
|
+
secure: typeof wifi?.secure === 'boolean' ? wifi.secure : false,
|
|
8
|
+
signalStrength: typeof wifi?.signalStrength === 'number' ? wifi.signalStrength : 0,
|
|
9
|
+
frequency: typeof wifi?.frequency === 'number' ? wifi.frequency : undefined
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function buildGetConnectedWifiResult(result) {
|
|
13
|
+
return {
|
|
14
|
+
wifi: mapWifiInfo(result.wifi),
|
|
15
|
+
...buildOkCallbackResult('getConnectedWifi')
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function buildWifiOkResult(apiName) {
|
|
19
|
+
return buildOkCallbackResult(apiName);
|
|
20
|
+
}
|
|
21
|
+
export async function startWifi(option) {
|
|
22
|
+
return runTaroApi('startWifi', option, async () => {
|
|
23
|
+
await appFrameworkApi.startWifi({});
|
|
24
|
+
return buildWifiOkResult('startWifi');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export async function stopWifi(option) {
|
|
28
|
+
return runTaroApi('stopWifi', option, async () => {
|
|
29
|
+
await appFrameworkApi.stopWifi({});
|
|
30
|
+
return buildWifiOkResult('stopWifi');
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export async function setWifiList(option) {
|
|
34
|
+
return runTaroApi('setWifiList', option, async () => {
|
|
35
|
+
await appFrameworkApi.setWifiList({
|
|
36
|
+
wifiList: Array.isArray(option.wifiList)
|
|
37
|
+
? option.wifiList.map((item) => ({
|
|
38
|
+
ssid: item.SSID,
|
|
39
|
+
bssid: item.BSSID,
|
|
40
|
+
password: item.password
|
|
41
|
+
}))
|
|
42
|
+
: []
|
|
43
|
+
});
|
|
44
|
+
return buildWifiOkResult('setWifiList');
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export async function connectWifi(option) {
|
|
48
|
+
return runTaroApi('connectWifi', option, async () => {
|
|
49
|
+
await appFrameworkApi.connectWifi({
|
|
50
|
+
ssid: option.SSID,
|
|
51
|
+
password: option.password,
|
|
52
|
+
bssid: option.BSSID,
|
|
53
|
+
manual: option.maunal,
|
|
54
|
+
partialInfo: option.partialInfo
|
|
55
|
+
});
|
|
56
|
+
return buildWifiOkResult('connectWifi');
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export async function getConnectedWifi(option) {
|
|
60
|
+
return runTaroApi('getConnectedWifi', option, async () => buildGetConnectedWifiResult(await appFrameworkApi.getConnectedWifi({
|
|
61
|
+
partialInfo: option?.partialInfo
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
export async function getWifiList(option) {
|
|
65
|
+
return runTaroApi('getWifiList', option, async () => {
|
|
66
|
+
await appFrameworkApi.getWifiList({});
|
|
67
|
+
return buildWifiOkResult('getWifiList');
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=wifi.js.map
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { getEnv, ENV_TYPE } from './base/index.js';
|
|
2
|
+
export * from './device/index.js';
|
|
3
|
+
export * from './device/index.js';
|
|
2
4
|
export { request } from './request/index.js';
|
|
3
5
|
export { exitMiniProgram, navigateBack, navigateTo, getCurrentPages, reLaunch, redirectTo } from './router/index.js';
|
|
4
6
|
export { setStorage, setStorageSync, getStorage, getStorageSync, removeStorage, removeStorageSync, clearStorage, clearStorageSync, getStorageInfo, getStorageInfoSync } from './storage/index.js';
|
|
5
|
-
export
|
|
7
|
+
export * from './system/index.js';
|
|
6
8
|
export { getLocation } from './location/index.js';
|
|
7
9
|
export { showToast } from './show-toast/index.js';
|
|
8
10
|
export { createMapContext } from './map/index.js';
|
package/dist/api/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { getEnv, ENV_TYPE } from './base/index.js';
|
|
2
|
+
export * from './device/index.js';
|
|
3
|
+
export * from './device/index.js';
|
|
2
4
|
export { request } from './request/index.js';
|
|
3
5
|
export { exitMiniProgram, navigateBack, navigateTo, getCurrentPages, reLaunch, redirectTo } from './router/index.js';
|
|
4
6
|
export { setStorage, setStorageSync, getStorage, getStorageSync, removeStorage, removeStorageSync, clearStorage, clearStorageSync, getStorageInfo, getStorageInfoSync } from './storage/index.js';
|
|
5
|
-
export
|
|
7
|
+
export * from './system/index.js';
|
|
6
8
|
export { getLocation } from './location/index.js';
|
|
7
9
|
export { showToast } from './show-toast/index.js';
|
|
8
10
|
export { createMapContext } from './map/index.js';
|
package/dist/api/system/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { getAppBaseInfoSync, getWindowInfoSync, makePhoneCall as appMakePhoneCall, getNetworkType as appGetNetworkType, getScreenBrightness as appGetScreenBrightness, setClipboardData as appSetClipboardData, onKeyboardHeightChange as appOnKeyboardHeightChange } from '@byted-doubao-apps/framework/api';
|
|
2
2
|
import { buildFailCallbackResult, emitFailure, runCallbackApi, runTaroApi } from '../utils.js';
|
|
3
|
+
function buildVibrateShortParams(option) {
|
|
4
|
+
if (option?.type === 'heavy' || option?.type === 'medium' || option?.type === 'light') {
|
|
5
|
+
return { type: option.type };
|
|
6
|
+
}
|
|
7
|
+
return { type: 'medium' };
|
|
8
|
+
}
|
|
3
9
|
export function getSystemSetting() {
|
|
4
10
|
return {};
|
|
5
11
|
}
|
package/dist/api/utils.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function runAsyncApi<TSuccess, TFail, TComplete = TSuccess | TFai
|
|
|
15
15
|
export declare function normalizeErrorMessage(error: unknown, fallbackMessage?: string): string;
|
|
16
16
|
export declare function buildOkCallbackResult(apiName: string): TaroGeneral.CallbackResult;
|
|
17
17
|
export declare function buildFailCallbackResult(apiName: string, error: unknown, fallbackMessage?: string): TaroGeneral.CallbackResult;
|
|
18
|
-
export declare function runCallbackApi(apiName: string, callbacks:
|
|
19
|
-
export declare function runTaroApi<TSuccess, TComplete = TSuccess>(apiName: string, callbacks:
|
|
18
|
+
export declare function runCallbackApi(apiName: string, callbacks: unknown, run: () => MaybePromise<unknown>): Promise<TaroGeneral.CallbackResult>;
|
|
19
|
+
export declare function runTaroApi<TSuccess, TComplete = TSuccess>(apiName: string, callbacks: unknown, run: () => MaybePromise<TSuccess>, buildCompleteResult?: (result: TSuccess) => TComplete): Promise<TSuccess>;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/api/utils.js
CHANGED
|
@@ -45,18 +45,14 @@ export function buildFailCallbackResult(apiName, error, fallbackMessage) {
|
|
|
45
45
|
return buildCallbackResult(apiName, 'fail', normalizeErrorMessage(error, fallbackMessage));
|
|
46
46
|
}
|
|
47
47
|
export function runCallbackApi(apiName, callbacks, run) {
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
await run();
|
|
52
|
-
return buildOkCallbackResult(apiName);
|
|
53
|
-
},
|
|
54
|
-
buildFailResult: (error) => buildFailCallbackResult(apiName, error)
|
|
48
|
+
return runTaroApi(apiName, callbacks, async () => {
|
|
49
|
+
await run();
|
|
50
|
+
return buildOkCallbackResult(apiName);
|
|
55
51
|
});
|
|
56
52
|
}
|
|
57
53
|
export function runTaroApi(apiName, callbacks, run, buildCompleteResult) {
|
|
58
54
|
return runAsyncApi({
|
|
59
|
-
callbacks,
|
|
55
|
+
callbacks: callbacks,
|
|
60
56
|
run,
|
|
61
57
|
buildFailResult: (error) => buildFailCallbackResult(apiName, error),
|
|
62
58
|
buildCompleteResult
|
|
@@ -12,6 +12,10 @@ function DoubaoAppsMap(props) {
|
|
|
12
12
|
const [activeCalloutMarkerId, setActiveCalloutMarkerId] = useState(undefined);
|
|
13
13
|
const [imperativeAddedMarkers, setImperativeAddedMarkers] = useState([]);
|
|
14
14
|
const [imperativeRemovedMarkerIds, setImperativeRemovedMarkerIds] = useState([]);
|
|
15
|
+
const rawMapStyle = props.mapStyle;
|
|
16
|
+
const passedThroughMapStyle = typeof rawMapStyle === 'string' ? rawMapStyle : undefined;
|
|
17
|
+
const unsupportedRest = { ...rest };
|
|
18
|
+
delete unsupportedRest.mapStyle;
|
|
15
19
|
const resolvedCenter = useMemo(() => ({
|
|
16
20
|
latitude,
|
|
17
21
|
longitude
|
|
@@ -85,7 +89,7 @@ function DoubaoAppsMap(props) {
|
|
|
85
89
|
resolvedMapStyle,
|
|
86
90
|
includePadding,
|
|
87
91
|
includePoints,
|
|
88
|
-
rest,
|
|
92
|
+
rest: unsupportedRest,
|
|
89
93
|
resolvedSetting,
|
|
90
94
|
resolvedMarkers,
|
|
91
95
|
polyline,
|
|
@@ -131,7 +135,7 @@ function DoubaoAppsMap(props) {
|
|
|
131
135
|
const renderMarkers = composeMarkers(resolvedMarkers, imperativeAddedMarkers, imperativeRemovedMarkerIds);
|
|
132
136
|
return (<map className={className || ''} ref={mapRef} style={mergeMapStyle(style, hidden)}
|
|
133
137
|
// @ts-expect-error
|
|
134
|
-
enableNativeInteraction={rest.enableNativeInteraction} mapStyle={resolvedMapStyle}
|
|
138
|
+
enableNativeInteraction={rest.enableNativeInteraction} mapStyle={passedThroughMapStyle ?? resolvedMapStyle}
|
|
135
139
|
// @ts-ignore
|
|
136
140
|
center={longitude !== undefined && latitude !== undefined ? resolvedCenter : undefined} scale={resolvedScale} minScale={resolvedMinScale} maxScale={resolvedMaxScale} rotate={resolvedRotate} showScale={resolvedShowScale} enableTilt={resolvedEnableTilt} enableScale={resolvedEnableScale} enableDrag={resolvedEnableDrag} enableRotate={resolvedEnableRotate} polyline={resolvePolylines(polyline)} circles={resolveNativeCircles(circles)} polygons={resolveNativePolygons(resolvedPolygons)} onClick={(detail) => {
|
|
137
141
|
const event = toCommonEvent({ point: detail.point }, 'tap', mapId);
|
package/package.json
CHANGED