@tarojs/taro-h5 3.5.6 → 3.5.7-alpha.1
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 +2 -6
- package/dist/api/ai/facial.d.ts +3 -9
- package/dist/api/ai/visual.d.ts +2 -6
- package/dist/api/alipay/index.d.ts +1 -3
- package/dist/api/base/crypto.d.ts +1 -3
- package/dist/api/base/debug.d.ts +3 -9
- package/dist/api/base/index.d.ts +1 -3
- package/dist/api/base/performance.d.ts +2 -6
- package/dist/api/base/system.d.ts +2 -8
- package/dist/api/base/system.js +1 -1
- package/dist/api/base/update.d.ts +2 -6
- package/dist/api/base/weapp/app-event.d.ts +12 -36
- package/dist/api/base/weapp/life-cycle.d.ts +3 -6
- package/dist/api/base/weapp/life-cycle.js +14 -3
- package/dist/api/canvas/CanvasContext.js +1 -1
- package/dist/api/canvas/index.d.ts +1 -3
- package/dist/api/cloud/index.d.ts +9 -27
- package/dist/api/data-analysis/index.d.ts +4 -12
- package/dist/api/device/accessibility.d.ts +1 -3
- package/dist/api/device/battery.d.ts +1 -3
- package/dist/api/device/bluetooth-ble.d.ts +16 -48
- package/dist/api/device/bluetooth-peripheral.d.ts +3 -9
- package/dist/api/device/bluetooth.d.ts +13 -39
- package/dist/api/device/calendar.d.ts +2 -6
- package/dist/api/device/contact.d.ts +2 -6
- package/dist/api/device/crypto.d.ts +1 -3
- package/dist/api/device/gyroscope.d.ts +4 -12
- package/dist/api/device/iBeacon.d.ts +7 -21
- package/dist/api/device/keyboard.d.ts +4 -12
- package/dist/api/device/memory.d.ts +2 -6
- package/dist/api/device/network.d.ts +3 -9
- package/dist/api/device/nfc.d.ts +7 -21
- package/dist/api/device/screen.d.ts +6 -18
- package/dist/api/device/wifi.d.ts +11 -33
- package/dist/api/ext/index.d.ts +2 -6
- package/dist/api/files/index.d.ts +8 -24
- package/dist/api/location/index.d.ts +9 -27
- package/dist/api/media/EditorContext.d.ts +13 -39
- package/dist/api/media/audio/index.d.ts +8 -24
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +4 -12
- package/dist/api/media/background-audio/index.d.ts +8 -24
- package/dist/api/media/camera.d.ts +1 -3
- package/dist/api/media/image/index.d.ts +4 -12
- package/dist/api/media/live.d.ts +2 -6
- package/dist/api/media/map.d.ts +1 -3
- package/dist/api/media/media-recorder.d.ts +1 -3
- package/dist/api/media/recorder.d.ts +3 -9
- package/dist/api/media/video/index.d.ts +5 -15
- package/dist/api/media/video-decoder.d.ts +1 -3
- package/dist/api/media/video-processing.d.ts +1 -3
- package/dist/api/media/voip.d.ts +14 -42
- package/dist/api/navigate/index.d.ts +5 -15
- package/dist/api/network/download.js +4 -3
- package/dist/api/network/mdns.d.ts +10 -30
- package/dist/api/network/request/index.js +5 -4
- package/dist/api/network/tcp.d.ts +1 -3
- package/dist/api/network/udp.d.ts +1 -3
- package/dist/api/network/upload.js +4 -3
- package/dist/api/open-api/account.d.ts +1 -3
- package/dist/api/open-api/address.d.ts +1 -3
- package/dist/api/open-api/authorize.d.ts +2 -6
- package/dist/api/open-api/card.d.ts +2 -6
- package/dist/api/open-api/channels-live.d.ts +6 -18
- package/dist/api/open-api/customer-service.d.ts +1 -3
- package/dist/api/open-api/facial.d.ts +4 -12
- package/dist/api/open-api/favorites.d.ts +2 -6
- package/dist/api/open-api/group.d.ts +1 -3
- package/dist/api/open-api/invoice.d.ts +2 -6
- package/dist/api/open-api/license-plate.d.ts +1 -3
- package/dist/api/open-api/login.d.ts +3 -9
- package/dist/api/open-api/red-package.d.ts +1 -3
- package/dist/api/open-api/settings.d.ts +2 -6
- package/dist/api/open-api/soter.d.ts +3 -9
- package/dist/api/open-api/subscribe-message.d.ts +1 -3
- package/dist/api/open-api/user-info.d.ts +2 -6
- package/dist/api/open-api/werun.d.ts +2 -6
- package/dist/api/payment/index.d.ts +2 -6
- package/dist/api/share/index.d.ts +10 -30
- package/dist/api/storage/background-fetch.d.ts +4 -12
- package/dist/api/storage/index.d.ts +2 -6
- package/dist/api/swan/index.d.ts +21 -63
- package/dist/api/taro.d.ts +1 -3
- package/dist/api/ui/background.d.ts +2 -6
- package/dist/api/ui/interaction/index.d.ts +2 -6
- package/dist/api/ui/menu.d.ts +1 -3
- package/dist/api/ui/navigation-bar/index.d.ts +3 -9
- package/dist/api/ui/sticky.d.ts +1 -3
- package/dist/api/ui/window.d.ts +1 -3
- package/dist/api/worker/index.d.ts +1 -3
- package/dist/api/wxml/index.d.ts +1 -3
- package/dist/index.cjs.d.ts +308 -924
- package/dist/index.cjs.js +155 -131
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.d.ts +308 -924
- package/dist/index.esm.js +155 -131
- package/dist/index.esm.js.map +1 -1
- package/dist/taroApis.d.ts +307 -921
- package/dist/utils/index.d.ts +4 -9
- package/dist/utils/index.js +48 -36
- package/package.json +8 -4
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TaroElement } from '@tarojs/runtime';
|
|
2
|
+
export declare const isProd: boolean;
|
|
2
3
|
export declare function shouldBeObject(target: unknown): {
|
|
3
4
|
flag: boolean;
|
|
4
5
|
msg?: undefined;
|
|
@@ -17,15 +18,9 @@ export declare function getParameterError({ name, para, correct, wrong }: IParam
|
|
|
17
18
|
export declare function inlineStyle(style: any): string;
|
|
18
19
|
export declare function setTransform(el: any, val: any): void;
|
|
19
20
|
export declare function serializeParams(params: any): string;
|
|
20
|
-
export declare function temporarilyNotSupport(
|
|
21
|
-
|
|
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
|
-
}>;
|
|
21
|
+
export declare function temporarilyNotSupport(name?: string): (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
22
|
+
export declare function weixinCorpSupport(name: any): (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
23
|
+
export declare function permanentlyNotSupport(name?: string): (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
29
24
|
interface IProcessOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any> {
|
|
30
25
|
name: string;
|
|
31
26
|
defaultOptions?: TOptions;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* eslint-disable prefer-promise-reject-errors */
|
|
2
|
+
import Taro from '@tarojs/api';
|
|
2
3
|
import { Current, hooks } from '@tarojs/runtime';
|
|
4
|
+
import { MethodHandler } from './handler';
|
|
5
|
+
export const isProd = process.env.NODE_ENV === 'production';
|
|
3
6
|
export function shouldBeObject(target) {
|
|
4
7
|
if (target && typeof target === 'object')
|
|
5
8
|
return { flag: true };
|
|
@@ -67,54 +70,63 @@ export function serializeParams(params) {
|
|
|
67
70
|
: encodeURIComponent(params[key])}`))
|
|
68
71
|
.join('&');
|
|
69
72
|
}
|
|
70
|
-
export function temporarilyNotSupport(
|
|
71
|
-
return () => {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
export function temporarilyNotSupport(name = '') {
|
|
74
|
+
return (option = {}, ...args) => {
|
|
75
|
+
const { success, fail, complete } = option;
|
|
76
|
+
const handle = new MethodHandler({ name, success, fail, complete });
|
|
77
|
+
const errMsg = '暂时不支持 API';
|
|
78
|
+
Taro.eventCenter.trigger('__taroNotSupport', {
|
|
79
|
+
name,
|
|
80
|
+
args: [option, ...args],
|
|
81
|
+
type: 'method',
|
|
82
|
+
category: 'temporarily',
|
|
83
|
+
});
|
|
84
|
+
if (isProd) {
|
|
85
|
+
console.warn(errMsg);
|
|
86
|
+
return handle.success({ errMsg });
|
|
78
87
|
}
|
|
79
88
|
else {
|
|
80
|
-
|
|
81
|
-
return Promise.resolve({
|
|
82
|
-
errMsg
|
|
83
|
-
});
|
|
89
|
+
return handle.fail({ errMsg });
|
|
84
90
|
}
|
|
85
91
|
};
|
|
86
92
|
}
|
|
87
|
-
export function weixinCorpSupport(
|
|
88
|
-
return () => {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
export function weixinCorpSupport(name) {
|
|
94
|
+
return (option = {}, ...args) => {
|
|
95
|
+
const { success, fail, complete } = option;
|
|
96
|
+
const handle = new MethodHandler({ name, success, fail, complete });
|
|
97
|
+
const errMsg = 'h5 端当前仅在微信公众号 JS-SDK 环境下支持此 API';
|
|
98
|
+
Taro.eventCenter.trigger('__taroNotSupport', {
|
|
99
|
+
name,
|
|
100
|
+
args: [option, ...args],
|
|
101
|
+
type: 'method',
|
|
102
|
+
category: 'weixin_corp',
|
|
103
|
+
});
|
|
104
|
+
if (isProd) {
|
|
105
|
+
console.warn(errMsg);
|
|
106
|
+
return handle.success({ errMsg });
|
|
95
107
|
}
|
|
96
108
|
else {
|
|
97
|
-
|
|
98
|
-
return Promise.resolve({
|
|
99
|
-
errMsg
|
|
100
|
-
});
|
|
109
|
+
return handle.fail({ errMsg });
|
|
101
110
|
}
|
|
102
111
|
};
|
|
103
112
|
}
|
|
104
|
-
export function permanentlyNotSupport(
|
|
105
|
-
return () => {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
export function permanentlyNotSupport(name = '') {
|
|
114
|
+
return (option = {}, ...args) => {
|
|
115
|
+
const { success, fail, complete } = option;
|
|
116
|
+
const handle = new MethodHandler({ name, success, fail, complete });
|
|
117
|
+
const errMsg = '不支持 API';
|
|
118
|
+
Taro.eventCenter.trigger('__taroNotSupport', {
|
|
119
|
+
name,
|
|
120
|
+
args: [option, ...args],
|
|
121
|
+
type: 'method',
|
|
122
|
+
category: 'permanently',
|
|
123
|
+
});
|
|
124
|
+
if (isProd) {
|
|
125
|
+
console.warn(errMsg);
|
|
126
|
+
return handle.success({ errMsg });
|
|
112
127
|
}
|
|
113
128
|
else {
|
|
114
|
-
|
|
115
|
-
return Promise.resolve({
|
|
116
|
-
errMsg
|
|
117
|
-
});
|
|
129
|
+
return handle.fail({ errMsg });
|
|
118
130
|
}
|
|
119
131
|
};
|
|
120
132
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro-h5",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.7-alpha.1",
|
|
4
4
|
"description": "Taro h5 framework",
|
|
5
5
|
"browser": "dist/index.esm.js",
|
|
6
6
|
"main:h5": "dist/index.js",
|
|
@@ -23,14 +23,18 @@
|
|
|
23
23
|
"author": "O2Team",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tarojs/api": "3.5.
|
|
27
|
-
"@tarojs/router": "3.5.
|
|
28
|
-
"@tarojs/runtime": "3.5.
|
|
26
|
+
"@tarojs/api": "3.5.7-alpha.1",
|
|
27
|
+
"@tarojs/router": "3.5.7-alpha.1",
|
|
28
|
+
"@tarojs/runtime": "3.5.7-alpha.1",
|
|
29
29
|
"base64-js": "^1.3.0",
|
|
30
30
|
"jsonp-retry": "^1.0.3",
|
|
31
31
|
"query-string": "^7.1.1",
|
|
32
32
|
"whatwg-fetch": "^3.4.0"
|
|
33
33
|
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"react": "^18.2.0",
|
|
36
|
+
"react-test-renderer": "^18.2.0"
|
|
37
|
+
},
|
|
34
38
|
"scripts": {
|
|
35
39
|
"assets": "cpy 'src/**/*.css' dist",
|
|
36
40
|
"build": "rimraf ./dist && tsc && pnpm run assets && rollup -c",
|