@tarojs/taro-h5 3.5.0-theta.0 → 3.5.1-aplha.0
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/ad/index.d.ts +6 -0
- package/dist/api/ai/facial.d.ts +9 -0
- package/dist/api/ai/index.d.ts +2 -0
- package/dist/api/ai/visual.d.ts +6 -0
- package/dist/api/alipay/index.d.ts +3 -0
- package/dist/api/base/crypto.d.ts +3 -0
- package/dist/api/base/debug.d.ts +9 -0
- package/dist/api/base/index.d.ts +12 -0
- package/dist/api/base/performance.d.ts +6 -0
- package/dist/api/base/system.d.ts +27 -0
- package/dist/api/base/system.js +2 -2
- package/dist/api/base/update.d.ts +6 -0
- package/dist/api/base/weapp/app-event.d.ts +41 -0
- package/dist/api/base/weapp/life-cycle.d.ts +6 -0
- package/dist/api/canvas/CanvasContext.d.ts +104 -0
- package/dist/api/canvas/canvasGetImageData.d.ts +5 -0
- package/dist/api/canvas/canvasPutImageData.d.ts +6 -0
- package/dist/api/canvas/canvasToTempFilePath.d.ts +6 -0
- package/dist/api/canvas/canvasToTempFilePath.js +1 -1
- package/dist/api/canvas/createCanvasContext.d.ts +5 -0
- package/dist/api/canvas/index.d.ts +12 -0
- package/dist/api/cloud/index.d.ts +31 -0
- package/dist/api/data-analysis/index.d.ts +12 -0
- package/dist/api/device/accelerometer.d.ts +17 -0
- package/dist/api/device/accessibility.d.ts +3 -0
- package/dist/api/device/battery.d.ts +5 -0
- package/dist/api/device/bluetooth-ble.d.ts +48 -0
- package/dist/api/device/bluetooth-peripheral.d.ts +9 -0
- package/dist/api/device/bluetooth.d.ts +39 -0
- package/dist/api/device/calendar.d.ts +6 -0
- package/dist/api/device/clipboard.d.ts +15 -0
- package/dist/api/device/compass.d.ts +17 -0
- package/dist/api/device/contact.d.ts +6 -0
- package/dist/api/device/crypto.d.ts +3 -0
- package/dist/api/device/gyroscope.d.ts +12 -0
- package/dist/api/device/iBeacon.d.ts +21 -0
- package/dist/api/device/index.d.ts +23 -0
- package/dist/api/device/keyboard.d.ts +12 -0
- package/dist/api/device/memory.d.ts +6 -0
- package/dist/api/device/motion.d.ts +17 -0
- package/dist/api/device/network.d.ts +20 -0
- package/dist/api/device/nfc.d.ts +21 -0
- package/dist/api/device/phone.d.ts +2 -0
- package/dist/api/device/scan.d.ts +3 -0
- package/dist/api/device/screen.d.ts +18 -0
- package/dist/api/device/vibrate.d.ts +9 -0
- package/dist/api/device/vibrate.js +5 -7
- package/dist/api/device/wifi.d.ts +33 -0
- package/dist/api/ext/index.d.ts +6 -0
- package/dist/api/files/index.d.ts +24 -0
- package/dist/api/framework/index.d.ts +4 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/location/chooseLocation.d.ts +6 -0
- package/dist/api/location/getLocation.d.ts +2 -0
- package/dist/api/location/index.d.ts +32 -0
- package/dist/api/location/index.js +1 -0
- package/dist/api/media/EditorContext.d.ts +42 -0
- package/dist/api/media/audio/InnerAudioContext.d.ts +58 -0
- package/dist/api/media/audio/index.d.ts +29 -0
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +71 -0
- package/dist/api/media/background-audio/index.d.ts +29 -0
- package/dist/api/media/camera.d.ts +3 -0
- package/dist/api/media/image/chooseImage.d.ts +5 -0
- package/dist/api/media/image/getImageInfo.d.ts +5 -0
- package/dist/api/media/image/index.d.ts +15 -0
- package/dist/api/media/image/previewImage.d.ts +8 -0
- package/dist/api/media/index.d.ts +12 -0
- package/dist/api/media/live.d.ts +6 -0
- package/dist/api/media/map.d.ts +3 -0
- package/dist/api/media/media-recorder.d.ts +3 -0
- package/dist/api/media/recorder.d.ts +9 -0
- package/dist/api/media/video/index.d.ts +24 -0
- package/dist/api/media/video-decoder.d.ts +3 -0
- package/dist/api/media/video-processing.d.ts +3 -0
- package/dist/api/media/voip.d.ts +42 -0
- package/dist/api/navigate/index.d.ts +12 -0
- package/dist/api/network/download.d.ts +6 -0
- package/dist/api/network/index.d.ts +7 -0
- package/dist/api/network/mdns.d.ts +30 -0
- package/dist/api/network/request/index.d.ts +4 -0
- package/dist/api/network/tcp.d.ts +3 -0
- package/dist/api/network/udp.d.ts +3 -0
- package/dist/api/network/upload.d.ts +5 -0
- package/{src/api/network/utils.ts → dist/api/network/utils.d.ts} +44 -72
- package/dist/api/network/websocket/index.d.ts +7 -0
- package/dist/api/network/websocket/socketTask.d.ts +25 -0
- package/dist/api/open-api/account.d.ts +3 -0
- package/dist/api/open-api/address.d.ts +3 -0
- package/dist/api/open-api/authorize.d.ts +6 -0
- package/dist/api/open-api/card.d.ts +6 -0
- package/dist/api/open-api/channels-live.d.ts +18 -0
- package/dist/api/open-api/customer-service.d.ts +3 -0
- package/dist/api/open-api/facial.d.ts +12 -0
- package/dist/api/open-api/favorites.d.ts +6 -0
- package/dist/api/open-api/group.d.ts +3 -0
- package/dist/api/open-api/index.d.ts +18 -0
- package/dist/api/open-api/invoice.d.ts +6 -0
- package/dist/api/open-api/license-plate.d.ts +3 -0
- package/dist/api/open-api/login.d.ts +9 -0
- package/dist/api/open-api/red-package.d.ts +3 -0
- package/dist/api/open-api/settings.d.ts +6 -0
- package/dist/api/open-api/soter.d.ts +9 -0
- package/dist/api/open-api/subscribe-message.d.ts +3 -0
- package/dist/api/open-api/user-info.d.ts +6 -0
- package/dist/api/open-api/werun.d.ts +6 -0
- package/dist/api/payment/index.d.ts +6 -0
- package/dist/api/route/index.d.ts +1 -0
- package/dist/api/share/index.d.ts +30 -0
- package/dist/api/storage/background-fetch.d.ts +12 -0
- package/dist/api/storage/index.d.ts +18 -0
- package/dist/api/swan/index.d.ts +63 -0
- package/dist/api/taro.d.ts +12 -0
- package/dist/api/ui/animation/index.d.ts +2 -0
- package/dist/api/ui/background.d.ts +6 -0
- package/dist/api/ui/custom-component.d.ts +1 -0
- package/dist/api/ui/fonts.d.ts +2 -0
- package/dist/api/ui/index.d.ts +12 -0
- package/dist/api/ui/interaction/actionSheet.d.ts +61 -0
- package/dist/api/ui/interaction/index.d.ts +14 -0
- package/dist/api/ui/interaction/modal.d.ts +69 -0
- package/dist/api/ui/interaction/modal.js +1 -0
- package/dist/api/ui/interaction/toast.d.ts +85 -0
- package/dist/api/ui/menu.d.ts +3 -0
- package/dist/api/ui/navigation-bar/index.d.ts +15 -0
- package/dist/api/ui/navigation-bar/index.js +2 -3
- package/dist/api/ui/pull-down-refresh.d.ts +9 -0
- package/dist/api/ui/scroll/index.d.ts +5 -0
- package/dist/api/ui/scroll/index.js +5 -5
- package/dist/api/ui/sticky.d.ts +3 -0
- package/dist/api/ui/tab-bar.d.ts +34 -0
- package/dist/api/ui/window.d.ts +15 -0
- package/dist/api/worker/index.d.ts +3 -0
- package/dist/api/wxml/index.d.ts +5 -0
- package/dist/api/wxml/nodesRef.d.ts +13 -0
- package/dist/api/wxml/selectorQuery.d.ts +24 -0
- package/dist/api/wxml/selectorQuery.js +1 -1
- package/dist/index.cjs.d.ts +1373 -0
- package/dist/index.cjs.js +18 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.d.ts +1373 -0
- package/dist/index.esm.js +18 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/taroApis.d.ts +1364 -0
- package/dist/taroApis.js +1 -1
- package/dist/utils/animation.d.ts +6 -0
- package/dist/utils/handler.d.ts +48 -0
- package/dist/utils/index.d.ts +39 -0
- package/dist/utils/lodash.d.ts +2 -0
- package/dist/utils/valid.d.ts +2 -0
- package/package.json +17 -18
- package/types/api.d.ts +4 -0
- package/types/define.d.ts +2 -0
- package/types/index.d.ts +33 -0
- package/types/overlay.d.ts +9 -0
- package/src/api/ad/index.ts +0 -5
- package/src/api/ai/facial.ts +0 -6
- package/src/api/ai/index.ts +0 -2
- package/src/api/ai/visual.ts +0 -7
- package/src/api/alipay/index.ts +0 -4
- package/src/api/base/crypto.ts +0 -4
- package/src/api/base/debug.ts +0 -5
- package/src/api/base/index.ts +0 -23
- package/src/api/base/performance.ts +0 -5
- package/src/api/base/system.ts +0 -207
- package/src/api/base/update.ts +0 -5
- package/src/api/base/weapp/app-event.ts +0 -79
- package/src/api/base/weapp/life-cycle.ts +0 -5
- package/src/api/canvas/CanvasContext.ts +0 -233
- package/src/api/canvas/canvasGetImageData.ts +0 -28
- package/src/api/canvas/canvasPutImageData.ts +0 -25
- package/src/api/canvas/canvasToTempFilePath.ts +0 -25
- package/src/api/canvas/createCanvasContext.ts +0 -19
- package/src/api/canvas/index.ts +0 -18
- package/src/api/cloud/index.ts +0 -32
- package/src/api/data-analysis/index.ts +0 -6
- package/src/api/device/accelerometer.ts +0 -79
- package/src/api/device/accessibility.ts +0 -4
- package/src/api/device/battery.ts +0 -23
- package/src/api/device/bluetooth-ble.ts +0 -19
- package/src/api/device/bluetooth-peripheral.ts +0 -6
- package/src/api/device/bluetooth.ts +0 -16
- package/src/api/device/calendar.ts +0 -5
- package/src/api/device/clipboard.ts +0 -68
- package/src/api/device/compass.ts +0 -83
- package/src/api/device/contact.ts +0 -5
- package/src/api/device/crypto.ts +0 -4
- package/src/api/device/gyroscope.ts +0 -7
- package/src/api/device/iBeacon.ts +0 -10
- package/src/api/device/index.ts +0 -23
- package/src/api/device/keyboard.ts +0 -7
- package/src/api/device/memory.ts +0 -5
- package/src/api/device/motion.ts +0 -77
- package/src/api/device/network.ts +0 -90
- package/src/api/device/nfc.ts +0 -10
- package/src/api/device/phone.ts +0 -31
- package/src/api/device/scan.ts +0 -11
- package/src/api/device/screen.ts +0 -9
- package/src/api/device/vibrate.ts +0 -37
- package/src/api/device/wifi.ts +0 -14
- package/src/api/ext/index.ts +0 -5
- package/src/api/files/index.ts +0 -11
- package/src/api/framework/index.ts +0 -10
- package/src/api/index.ts +0 -24
- package/src/api/location/chooseLocation.ts +0 -117
- package/src/api/location/getLocation.ts +0 -81
- package/src/api/location/index.ts +0 -22
- package/src/api/location/style.css +0 -79
- package/src/api/media/EditorContext.ts +0 -32
- package/src/api/media/audio/InnerAudioContext.ts +0 -99
- package/src/api/media/audio/index.ts +0 -21
- package/src/api/media/background-audio/BackgroundAudioManager.ts +0 -104
- package/src/api/media/background-audio/index.ts +0 -17
- package/src/api/media/camera.ts +0 -4
- package/src/api/media/image/chooseImage.ts +0 -95
- package/src/api/media/image/getImageInfo.ts +0 -50
- package/src/api/media/image/index.ts +0 -13
- package/src/api/media/image/previewImage.ts +0 -80
- package/src/api/media/index.ts +0 -12
- package/src/api/media/live.ts +0 -5
- package/src/api/media/map.ts +0 -4
- package/src/api/media/media-recorder.ts +0 -4
- package/src/api/media/recorder.ts +0 -6
- package/src/api/media/video/index.ts +0 -82
- package/src/api/media/video-decoder.ts +0 -4
- package/src/api/media/video-processing.ts +0 -4
- package/src/api/media/voip.ts +0 -17
- package/src/api/navigate/index.ts +0 -7
- package/src/api/network/download.ts +0 -142
- package/src/api/network/index.ts +0 -7
- package/src/api/network/mdns.ts +0 -13
- package/src/api/network/request/index.ts +0 -135
- package/src/api/network/tcp.ts +0 -4
- package/src/api/network/udp.ts +0 -4
- package/src/api/network/upload.ts +0 -170
- package/src/api/network/websocket/index.ts +0 -88
- package/src/api/network/websocket/socketTask.ts +0 -89
- package/src/api/open-api/account.ts +0 -4
- package/src/api/open-api/address.ts +0 -4
- package/src/api/open-api/authorize.ts +0 -5
- package/src/api/open-api/card.ts +0 -5
- package/src/api/open-api/channels-live.ts +0 -9
- package/src/api/open-api/customer-service.ts +0 -4
- package/src/api/open-api/facial.ts +0 -7
- package/src/api/open-api/favorites.ts +0 -5
- package/src/api/open-api/group.ts +0 -4
- package/src/api/open-api/index.ts +0 -18
- package/src/api/open-api/invoice.ts +0 -5
- package/src/api/open-api/license-plate.ts +0 -4
- package/src/api/open-api/login.ts +0 -6
- package/src/api/open-api/red-package.ts +0 -4
- package/src/api/open-api/settings.ts +0 -5
- package/src/api/open-api/soter.ts +0 -6
- package/src/api/open-api/subscribe-message.ts +0 -4
- package/src/api/open-api/user-info.ts +0 -5
- package/src/api/open-api/werun.ts +0 -5
- package/src/api/payment/index.ts +0 -5
- package/src/api/route/index.ts +0 -10
- package/src/api/share/index.ts +0 -13
- package/src/api/storage/background-fetch.ts +0 -7
- package/src/api/storage/index.ts +0 -182
- package/src/api/swan/index.ts +0 -31
- package/src/api/taro.ts +0 -84
- package/src/api/ui/animation/index.ts +0 -356
- package/src/api/ui/background.ts +0 -5
- package/src/api/ui/custom-component.ts +0 -4
- package/src/api/ui/fonts.ts +0 -64
- package/src/api/ui/index.ts +0 -12
- package/src/api/ui/interaction/actionSheet.ts +0 -212
- package/src/api/ui/interaction/index.ts +0 -302
- package/src/api/ui/interaction/modal.ts +0 -237
- package/src/api/ui/interaction/toast.ts +0 -220
- package/src/api/ui/menu.ts +0 -4
- package/src/api/ui/navigation-bar/index.ts +0 -52
- package/src/api/ui/pull-down-refresh.ts +0 -28
- package/src/api/ui/scroll/index.ts +0 -85
- package/src/api/ui/sticky.ts +0 -4
- package/src/api/ui/tab-bar.ts +0 -327
- package/src/api/ui/window.ts +0 -38
- package/src/api/worker/index.ts +0 -4
- package/src/api/wxml/index.ts +0 -10
- package/src/api/wxml/nodesRef.ts +0 -56
- package/src/api/wxml/selectorQuery.ts +0 -220
- package/src/index.ts +0 -6
- package/src/utils/animation.ts +0 -15
- package/src/utils/handler.ts +0 -105
- package/src/utils/index.ts +0 -179
- package/src/utils/lodash.ts +0 -30
- package/src/utils/valid.ts +0 -8
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const canIUse: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare function arrayBufferToBase64(arrayBuffer: any): string;
|
|
5
|
+
export declare function base64ToArrayBuffer(base64: any): Uint8Array;
|
|
6
|
+
export * from './crypto';
|
|
7
|
+
export * from './debug';
|
|
8
|
+
export * from './performance';
|
|
9
|
+
export * from './system';
|
|
10
|
+
export * from './update';
|
|
11
|
+
export * from './weapp/app-event';
|
|
12
|
+
export * from './weapp/life-cycle';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
/** 跳转系统蓝牙设置页 */
|
|
3
|
+
export declare const openSystemBluetoothSetting: () => Promise<{
|
|
4
|
+
/** 微信版本号 */
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** 跳转系统微信授权管理页 */
|
|
8
|
+
export declare const openAppAuthorizeSetting: () => Promise<{
|
|
9
|
+
/** 微信版本号 */
|
|
10
|
+
errMsg: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** 获取窗口信息 */
|
|
13
|
+
export declare const getWindowInfo: typeof Taro.getWindowInfo;
|
|
14
|
+
/** 获取设备设置 */
|
|
15
|
+
export declare const getSystemSetting: typeof Taro.getSystemSetting;
|
|
16
|
+
/** 获取设备设置 */
|
|
17
|
+
export declare const getDeviceInfo: typeof Taro.getDeviceInfo;
|
|
18
|
+
/** 获取微信APP基础信息 */
|
|
19
|
+
export declare const getAppBaseInfo: typeof Taro.getAppBaseInfo;
|
|
20
|
+
/** 获取微信APP授权设置 */
|
|
21
|
+
export declare const getAppAuthorizeSetting: typeof Taro.getAppAuthorizeSetting;
|
|
22
|
+
/** 获取设备设置 */
|
|
23
|
+
export declare const getSystemInfoSync: typeof Taro.getSystemInfoSync;
|
|
24
|
+
/** 获取系统信息 */
|
|
25
|
+
export declare const getSystemInfoAsync: typeof Taro.getSystemInfoAsync;
|
|
26
|
+
/** 获取系统信息 */
|
|
27
|
+
export declare const getSystemInfo: typeof Taro.getSystemInfo;
|
package/dist/api/base/system.js
CHANGED
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import
|
|
10
|
+
import { getMobileDetect } from '@tarojs/router/dist/utils/navigate';
|
|
11
11
|
import { temporarilyNotSupport } from '../../utils';
|
|
12
12
|
import { MethodHandler } from '../../utils/handler';
|
|
13
13
|
/** 跳转系统蓝牙设置页 */
|
|
@@ -58,7 +58,7 @@ export const getSystemSetting = () => {
|
|
|
58
58
|
};
|
|
59
59
|
/** 获取设备设置 */
|
|
60
60
|
export const getDeviceInfo = () => {
|
|
61
|
-
const md =
|
|
61
|
+
const md = getMobileDetect();
|
|
62
62
|
const info = {
|
|
63
63
|
/** 应用二进制接口类型(仅 Android 支持) */
|
|
64
64
|
abi: '',
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
export declare const onUnhandledRejection: () => Promise<{
|
|
3
|
+
errMsg: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const onThemeChange: () => Promise<{
|
|
6
|
+
errMsg: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const onPageNotFound: () => Promise<{
|
|
9
|
+
errMsg: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const onError: () => Promise<{
|
|
12
|
+
errMsg: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const onAudioInterruptionEnd: () => Promise<{
|
|
15
|
+
errMsg: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const onAudioInterruptionBegin: () => Promise<{
|
|
18
|
+
errMsg: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const onAppShow: typeof Taro.onAppShow;
|
|
21
|
+
export declare const onAppHide: typeof Taro.onAppHide;
|
|
22
|
+
export declare const offUnhandledRejection: () => Promise<{
|
|
23
|
+
errMsg: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const offThemeChange: () => Promise<{
|
|
26
|
+
errMsg: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const offPageNotFound: () => Promise<{
|
|
29
|
+
errMsg: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const offError: () => Promise<{
|
|
32
|
+
errMsg: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const offAudioInterruptionEnd: () => Promise<{
|
|
35
|
+
errMsg: string;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const offAudioInterruptionBegin: () => Promise<{
|
|
38
|
+
errMsg: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const offAppShow: typeof Taro.offWindowResize;
|
|
41
|
+
export declare const offAppHide: typeof Taro.offWindowResize;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { CanvasGradient } from '@tarojs/api';
|
|
2
|
+
interface IAction {
|
|
3
|
+
func: (...arr: any[]) => void;
|
|
4
|
+
args: any[];
|
|
5
|
+
}
|
|
6
|
+
export declare class CanvasContext implements Taro.CanvasContext {
|
|
7
|
+
__raw__: CanvasRenderingContext2D;
|
|
8
|
+
actions: IAction[];
|
|
9
|
+
constructor(canvas: any, ctx: any);
|
|
10
|
+
set ctx(e: CanvasRenderingContext2D);
|
|
11
|
+
get ctx(): CanvasRenderingContext2D;
|
|
12
|
+
canvas: HTMLCanvasElement;
|
|
13
|
+
protected emptyActions(): void;
|
|
14
|
+
protected enqueueActions(func: IAction['func'], ...args: any[]): void;
|
|
15
|
+
set fillStyle(e: string);
|
|
16
|
+
get fillStyle(): string;
|
|
17
|
+
set font(e: string);
|
|
18
|
+
get font(): string;
|
|
19
|
+
set globalAlpha(e: number);
|
|
20
|
+
get globalAlpha(): number;
|
|
21
|
+
set globalCompositeOperation(e: GlobalCompositeOperation);
|
|
22
|
+
get globalCompositeOperation(): GlobalCompositeOperation;
|
|
23
|
+
set lineCap(e: CanvasLineCap);
|
|
24
|
+
get lineCap(): CanvasLineCap;
|
|
25
|
+
set lineDashOffset(e: number);
|
|
26
|
+
get lineDashOffset(): number;
|
|
27
|
+
set lineJoin(e: CanvasLineJoin);
|
|
28
|
+
get lineJoin(): CanvasLineJoin;
|
|
29
|
+
set lineWidth(e: number);
|
|
30
|
+
get lineWidth(): number;
|
|
31
|
+
set miterLimit(e: number);
|
|
32
|
+
get miterLimit(): number;
|
|
33
|
+
set shadowBlur(e: number);
|
|
34
|
+
get shadowBlur(): number;
|
|
35
|
+
set shadowColor(e: string);
|
|
36
|
+
get shadowColor(): string;
|
|
37
|
+
set shadowOffsetX(e: number);
|
|
38
|
+
get shadowOffsetX(): number;
|
|
39
|
+
set shadowOffsetY(e: number);
|
|
40
|
+
get shadowOffsetY(): number;
|
|
41
|
+
set strokeStyle(e: string);
|
|
42
|
+
get strokeStyle(): string;
|
|
43
|
+
/** 小程序文档中不包括 ↓↓↓ */
|
|
44
|
+
set textAlign(e: CanvasTextAlign);
|
|
45
|
+
get textAlign(): CanvasTextAlign;
|
|
46
|
+
set textBaseline(e: CanvasTextBaseline);
|
|
47
|
+
get textBaseline(): CanvasTextBaseline;
|
|
48
|
+
set direction(e: CanvasDirection);
|
|
49
|
+
get direction(): CanvasDirection;
|
|
50
|
+
set imageSmoothingEnabled(e: boolean);
|
|
51
|
+
get imageSmoothingEnabled(): boolean;
|
|
52
|
+
set imageSmoothingQuality(e: ImageSmoothingQuality);
|
|
53
|
+
get imageSmoothingQuality(): ImageSmoothingQuality;
|
|
54
|
+
set filter(e: string);
|
|
55
|
+
get filter(): string;
|
|
56
|
+
/** 小程序文档中不包括 ↑↑↑ */
|
|
57
|
+
arc(...args: any[]): void;
|
|
58
|
+
arcTo(...args: any[]): void;
|
|
59
|
+
beginPath(...args: any[]): void;
|
|
60
|
+
bezierCurveTo(...args: any[]): void;
|
|
61
|
+
clearRect(...args: any[]): void;
|
|
62
|
+
clip(...args: any[]): void;
|
|
63
|
+
closePath(...args: any[]): void;
|
|
64
|
+
createPattern(image: string, repetition: keyof Taro.CanvasContext.Repetition): void;
|
|
65
|
+
/**
|
|
66
|
+
* 将之前在绘图上下文中的描述(路径、变形、样式)画到 canvas 中。
|
|
67
|
+
* @todo 每次 draw 都会读取 width 和 height
|
|
68
|
+
*/
|
|
69
|
+
draw(reserve?: boolean, callback?: (...args: any[]) => any): Promise<void>;
|
|
70
|
+
drawImage(imageResource: string, ...extra: any[]): void;
|
|
71
|
+
fill(...args: any[]): void;
|
|
72
|
+
fillRect(...args: any[]): void;
|
|
73
|
+
fillText(...args: any[]): void;
|
|
74
|
+
lineTo(...args: any[]): void;
|
|
75
|
+
moveTo(...args: any[]): void;
|
|
76
|
+
quadraticCurveTo(...args: any[]): void;
|
|
77
|
+
rect(...args: any[]): void;
|
|
78
|
+
restore(...args: any[]): void;
|
|
79
|
+
rotate(...args: any[]): void;
|
|
80
|
+
save(...args: any[]): void;
|
|
81
|
+
scale(...args: any[]): void;
|
|
82
|
+
setFillStyle(color: string | CanvasGradient): void;
|
|
83
|
+
setFontSize(fontSize: number): void;
|
|
84
|
+
setGlobalAlpha(alpha: number): void;
|
|
85
|
+
setLineCap(lineCap: keyof Taro.CanvasContext.LineCap): void;
|
|
86
|
+
setLineDash(pattern: number[], offset: number): void;
|
|
87
|
+
setLineJoin(lineJoin: keyof Taro.CanvasContext.LineJoin): void;
|
|
88
|
+
setLineWidth(lineWidth: number): void;
|
|
89
|
+
setMiterLimit(miterLimit: number): void;
|
|
90
|
+
setShadow(offsetX: number, offsetY: number, blur: number, color: string): void;
|
|
91
|
+
setStrokeStyle(color: string | CanvasGradient): void;
|
|
92
|
+
setTextAlign(align: keyof Taro.CanvasContext.Align): void;
|
|
93
|
+
setTextBaseline(textBaseline: keyof Taro.CanvasContext.TextBaseline): void;
|
|
94
|
+
setTransform(...args: any[]): void;
|
|
95
|
+
stroke(...args: any[]): void;
|
|
96
|
+
strokeRect(...args: any[]): void;
|
|
97
|
+
strokeText(...args: any[]): void;
|
|
98
|
+
transform(...args: any[]): void;
|
|
99
|
+
translate(...args: any[]): void;
|
|
100
|
+
measureText(text: string): TextMetrics;
|
|
101
|
+
createCircularGradient(x: number, y: number, r: number): CanvasGradient;
|
|
102
|
+
createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
@@ -9,7 +9,7 @@ export const canvasToTempFilePath = ({ canvasId, fileType, quality, success, fai
|
|
|
9
9
|
const el = findDOM(inst);
|
|
10
10
|
const canvas = el === null || el === void 0 ? void 0 : el.querySelector(`canvas[canvas-id="${canvasId}"]`);
|
|
11
11
|
try {
|
|
12
|
-
const dataURL = canvas === null || canvas === void 0 ? void 0 : canvas.toDataURL(`image/${fileType || 'png'}`, quality);
|
|
12
|
+
const dataURL = canvas === null || canvas === void 0 ? void 0 : canvas.toDataURL(`image/${(fileType === 'jpg' ? 'jpeg' : fileType) || 'png'}`, quality);
|
|
13
13
|
return handle.success({
|
|
14
14
|
tempFilePath: dataURL
|
|
15
15
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 创建离屏 canvas 实例 */
|
|
2
|
+
export declare const createOffscreenCanvas: () => Promise<{
|
|
3
|
+
errMsg: string;
|
|
4
|
+
}>;
|
|
5
|
+
/** 创建 canvas 的绘图上下文 CanvasContext 对象 */
|
|
6
|
+
export * from './createCanvasContext';
|
|
7
|
+
/** 把当前画布指定区域的内容导出生成指定大小的图片 */
|
|
8
|
+
export * from './canvasToTempFilePath';
|
|
9
|
+
/** 将像素数据绘制到画布 */
|
|
10
|
+
export * from './canvasPutImageData';
|
|
11
|
+
/** 获取 canvas 区域隐含的像素数据 */
|
|
12
|
+
export * from './canvasGetImageData';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
export declare class cloud implements Taro.cloud {
|
|
3
|
+
Cloud: new (options: Taro.cloud.IOptions) => Taro.Cloud;
|
|
4
|
+
init: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
CloudID: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
callFunction: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
13
|
+
uploadFile: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
16
|
+
downloadFile: () => Promise<{
|
|
17
|
+
errMsg: string;
|
|
18
|
+
}>;
|
|
19
|
+
getTempFileURL: () => Promise<{
|
|
20
|
+
errMsg: string;
|
|
21
|
+
}>;
|
|
22
|
+
deleteFile: () => Promise<{
|
|
23
|
+
errMsg: string;
|
|
24
|
+
}>;
|
|
25
|
+
database: () => Promise<{
|
|
26
|
+
errMsg: string;
|
|
27
|
+
}>;
|
|
28
|
+
callContainer: () => Promise<{
|
|
29
|
+
errMsg: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const reportMonitor: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const reportAnalytics: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const reportEvent: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const getExptInfoSync: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
/**
|
|
3
|
+
* 停止监听加速度数据。
|
|
4
|
+
*/
|
|
5
|
+
export declare const stopAccelerometer: typeof Taro.stopAccelerometer;
|
|
6
|
+
/**
|
|
7
|
+
* 开始监听加速度数据。
|
|
8
|
+
*/
|
|
9
|
+
export declare const startAccelerometer: typeof Taro.startAccelerometer;
|
|
10
|
+
/**
|
|
11
|
+
* 监听加速度数据事件。频率根据 Taro.startAccelerometer() 的 interval 参数。可使用 Taro.stopAccelerometer() 停止监听。
|
|
12
|
+
*/
|
|
13
|
+
export declare const onAccelerometerChange: typeof Taro.onAccelerometerChange;
|
|
14
|
+
/**
|
|
15
|
+
* 取消监听加速度数据事件,参数为空,则取消所有的事件监听
|
|
16
|
+
*/
|
|
17
|
+
export declare const offAccelerometerChange: typeof Taro.offAccelerometerChange;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const writeBLECharacteristicValue: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const setBLEMTU: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const readBLECharacteristicValue: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const onBLEMTUChange: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const onBLEConnectionStateChange: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const onBLECharacteristicValueChange: () => Promise<{
|
|
17
|
+
errMsg: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const offBLEMTUChange: () => Promise<{
|
|
20
|
+
errMsg: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const offBLEConnectionStateChange: () => Promise<{
|
|
23
|
+
errMsg: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const offBLECharacteristicValueChange: () => Promise<{
|
|
26
|
+
errMsg: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const notifyBLECharacteristicValueChange: () => Promise<{
|
|
29
|
+
errMsg: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const getBLEMTU: () => Promise<{
|
|
32
|
+
errMsg: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const getBLEDeviceServices: () => Promise<{
|
|
35
|
+
errMsg: string;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const getBLEDeviceRSSI: () => Promise<{
|
|
38
|
+
errMsg: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const getBLEDeviceCharacteristics: () => Promise<{
|
|
41
|
+
errMsg: string;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const createBLEConnection: () => Promise<{
|
|
44
|
+
errMsg: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const closeBLEConnection: () => Promise<{
|
|
47
|
+
errMsg: string;
|
|
48
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const onBLEPeripheralConnectionStateChanged: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const offBLEPeripheralConnectionStateChanged: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const createBLEPeripheralServer: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const stopBluetoothDevicesDiscovery: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const startBluetoothDevicesDiscovery: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const openBluetoothAdapter: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const onBluetoothDeviceFound: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const onBluetoothAdapterStateChange: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const offBluetoothDeviceFound: () => Promise<{
|
|
17
|
+
errMsg: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const offBluetoothAdapterStateChange: () => Promise<{
|
|
20
|
+
errMsg: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const makeBluetoothPair: () => Promise<{
|
|
23
|
+
errMsg: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const isBluetoothDevicePaired: () => Promise<{
|
|
26
|
+
errMsg: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const getConnectedBluetoothDevices: () => Promise<{
|
|
29
|
+
errMsg: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const getBluetoothDevices: () => Promise<{
|
|
32
|
+
errMsg: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const getBluetoothAdapterState: () => Promise<{
|
|
35
|
+
errMsg: string;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const closeBluetoothAdapter: () => Promise<{
|
|
38
|
+
errMsg: string;
|
|
39
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 剪贴板部分的api参考了Chameleon项目的实现:
|
|
3
|
+
*
|
|
4
|
+
* setClipboardData: https://github.com/chameleon-team/chameleon-api/tree/master/src/interfaces/setClipBoardData
|
|
5
|
+
* getClipboardData: https://github.com/chameleon-team/chameleon-api/tree/master/src/interfaces/getClipBoardData
|
|
6
|
+
*/
|
|
7
|
+
import Taro from '@tarojs/api';
|
|
8
|
+
/**
|
|
9
|
+
* 设置系统剪贴板的内容
|
|
10
|
+
*/
|
|
11
|
+
export declare const setClipboardData: typeof Taro.setClipboardData;
|
|
12
|
+
/**
|
|
13
|
+
* 获取系统剪贴板的内容
|
|
14
|
+
*/
|
|
15
|
+
export declare const getClipboardData: typeof Taro.getClipboardData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
/**
|
|
3
|
+
* 停止监听罗盘数据
|
|
4
|
+
*/
|
|
5
|
+
export declare const stopCompass: typeof Taro.stopCompass;
|
|
6
|
+
/**
|
|
7
|
+
* 开始监听罗盘数据
|
|
8
|
+
*/
|
|
9
|
+
export declare const startCompass: typeof Taro.startCompass;
|
|
10
|
+
/**
|
|
11
|
+
* 监听罗盘数据变化事件。频率:5 次/秒,接口调用后会自动开始监听,可使用 wx.stopCompass 停止监听。
|
|
12
|
+
*/
|
|
13
|
+
export declare const onCompassChange: typeof Taro.onCompassChange;
|
|
14
|
+
/**
|
|
15
|
+
* 取消监听罗盘数据变化事件,参数为空,则取消所有的事件监听。
|
|
16
|
+
*/
|
|
17
|
+
export declare const offCompassChange: typeof Taro.offCompassChange;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const stopGyroscope: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const startGyroscope: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const onGyroscopeChange: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const offGyroscopeChange: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const stopBeaconDiscovery: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const startBeaconDiscovery: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const onBeaconUpdate: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const onBeaconServiceChange: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const offBeaconUpdate: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const offBeaconServiceChange: () => Promise<{
|
|
17
|
+
errMsg: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const getBeacons: () => Promise<{
|
|
20
|
+
errMsg: string;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from './accelerometer';
|
|
2
|
+
export * from './accessibility';
|
|
3
|
+
export * from './battery';
|
|
4
|
+
export * from './bluetooth';
|
|
5
|
+
export * from './bluetooth-ble';
|
|
6
|
+
export * from './bluetooth-peripheral';
|
|
7
|
+
export * from './calendar';
|
|
8
|
+
export * from './clipboard';
|
|
9
|
+
export * from './compass';
|
|
10
|
+
export * from './contact';
|
|
11
|
+
export * from './crypto';
|
|
12
|
+
export * from './gyroscope';
|
|
13
|
+
export * from './iBeacon';
|
|
14
|
+
export * from './keyboard';
|
|
15
|
+
export * from './memory';
|
|
16
|
+
export * from './motion';
|
|
17
|
+
export * from './network';
|
|
18
|
+
export * from './nfc';
|
|
19
|
+
export * from './phone';
|
|
20
|
+
export * from './scan';
|
|
21
|
+
export * from './screen';
|
|
22
|
+
export * from './vibrate';
|
|
23
|
+
export * from './wifi';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const onKeyboardHeightChange: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const offKeyboardHeightChange: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const hideKeyboard: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const getSelectedTextRange: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|