@tarojs/taro-h5 3.4.4 → 3.4.7
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/scan.js +8 -4
- package/dist/api/location/chooseLocation.js +16 -7
- package/dist/api/location/getLocation.js +64 -0
- package/dist/api/location/index.js +6 -3
- package/dist/api/media/image/chooseImage.js +12 -1
- package/dist/api/media/image/getImageInfo.js +16 -1
- package/dist/api/network/request/index.js +4 -0
- package/dist/api/utils/index.js +30 -25
- package/dist/dist/api/ad/index.d.ts +6 -0
- package/dist/dist/api/ai/facial.d.ts +9 -0
- package/dist/dist/api/ai/index.d.ts +2 -0
- package/dist/dist/api/ai/visual.d.ts +6 -0
- package/dist/dist/api/alipay/index.d.ts +3 -0
- package/dist/dist/api/base/crypto.d.ts +3 -0
- package/dist/dist/api/base/debug.d.ts +9 -0
- package/dist/dist/api/base/index.d.ts +12 -0
- package/dist/dist/api/base/performance.d.ts +6 -0
- package/dist/dist/api/base/system.d.ts +25 -0
- package/dist/dist/api/base/update.d.ts +6 -0
- package/dist/dist/api/base/weapp/app-event.d.ts +48 -0
- package/dist/dist/api/base/weapp/life-cycle.d.ts +6 -0
- package/dist/dist/api/canvas/CanvasContext.d.ts +104 -0
- package/dist/dist/api/canvas/canvasGetImageData.d.ts +5 -0
- package/dist/dist/api/canvas/canvasPutImageData.d.ts +6 -0
- package/dist/dist/api/canvas/canvasToTempFilePath.d.ts +6 -0
- package/dist/dist/api/canvas/createCanvasContext.d.ts +5 -0
- package/dist/dist/api/canvas/index.d.ts +12 -0
- package/dist/dist/api/cloud/index.d.ts +31 -0
- package/dist/dist/api/data-analysis/index.d.ts +12 -0
- package/dist/dist/api/device/accelerometer.d.ts +17 -0
- package/dist/dist/api/device/accessibility.d.ts +3 -0
- package/dist/dist/api/device/battery.d.ts +5 -0
- package/dist/dist/api/device/bluetooth-ble.d.ts +48 -0
- package/dist/dist/api/device/bluetooth-peripheral.d.ts +9 -0
- package/dist/dist/api/device/bluetooth.d.ts +39 -0
- package/dist/dist/api/device/calendar.d.ts +6 -0
- package/dist/dist/api/device/clipboard.d.ts +15 -0
- package/dist/dist/api/device/compass.d.ts +17 -0
- package/dist/dist/api/device/contact.d.ts +6 -0
- package/dist/dist/api/device/crypto.d.ts +3 -0
- package/dist/dist/api/device/gyroscope.d.ts +12 -0
- package/dist/dist/api/device/iBeacon.d.ts +21 -0
- package/dist/dist/api/device/index.d.ts +23 -0
- package/dist/dist/api/device/keyboard.d.ts +12 -0
- package/dist/dist/api/device/memory.d.ts +6 -0
- package/dist/dist/api/device/motion.d.ts +17 -0
- package/dist/dist/api/device/network.d.ts +20 -0
- package/dist/dist/api/device/nfc.d.ts +21 -0
- package/dist/dist/api/device/phone.d.ts +2 -0
- package/dist/dist/api/device/scan.d.ts +3 -0
- package/dist/dist/api/device/screen.d.ts +18 -0
- package/dist/dist/api/device/vibrate.d.ts +9 -0
- package/dist/dist/api/device/wifi.d.ts +33 -0
- package/dist/dist/api/ext/index.d.ts +6 -0
- package/dist/dist/api/files/index.d.ts +24 -0
- package/dist/dist/api/framework/index.d.ts +4 -0
- package/dist/dist/api/index.d.ts +24 -0
- package/dist/dist/api/location/chooseLocation.d.ts +6 -0
- package/dist/dist/api/location/getLocation.d.ts +2 -0
- package/dist/dist/api/location/index.d.ts +29 -0
- package/dist/dist/api/media/EditorContext.d.ts +42 -0
- package/dist/dist/api/media/audio/InnerAudioContext.d.ts +58 -0
- package/dist/dist/api/media/audio/index.d.ts +29 -0
- package/dist/dist/api/media/background-audio/BackgroundAudioManager.d.ts +71 -0
- package/dist/dist/api/media/background-audio/index.d.ts +29 -0
- package/dist/dist/api/media/camera.d.ts +3 -0
- package/dist/dist/api/media/image/chooseImage.d.ts +5 -0
- package/dist/dist/api/media/image/getImageInfo.d.ts +5 -0
- package/dist/dist/api/media/image/index.d.ts +15 -0
- package/dist/dist/api/media/image/previewImage.d.ts +8 -0
- package/dist/dist/api/media/index.d.ts +12 -0
- package/dist/dist/api/media/live.d.ts +6 -0
- package/dist/dist/api/media/map.d.ts +3 -0
- package/dist/dist/api/media/media-recorder.d.ts +3 -0
- package/dist/dist/api/media/recorder.d.ts +9 -0
- package/dist/dist/api/media/video/index.d.ts +24 -0
- package/dist/dist/api/media/video-decoder.d.ts +3 -0
- package/dist/dist/api/media/video-processing.d.ts +3 -0
- package/dist/dist/api/media/voip.d.ts +42 -0
- package/dist/dist/api/navigate/index.d.ts +12 -0
- package/dist/dist/api/network/download.d.ts +6 -0
- package/dist/dist/api/network/index.d.ts +7 -0
- package/dist/dist/api/network/mdns.d.ts +30 -0
- package/dist/dist/api/network/request/index.d.ts +4 -0
- package/dist/dist/api/network/tcp.d.ts +3 -0
- package/dist/dist/api/network/udp.d.ts +3 -0
- package/dist/dist/api/network/upload.d.ts +5 -0
- package/dist/dist/api/network/utils.d.ts +44 -0
- package/dist/dist/api/network/websocket/index.d.ts +7 -0
- package/dist/dist/api/network/websocket/socketTask.d.ts +25 -0
- package/dist/dist/api/open-api/account.d.ts +3 -0
- package/dist/dist/api/open-api/address.d.ts +3 -0
- package/dist/dist/api/open-api/authorize.d.ts +6 -0
- package/dist/dist/api/open-api/card.d.ts +6 -0
- package/dist/dist/api/open-api/channels-live.d.ts +18 -0
- package/dist/dist/api/open-api/customer-service.d.ts +3 -0
- package/dist/dist/api/open-api/facial.d.ts +12 -0
- package/dist/dist/api/open-api/favorites.d.ts +6 -0
- package/dist/dist/api/open-api/group.d.ts +3 -0
- package/dist/dist/api/open-api/index.d.ts +18 -0
- package/dist/dist/api/open-api/invoice.d.ts +6 -0
- package/dist/dist/api/open-api/license-plate.d.ts +3 -0
- package/dist/dist/api/open-api/login.d.ts +9 -0
- package/dist/dist/api/open-api/red-package.d.ts +3 -0
- package/dist/dist/api/open-api/settings.d.ts +6 -0
- package/dist/dist/api/open-api/soter.d.ts +9 -0
- package/dist/dist/api/open-api/subscribe-message.d.ts +3 -0
- package/dist/dist/api/open-api/user-info.d.ts +6 -0
- package/dist/dist/api/open-api/werun.d.ts +6 -0
- package/dist/dist/api/payment/index.d.ts +6 -0
- package/dist/dist/api/route/index.d.ts +1 -0
- package/dist/dist/api/share/index.d.ts +30 -0
- package/dist/dist/api/storage/background-fetch.d.ts +12 -0
- package/dist/dist/api/storage/index.d.ts +18 -0
- package/dist/dist/api/swan/index.d.ts +63 -0
- package/dist/dist/api/taro.d.ts +12 -0
- package/dist/dist/api/ui/animation/index.d.ts +2 -0
- package/dist/dist/api/ui/background.d.ts +6 -0
- package/dist/dist/api/ui/custom-component.d.ts +1 -0
- package/dist/dist/api/ui/fonts.d.ts +2 -0
- package/dist/dist/api/ui/index.d.ts +12 -0
- package/dist/dist/api/ui/interaction/actionSheet.d.ts +61 -0
- package/dist/dist/api/ui/interaction/index.d.ts +14 -0
- package/dist/dist/api/ui/interaction/modal.d.ts +69 -0
- package/dist/dist/api/ui/interaction/toast.d.ts +85 -0
- package/dist/dist/api/ui/menu.d.ts +3 -0
- package/dist/dist/api/ui/navigation-bar/index.d.ts +15 -0
- package/dist/dist/api/ui/pull-down-refresh.d.ts +9 -0
- package/dist/dist/api/ui/scroll/index.d.ts +5 -0
- package/dist/dist/api/ui/sticky.d.ts +3 -0
- package/dist/dist/api/ui/tab-bar.d.ts +34 -0
- package/dist/dist/api/ui/window.d.ts +15 -0
- package/dist/dist/api/utils/handler.d.ts +48 -0
- package/dist/dist/api/utils/index.d.ts +45 -0
- package/dist/dist/api/worker/index.d.ts +3 -0
- package/dist/dist/api/wxml/index.d.ts +5 -0
- package/dist/dist/api/wxml/nodesRef.d.ts +13 -0
- package/dist/dist/api/wxml/selectorQuery.d.ts +24 -0
- package/dist/dist/index.d.ts +4 -0
- package/dist/dist/types/type.d.ts +29 -0
- package/dist/index.cjs.js +4675 -8471
- package/dist/index.cjs.js.map +1 -0
- package/dist/taroApis.js +1 -0
- package/dist/taroApis.js.map +1 -0
- package/package.json +12 -9
- package/src/api/device/scan.ts +8 -4
- package/src/api/location/chooseLocation.ts +14 -4
- package/src/api/location/getLocation.ts +80 -0
- package/src/api/location/index.ts +6 -3
- package/src/api/media/image/chooseImage.ts +18 -1
- package/src/api/media/image/getImageInfo.ts +16 -1
- package/src/api/network/request/index.ts +4 -0
- package/src/api/utils/index.ts +39 -23
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
export declare const setStorageSync: typeof Taro.setStorageSync;
|
|
3
|
+
export declare const setStorage: typeof Taro.setStorage;
|
|
4
|
+
export declare const revokeBufferURL: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const removeStorageSync: typeof Taro.removeStorageSync;
|
|
8
|
+
export declare const removeStorage: typeof Taro.removeStorage;
|
|
9
|
+
export declare const getStorageSync: typeof Taro.getStorageSync;
|
|
10
|
+
export declare const getStorageInfoSync: typeof Taro.getStorageInfoSync;
|
|
11
|
+
export declare const getStorageInfo: typeof Taro.getStorageInfo;
|
|
12
|
+
export declare const getStorage: typeof Taro.getStorage;
|
|
13
|
+
export declare const createBufferURL: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const clearStorageSync: typeof Taro.clearStorageSync;
|
|
17
|
+
export declare const clearStorage: typeof Taro.clearStorage;
|
|
18
|
+
export * from './background-fetch';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const setPageInfo: () => Promise<{
|
|
2
|
+
errMsg: string;
|
|
3
|
+
}>;
|
|
4
|
+
export declare const ocrIdCard: () => Promise<{
|
|
5
|
+
errMsg: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const ocrBankCard: () => Promise<{
|
|
8
|
+
errMsg: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const ocrDrivingLicense: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const ocrVehicleLicense: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const textReview: () => Promise<{
|
|
17
|
+
errMsg: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const textToAudio: () => Promise<{
|
|
20
|
+
errMsg: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const imageAudit: () => Promise<{
|
|
23
|
+
errMsg: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const advancedGeneralIdentify: () => Promise<{
|
|
26
|
+
errMsg: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const objectDetectIdentify: () => Promise<{
|
|
29
|
+
errMsg: string;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const carClassify: () => Promise<{
|
|
32
|
+
errMsg: string;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const dishClassify: () => Promise<{
|
|
35
|
+
errMsg: string;
|
|
36
|
+
}>;
|
|
37
|
+
export declare const logoClassify: () => Promise<{
|
|
38
|
+
errMsg: string;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const animalClassify: () => Promise<{
|
|
41
|
+
errMsg: string;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const plantClassify: () => Promise<{
|
|
44
|
+
errMsg: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const getSwanId: () => Promise<{
|
|
47
|
+
errMsg: string;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const requestPolymerPayment: () => Promise<{
|
|
50
|
+
errMsg: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const navigateToSmartGameProgram: () => Promise<{
|
|
53
|
+
errMsg: string;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const navigateToSmartProgram: () => Promise<{
|
|
56
|
+
errMsg: string;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const navigateBackSmartProgram: () => Promise<{
|
|
59
|
+
errMsg: string;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const preloadSubPackage: () => Promise<{
|
|
62
|
+
errMsg: string;
|
|
63
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
import { history, createRouter } from '@tarojs/router';
|
|
3
|
+
declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
|
|
4
|
+
declare const taro: typeof Taro;
|
|
5
|
+
declare const initPxTransform: any;
|
|
6
|
+
declare const requirePlugin: () => Promise<{
|
|
7
|
+
errMsg: string;
|
|
8
|
+
}>;
|
|
9
|
+
declare const pxTransform: (size: any) => string;
|
|
10
|
+
declare const canIUseWebp: () => boolean;
|
|
11
|
+
export default taro;
|
|
12
|
+
export { Behavior, getEnv, ENV_TYPE, Link, interceptors, initPxTransform, Current, options, eventCenter, Events, preload, requirePlugin, pxTransform, canIUseWebp, history, createRouter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nextTick: (callback: (...args: any[]) => any) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './animation';
|
|
2
|
+
export * from './background';
|
|
3
|
+
export * from './custom-component';
|
|
4
|
+
export * from './fonts';
|
|
5
|
+
export * from './menu';
|
|
6
|
+
export * from './navigation-bar';
|
|
7
|
+
export * from './pull-down-refresh';
|
|
8
|
+
export * from './scroll';
|
|
9
|
+
export * from './sticky';
|
|
10
|
+
export * from './tab-bar';
|
|
11
|
+
export * from './window';
|
|
12
|
+
export * from './interaction';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export default class ActionSheet {
|
|
2
|
+
options: {
|
|
3
|
+
itemList: never[];
|
|
4
|
+
itemColor: string;
|
|
5
|
+
success: () => void;
|
|
6
|
+
fail: () => void;
|
|
7
|
+
complete: () => void;
|
|
8
|
+
};
|
|
9
|
+
style: {
|
|
10
|
+
maskStyle: {
|
|
11
|
+
position: string;
|
|
12
|
+
'z-index': string;
|
|
13
|
+
top: string;
|
|
14
|
+
right: string;
|
|
15
|
+
left: string;
|
|
16
|
+
bottom: string;
|
|
17
|
+
background: string;
|
|
18
|
+
};
|
|
19
|
+
actionSheetStyle: {
|
|
20
|
+
'z-index': string;
|
|
21
|
+
position: string;
|
|
22
|
+
left: string;
|
|
23
|
+
bottom: string;
|
|
24
|
+
'-webkit-transform': string;
|
|
25
|
+
transform: string;
|
|
26
|
+
width: string;
|
|
27
|
+
'line-height': string;
|
|
28
|
+
background: string;
|
|
29
|
+
'-webkit-transition': string;
|
|
30
|
+
transition: string;
|
|
31
|
+
};
|
|
32
|
+
menuStyle: {
|
|
33
|
+
'background-color': string;
|
|
34
|
+
};
|
|
35
|
+
cellStyle: {
|
|
36
|
+
position: string;
|
|
37
|
+
padding: string;
|
|
38
|
+
'text-align': string;
|
|
39
|
+
'font-size': string;
|
|
40
|
+
};
|
|
41
|
+
cancelStyle: {
|
|
42
|
+
'margin-top': string;
|
|
43
|
+
padding: string;
|
|
44
|
+
'text-align': string;
|
|
45
|
+
'font-size': string;
|
|
46
|
+
color: string;
|
|
47
|
+
'background-color': string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
lastConfig: {};
|
|
51
|
+
el: HTMLDivElement;
|
|
52
|
+
actionSheet: HTMLDivElement;
|
|
53
|
+
menu: HTMLDivElement;
|
|
54
|
+
cells: HTMLDivElement[];
|
|
55
|
+
cancel: HTMLDivElement;
|
|
56
|
+
hideOpacityTimer: any;
|
|
57
|
+
hideDisplayTimer: any;
|
|
58
|
+
create(options?: {}): Promise<string | number>;
|
|
59
|
+
show(options?: {}): Promise<string | number>;
|
|
60
|
+
hide(): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
declare const showToast: typeof Taro.showToast;
|
|
3
|
+
declare const hideToast: typeof Taro.hideToast;
|
|
4
|
+
declare const showLoading: typeof Taro.showLoading;
|
|
5
|
+
declare const hideLoading: typeof Taro.hideLoading;
|
|
6
|
+
declare const showModal: typeof Taro.showModal;
|
|
7
|
+
declare const showActionSheet: typeof Taro.showActionSheet;
|
|
8
|
+
declare const enableAlertBeforeUnload: () => Promise<{
|
|
9
|
+
errMsg: string;
|
|
10
|
+
}>;
|
|
11
|
+
declare const disableAlertBeforeUnload: () => Promise<{
|
|
12
|
+
errMsg: string;
|
|
13
|
+
}>;
|
|
14
|
+
export { showToast, showModal, showLoading, showActionSheet, hideToast, hideLoading, enableAlertBeforeUnload, disableAlertBeforeUnload };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export default class Modal {
|
|
2
|
+
options: {
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
showCancel: boolean;
|
|
6
|
+
cancelText: string;
|
|
7
|
+
cancelColor: string;
|
|
8
|
+
confirmText: string;
|
|
9
|
+
confirmColor: string;
|
|
10
|
+
};
|
|
11
|
+
style: {
|
|
12
|
+
maskStyle: {
|
|
13
|
+
position: string;
|
|
14
|
+
'z-index': string;
|
|
15
|
+
top: string;
|
|
16
|
+
right: string;
|
|
17
|
+
left: string;
|
|
18
|
+
bottom: string;
|
|
19
|
+
background: string;
|
|
20
|
+
};
|
|
21
|
+
modalStyle: {
|
|
22
|
+
'z-index': string;
|
|
23
|
+
position: string;
|
|
24
|
+
top: string;
|
|
25
|
+
left: string;
|
|
26
|
+
transform: string;
|
|
27
|
+
width: string;
|
|
28
|
+
'max-width': string;
|
|
29
|
+
'border-radius': string;
|
|
30
|
+
'text-align': string;
|
|
31
|
+
'line-height': string;
|
|
32
|
+
overflow: string;
|
|
33
|
+
background: string;
|
|
34
|
+
};
|
|
35
|
+
titleStyle: {
|
|
36
|
+
padding: string;
|
|
37
|
+
'font-size': string;
|
|
38
|
+
};
|
|
39
|
+
textStyle: {
|
|
40
|
+
padding: string;
|
|
41
|
+
'min-height': string;
|
|
42
|
+
'font-size': string;
|
|
43
|
+
'line-height': string;
|
|
44
|
+
color: string;
|
|
45
|
+
};
|
|
46
|
+
footStyle: {
|
|
47
|
+
position: string;
|
|
48
|
+
'line-height': string;
|
|
49
|
+
'font-size': string;
|
|
50
|
+
display: string;
|
|
51
|
+
};
|
|
52
|
+
btnStyle: {
|
|
53
|
+
position: string;
|
|
54
|
+
'-webkit-box-flex': string;
|
|
55
|
+
'-webkit-flex': string;
|
|
56
|
+
flex: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
el: HTMLDivElement;
|
|
60
|
+
title: HTMLDivElement;
|
|
61
|
+
text: HTMLDivElement;
|
|
62
|
+
cancel: HTMLDivElement;
|
|
63
|
+
confirm: HTMLDivElement;
|
|
64
|
+
hideOpacityTimer: any;
|
|
65
|
+
hideDisplayTimer: any;
|
|
66
|
+
create(options?: {}): Promise<string>;
|
|
67
|
+
show(options?: {}): Promise<string>;
|
|
68
|
+
hide(): void;
|
|
69
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export default class Toast {
|
|
2
|
+
options: {
|
|
3
|
+
title: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
image: string;
|
|
6
|
+
duration: number;
|
|
7
|
+
mask: boolean;
|
|
8
|
+
};
|
|
9
|
+
style: {
|
|
10
|
+
maskStyle: {
|
|
11
|
+
position: string;
|
|
12
|
+
'z-index': string;
|
|
13
|
+
top: string;
|
|
14
|
+
right: string;
|
|
15
|
+
left: string;
|
|
16
|
+
bottom: string;
|
|
17
|
+
};
|
|
18
|
+
toastStyle: {
|
|
19
|
+
'z-index': string;
|
|
20
|
+
'box-sizing': string;
|
|
21
|
+
display: string;
|
|
22
|
+
'flex-direction': string;
|
|
23
|
+
'justify-content': string;
|
|
24
|
+
'-webkit-justify-content': string;
|
|
25
|
+
position: string;
|
|
26
|
+
top: string;
|
|
27
|
+
left: string;
|
|
28
|
+
'min-width': string;
|
|
29
|
+
'max-width': string;
|
|
30
|
+
'min-height': string;
|
|
31
|
+
padding: string;
|
|
32
|
+
transform: string;
|
|
33
|
+
'border-radius': string;
|
|
34
|
+
'text-align': string;
|
|
35
|
+
'line-height': string;
|
|
36
|
+
color: string;
|
|
37
|
+
background: string;
|
|
38
|
+
};
|
|
39
|
+
successStyle: {
|
|
40
|
+
margin: string;
|
|
41
|
+
width: string;
|
|
42
|
+
height: string;
|
|
43
|
+
background: string;
|
|
44
|
+
'background-size': string;
|
|
45
|
+
};
|
|
46
|
+
errrorStyle: {
|
|
47
|
+
margin: string;
|
|
48
|
+
width: string;
|
|
49
|
+
height: string;
|
|
50
|
+
background: string;
|
|
51
|
+
'background-size': string;
|
|
52
|
+
};
|
|
53
|
+
loadingStyle: {
|
|
54
|
+
margin: string;
|
|
55
|
+
width: string;
|
|
56
|
+
height: string;
|
|
57
|
+
'-webkit-animation': string;
|
|
58
|
+
animation: string;
|
|
59
|
+
background: string;
|
|
60
|
+
'background-size': string;
|
|
61
|
+
};
|
|
62
|
+
imageStyle: {
|
|
63
|
+
margin: string;
|
|
64
|
+
width: string;
|
|
65
|
+
height: string;
|
|
66
|
+
background: string;
|
|
67
|
+
'background-size': string;
|
|
68
|
+
};
|
|
69
|
+
textStyle: {
|
|
70
|
+
margin: string;
|
|
71
|
+
'font-size': string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
el: HTMLDivElement;
|
|
75
|
+
mask: HTMLDivElement;
|
|
76
|
+
icon: HTMLParagraphElement;
|
|
77
|
+
toast: HTMLDivElement;
|
|
78
|
+
title: HTMLParagraphElement;
|
|
79
|
+
type: any;
|
|
80
|
+
hideOpacityTimer: any;
|
|
81
|
+
hideDisplayTimer: any;
|
|
82
|
+
create(options?: {}, _type?: 'loading' | 'toast'): string;
|
|
83
|
+
show(options?: {}, _type?: 'loading' | 'toast'): string;
|
|
84
|
+
hide(duration: number | undefined, type: any): void;
|
|
85
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
export declare const showNavigationBarLoading: () => Promise<{
|
|
3
|
+
errMsg: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function setNavigationBarTitle(options: any): Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
6
|
+
/**
|
|
7
|
+
* 设置页面导航条颜色
|
|
8
|
+
*/
|
|
9
|
+
export declare const setNavigationBarColor: typeof Taro.setNavigationBarColor;
|
|
10
|
+
export declare const hideNavigationBarLoading: () => Promise<{
|
|
11
|
+
errMsg: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const hideHomeButton: () => Promise<{
|
|
14
|
+
errMsg: string;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Taro, { AppConfig } from '@tarojs/api';
|
|
2
|
+
export declare function initTabBarApis(config?: AppConfig): void;
|
|
3
|
+
/**
|
|
4
|
+
* 显示 tabBar 某一项的右上角的红点
|
|
5
|
+
*/
|
|
6
|
+
export declare const showTabBarRedDot: typeof Taro.showTabBarRedDot;
|
|
7
|
+
/**
|
|
8
|
+
* 显示 tabBar
|
|
9
|
+
*/
|
|
10
|
+
export declare const showTabBar: typeof Taro.showTabBar;
|
|
11
|
+
/**
|
|
12
|
+
* 动态设置 tabBar 的整体样式
|
|
13
|
+
*/
|
|
14
|
+
export declare const setTabBarStyle: typeof Taro.setTabBarStyle;
|
|
15
|
+
/**
|
|
16
|
+
* 动态设置 tabBar 某一项的内容
|
|
17
|
+
*/
|
|
18
|
+
export declare const setTabBarItem: typeof Taro.setTabBarItem;
|
|
19
|
+
/**
|
|
20
|
+
* 为 tabBar 某一项的右上角添加文本
|
|
21
|
+
*/
|
|
22
|
+
export declare const setTabBarBadge: typeof Taro.setTabBarBadge;
|
|
23
|
+
/**
|
|
24
|
+
* 移除 tabBar 某一项右上角的文本
|
|
25
|
+
*/
|
|
26
|
+
export declare const removeTabBarBadge: typeof Taro.removeTabBarBadge;
|
|
27
|
+
/**
|
|
28
|
+
* 隐藏 tabBar 某一项的右上角的红点
|
|
29
|
+
*/
|
|
30
|
+
export declare const hideTabBarRedDot: typeof Taro.hideTabBarRedDot;
|
|
31
|
+
/**
|
|
32
|
+
* 隐藏 tabBar
|
|
33
|
+
*/
|
|
34
|
+
export declare const hideTabBar: typeof Taro.hideTabBar;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
/**
|
|
3
|
+
* 设置窗口大小,该接口仅适用于 PC 平台,使用细则请参见指南
|
|
4
|
+
*/
|
|
5
|
+
export declare const setWindowSize: () => Promise<{
|
|
6
|
+
errMsg: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* 监听窗口尺寸变化事件
|
|
10
|
+
*/
|
|
11
|
+
export declare const onWindowResize: typeof Taro.onWindowResize;
|
|
12
|
+
/**
|
|
13
|
+
* 取消监听窗口尺寸变化事件
|
|
14
|
+
*/
|
|
15
|
+
export declare const offWindowResize: typeof Taro.offWindowResize;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare type TCallback<T = Partial<TaroGeneral.CallbackResult>> = (res: T) => Promise<void> | void;
|
|
2
|
+
interface IMethodParam<T = Partial<TaroGeneral.CallbackResult>> {
|
|
3
|
+
name: string;
|
|
4
|
+
success?: TCallback<T>;
|
|
5
|
+
fail?: TCallback;
|
|
6
|
+
complete?: TCallback;
|
|
7
|
+
}
|
|
8
|
+
export declare class MethodHandler<T = Partial<TaroGeneral.CallbackResult>> {
|
|
9
|
+
methodName: string;
|
|
10
|
+
protected __success?: TCallback<T>;
|
|
11
|
+
protected __fail?: TCallback;
|
|
12
|
+
protected __complete?: TCallback;
|
|
13
|
+
constructor({ name, success, fail, complete }: IMethodParam<T>);
|
|
14
|
+
success<U = Record<string, unknown>>(res?: Partial<T> & Partial<TaroGeneral.CallbackResult>, resolve?: any): Promise<T & U & TaroGeneral.CallbackResult>;
|
|
15
|
+
fail<U = Record<string, unknown>>(res?: Partial<T> & Partial<TaroGeneral.CallbackResult>, reject?: any): Promise<T & U & TaroGeneral.CallbackResult>;
|
|
16
|
+
}
|
|
17
|
+
declare type TCallbackManagerParam = (...arr: unknown[]) => void;
|
|
18
|
+
interface ICallbackManagerOption {
|
|
19
|
+
callback?: TCallbackManagerParam;
|
|
20
|
+
ctx?: any;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
declare type TCallbackManagerListItem = (TCallbackManagerParam | ICallbackManagerOption);
|
|
24
|
+
declare type TCallbackManagerList = TCallbackManagerListItem[];
|
|
25
|
+
export declare class CallbackManager {
|
|
26
|
+
callbacks: TCallbackManagerList;
|
|
27
|
+
/**
|
|
28
|
+
* 添加回调
|
|
29
|
+
* @param {{ callback: function, ctx: any } | function} opt
|
|
30
|
+
*/
|
|
31
|
+
add: (opt?: TCallbackManagerListItem | undefined) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 移除回调
|
|
34
|
+
* @param {{ callback: function, ctx: any } | function} opt
|
|
35
|
+
*/
|
|
36
|
+
remove: (opt?: TCallbackManagerListItem | undefined) => void;
|
|
37
|
+
/**
|
|
38
|
+
* 获取回调函数数量
|
|
39
|
+
* @return {number}
|
|
40
|
+
*/
|
|
41
|
+
count: () => number;
|
|
42
|
+
/**
|
|
43
|
+
* 触发回调
|
|
44
|
+
* @param {...any} args 回调的调用参数
|
|
45
|
+
*/
|
|
46
|
+
trigger: (...args: TCallbackManagerList) => void;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TaroElement } from '@tarojs/runtime';
|
|
2
|
+
export declare function shouldBeObject(target: unknown): {
|
|
3
|
+
flag: boolean;
|
|
4
|
+
msg?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
flag: boolean;
|
|
7
|
+
msg: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function findDOM(inst?: any): TaroElement | HTMLElement | undefined;
|
|
10
|
+
interface IParameterErrorParam {
|
|
11
|
+
name?: string;
|
|
12
|
+
para?: string;
|
|
13
|
+
correct?: string;
|
|
14
|
+
wrong?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare function getParameterError({ name, para, correct, wrong }: IParameterErrorParam): string;
|
|
17
|
+
export declare function inlineStyle(style: any): string;
|
|
18
|
+
export declare function setTransform(el: any, val: any): void;
|
|
19
|
+
export declare function serializeParams(params: any): string;
|
|
20
|
+
export declare function temporarilyNotSupport(apiName: any): () => Promise<{
|
|
21
|
+
errMsg: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function weixinCorpSupport(apiName: any): () => Promise<{
|
|
24
|
+
errMsg: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function permanentlyNotSupport(apiName: any): () => Promise<{
|
|
27
|
+
errMsg: string;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function isFunction(obj: any): boolean;
|
|
30
|
+
export declare const isValidColor: (color: any) => boolean;
|
|
31
|
+
interface IProcessOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any> {
|
|
32
|
+
name: string;
|
|
33
|
+
defaultOptions?: TOptions;
|
|
34
|
+
standardMethod?: (opts: TOptions) => Promise<TResult>;
|
|
35
|
+
formatOptions?: (opts: TOptions) => TOptions;
|
|
36
|
+
formatResult?: (res: TResult) => TResult;
|
|
37
|
+
}
|
|
38
|
+
export declare function processOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any>({ name, defaultOptions, standardMethod, formatOptions, formatResult }: IProcessOpenApi<TOptions, TResult>): (options?: Partial<TOptions>) => Promise<TResult>;
|
|
39
|
+
/**
|
|
40
|
+
* ease-in-out的函数
|
|
41
|
+
* @param t 0-1的数字
|
|
42
|
+
*/
|
|
43
|
+
export declare const easeInOut: (t: number) => number;
|
|
44
|
+
export declare const getTimingFunc: (easeFunc: any, frameCnt: any) => (x: any) => any;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SelectorQuery } from './selectorQuery';
|
|
2
|
+
export declare class NodesRef implements Taro.NodesRef {
|
|
3
|
+
_component?: TaroGeneral.IAnyObject;
|
|
4
|
+
_selector: string;
|
|
5
|
+
_selectorQuery: SelectorQuery;
|
|
6
|
+
_single: boolean;
|
|
7
|
+
constructor(selector: string, querySelectorQuery: SelectorQuery, single: boolean);
|
|
8
|
+
context(cb: any): SelectorQuery;
|
|
9
|
+
node(cb: any): SelectorQuery;
|
|
10
|
+
boundingClientRect(cb: any): SelectorQuery;
|
|
11
|
+
scrollOffset(cb: any): SelectorQuery;
|
|
12
|
+
fields(fields: any, cb: any): SelectorQuery;
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
import { NodesRef } from './nodesRef';
|
|
3
|
+
interface ISelectorQueryQueue {
|
|
4
|
+
component: TaroGeneral.IAnyObject;
|
|
5
|
+
selector: string;
|
|
6
|
+
single: boolean;
|
|
7
|
+
fields: any;
|
|
8
|
+
}
|
|
9
|
+
declare type TSelectorQueryQueueCallback = (res: ISelectorQueryQueue) => void;
|
|
10
|
+
export declare class SelectorQuery implements Taro.SelectorQuery {
|
|
11
|
+
_defaultWebviewId: string | null;
|
|
12
|
+
_webviewId: string | null;
|
|
13
|
+
_queue: ISelectorQueryQueue[];
|
|
14
|
+
_queueCb: (TSelectorQueryQueueCallback | null)[];
|
|
15
|
+
_component?: TaroGeneral.IAnyObject;
|
|
16
|
+
constructor();
|
|
17
|
+
in(component: TaroGeneral.IAnyObject): this;
|
|
18
|
+
select(selector: string): NodesRef;
|
|
19
|
+
selectAll(selector: string): NodesRef;
|
|
20
|
+
selectViewport(): NodesRef;
|
|
21
|
+
exec(cb: any): Taro.NodesRef;
|
|
22
|
+
_push(selector: string, component: any, single: any, fields: any, callback?: TSelectorQueryQueueCallback | null): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Taro from '@tarojs/api';
|
|
2
|
+
declare namespace Router {
|
|
3
|
+
interface Location {
|
|
4
|
+
path: string;
|
|
5
|
+
search: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
state: {
|
|
8
|
+
key: string;
|
|
9
|
+
};
|
|
10
|
+
params: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
interface RouterParams {
|
|
15
|
+
path: string;
|
|
16
|
+
scene: number;
|
|
17
|
+
params: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
shareTicket: string;
|
|
21
|
+
referrerInfo: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
interface TaroH5 {
|
|
25
|
+
_$router: Router.Location;
|
|
26
|
+
$router: Router.RouterParams;
|
|
27
|
+
}
|
|
28
|
+
declare const TaroH5: (TaroH5 & typeof Taro);
|
|
29
|
+
export default TaroH5;
|