@tarojs/taro-h5 3.4.11 → 3.4.14
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/vibrate.js +5 -7
- package/dist/api/location/index.js +1 -0
- package/dist/api/media/audio/InnerAudioContext.js +1 -1
- package/dist/dist/api/framework/index.d.ts +1 -1
- package/dist/dist/api/location/getLocation.d.ts +1 -2
- package/dist/dist/api/location/index.d.ts +3 -0
- package/dist/dist/api/media/audio/InnerAudioContext.d.ts +2 -2
- package/dist/dist/api/media/background-audio/BackgroundAudioManager.d.ts +1 -1
- package/dist/dist/api/ui/custom-component.d.ts +1 -1
- package/dist/dist/api/wxml/selectorQuery.d.ts +1 -1
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/taroApis.js +1 -1
- package/package.json +7 -6
- package/src/api/device/vibrate.ts +6 -8
- package/src/api/location/index.ts +1 -0
- package/src/api/media/audio/InnerAudioContext.ts +1 -1
- package/{src/types → types}/api.d.ts +0 -0
- package/{src/types → types}/define.d.ts +0 -0
- package/{src/types → types}/index.d.ts +0 -0
- package/types/overlay.d.ts +9 -0
- package/{src/types → types}/type.ts +0 -0
- package/dist/dist/types/type.d.ts +0 -29
- package/dist/types/type.js +0 -2
|
@@ -4,7 +4,7 @@ const vibrator = function vibrator(mm) {
|
|
|
4
4
|
return window.navigator.vibrate(mm);
|
|
5
5
|
}
|
|
6
6
|
catch (e) {
|
|
7
|
-
console.warn('当前浏览器不支持vibrate');
|
|
7
|
+
console.warn('当前浏览器不支持 vibrate。');
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
@@ -12,12 +12,11 @@ const vibrator = function vibrator(mm) {
|
|
|
12
12
|
*/
|
|
13
13
|
export const vibrateShort = ({ success, fail, complete } = {}) => {
|
|
14
14
|
const handle = new MethodHandler({ name: 'vibrateShort', success, fail, complete });
|
|
15
|
-
if (vibrator) {
|
|
16
|
-
vibrator(15);
|
|
15
|
+
if (vibrator(15)) {
|
|
17
16
|
return handle.success();
|
|
18
17
|
}
|
|
19
18
|
else {
|
|
20
|
-
return handle.fail();
|
|
19
|
+
return handle.fail({ errMsg: 'style is not support' });
|
|
21
20
|
}
|
|
22
21
|
};
|
|
23
22
|
/**
|
|
@@ -25,11 +24,10 @@ export const vibrateShort = ({ success, fail, complete } = {}) => {
|
|
|
25
24
|
*/
|
|
26
25
|
export const vibrateLong = ({ success, fail, complete } = {}) => {
|
|
27
26
|
const handle = new MethodHandler({ name: 'vibrateLong', success, fail, complete });
|
|
28
|
-
if (vibrator) {
|
|
29
|
-
vibrator(400);
|
|
27
|
+
if (vibrator(400)) {
|
|
30
28
|
return handle.success();
|
|
31
29
|
}
|
|
32
30
|
else {
|
|
33
|
-
return handle.fail();
|
|
31
|
+
return handle.fail({ errMsg: 'style is not support' });
|
|
34
32
|
}
|
|
35
33
|
};
|
|
@@ -13,4 +13,5 @@ export const offLocationChangeError = temporarilyNotSupport('offLocationChangeEr
|
|
|
13
13
|
export const offLocationChange = temporarilyNotSupport('offLocationChange');
|
|
14
14
|
export { getLocation } from './getLocation';
|
|
15
15
|
export const choosePoi = temporarilyNotSupport('choosePoi');
|
|
16
|
+
export const getFuzzyLocation = temporarilyNotSupport('getFuzzyLocation');
|
|
16
17
|
export { chooseLocation } from './chooseLocation';
|
|
@@ -63,7 +63,7 @@ export class InnerAudioContext {
|
|
|
63
63
|
get duration() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.duration) || 0; }
|
|
64
64
|
set loop(e) { this.setProperty('loop', e); }
|
|
65
65
|
get loop() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.loop) || false; }
|
|
66
|
-
get paused() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused)
|
|
66
|
+
get paused() { var _a, _b; return (_b = (_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused) !== null && _b !== void 0 ? _b : true; }
|
|
67
67
|
set src(e) { this.setProperty('src', e); }
|
|
68
68
|
get src() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.src) || ''; }
|
|
69
69
|
set volume(e) { this.setProperty('volume', e); }
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getLocation: (options?: Partial<Taro.getLocation.Option>) => Promise<Taro.getLocation.SuccessCallbackResult>;
|
|
1
|
+
export declare const getLocation: (options?: any) => Promise<any>;
|
|
@@ -13,7 +13,7 @@ export declare class InnerAudioContext implements Taro.InnerAudioContext {
|
|
|
13
13
|
get duration(): number;
|
|
14
14
|
set loop(e: boolean);
|
|
15
15
|
get loop(): boolean;
|
|
16
|
-
get paused():
|
|
16
|
+
get paused(): boolean;
|
|
17
17
|
set src(e: string);
|
|
18
18
|
get src(): string;
|
|
19
19
|
set volume(e: number);
|
|
@@ -41,7 +41,7 @@ export declare class InnerAudioContext implements Taro.InnerAudioContext {
|
|
|
41
41
|
onStop: (callback?: () => void) => void;
|
|
42
42
|
onEnded: (callback?: () => void) => void | undefined;
|
|
43
43
|
onTimeUpdate: (callback?: () => void) => void | undefined;
|
|
44
|
-
onError: (callback?: ((res:
|
|
44
|
+
onError: (callback?: ((res: any) => void) | undefined) => void;
|
|
45
45
|
onWaiting: (callback?: () => void) => void | undefined;
|
|
46
46
|
onSeeking: (callback?: () => void) => void | undefined;
|
|
47
47
|
onSeeked: (callback?: () => void) => void | undefined;
|
|
@@ -38,7 +38,7 @@ export declare class BackgroundAudioManager implements Taro.BackgroundAudioManag
|
|
|
38
38
|
stop: () => void;
|
|
39
39
|
onCanplay: (callback?: () => void) => void | undefined;
|
|
40
40
|
onWaiting: (callback?: () => void) => void | undefined;
|
|
41
|
-
onError: (callback?: ((res:
|
|
41
|
+
onError: (callback?: ((res: any) => void) | undefined) => void;
|
|
42
42
|
onPlay: (callback?: () => void) => void | undefined;
|
|
43
43
|
onPause: (callback?: () => void) => void | undefined;
|
|
44
44
|
onSeeking: (callback?: () => void) => void | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const nextTick:
|
|
1
|
+
export declare const nextTick: any;
|
|
@@ -18,7 +18,7 @@ export declare class SelectorQuery implements Taro.SelectorQuery {
|
|
|
18
18
|
select(selector: string): NodesRef;
|
|
19
19
|
selectAll(selector: string): NodesRef;
|
|
20
20
|
selectViewport(): NodesRef;
|
|
21
|
-
exec(cb: any):
|
|
21
|
+
exec(cb: any): any;
|
|
22
22
|
_push(selector: string, component: any, single: any, fields: any, callback?: TSelectorQueryQueueCallback | null): void;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1578,7 +1578,7 @@ const vibrator = function vibrator(mm) {
|
|
|
1578
1578
|
return window.navigator.vibrate(mm);
|
|
1579
1579
|
}
|
|
1580
1580
|
catch (e) {
|
|
1581
|
-
console.warn('当前浏览器不支持vibrate');
|
|
1581
|
+
console.warn('当前浏览器不支持 vibrate。');
|
|
1582
1582
|
}
|
|
1583
1583
|
};
|
|
1584
1584
|
/**
|
|
@@ -1586,12 +1586,11 @@ const vibrator = function vibrator(mm) {
|
|
|
1586
1586
|
*/
|
|
1587
1587
|
const vibrateShort = ({ success, fail, complete } = {}) => {
|
|
1588
1588
|
const handle = new MethodHandler({ name: 'vibrateShort', success, fail, complete });
|
|
1589
|
-
if (vibrator) {
|
|
1590
|
-
vibrator(15);
|
|
1589
|
+
if (vibrator(15)) {
|
|
1591
1590
|
return handle.success();
|
|
1592
1591
|
}
|
|
1593
1592
|
else {
|
|
1594
|
-
return handle.fail();
|
|
1593
|
+
return handle.fail({ errMsg: 'style is not support' });
|
|
1595
1594
|
}
|
|
1596
1595
|
};
|
|
1597
1596
|
/**
|
|
@@ -1599,12 +1598,11 @@ const vibrateShort = ({ success, fail, complete } = {}) => {
|
|
|
1599
1598
|
*/
|
|
1600
1599
|
const vibrateLong = ({ success, fail, complete } = {}) => {
|
|
1601
1600
|
const handle = new MethodHandler({ name: 'vibrateLong', success, fail, complete });
|
|
1602
|
-
if (vibrator) {
|
|
1603
|
-
vibrator(400);
|
|
1601
|
+
if (vibrator(400)) {
|
|
1604
1602
|
return handle.success();
|
|
1605
1603
|
}
|
|
1606
1604
|
else {
|
|
1607
|
-
return handle.fail();
|
|
1605
|
+
return handle.fail({ errMsg: 'style is not support' });
|
|
1608
1606
|
}
|
|
1609
1607
|
};
|
|
1610
1608
|
|
|
@@ -1848,6 +1846,7 @@ const onLocationChange = temporarilyNotSupport('onLocationChange');
|
|
|
1848
1846
|
const offLocationChangeError = temporarilyNotSupport('offLocationChangeError');
|
|
1849
1847
|
const offLocationChange = temporarilyNotSupport('offLocationChange');
|
|
1850
1848
|
const choosePoi = temporarilyNotSupport('choosePoi');
|
|
1849
|
+
const getFuzzyLocation = temporarilyNotSupport('getFuzzyLocation');
|
|
1851
1850
|
|
|
1852
1851
|
class InnerAudioContext {
|
|
1853
1852
|
constructor() {
|
|
@@ -1911,7 +1910,7 @@ class InnerAudioContext {
|
|
|
1911
1910
|
get duration() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.duration) || 0; }
|
|
1912
1911
|
set loop(e) { this.setProperty('loop', e); }
|
|
1913
1912
|
get loop() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.loop) || false; }
|
|
1914
|
-
get paused() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused)
|
|
1913
|
+
get paused() { var _a, _b; return (_b = (_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused) !== null && _b !== void 0 ? _b : true; }
|
|
1915
1914
|
set src(e) { this.setProperty('src', e); }
|
|
1916
1915
|
get src() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.src) || ''; }
|
|
1917
1916
|
set volume(e) { this.setProperty('volume', e); }
|
|
@@ -5200,6 +5199,7 @@ exports.getExtConfig = getExtConfig;
|
|
|
5200
5199
|
exports.getExtConfigSync = getExtConfigSync;
|
|
5201
5200
|
exports.getFileInfo = getFileInfo;
|
|
5202
5201
|
exports.getFileSystemManager = getFileSystemManager;
|
|
5202
|
+
exports.getFuzzyLocation = getFuzzyLocation;
|
|
5203
5203
|
exports.getGroupEnterInfo = getGroupEnterInfo;
|
|
5204
5204
|
exports.getHCEState = getHCEState;
|
|
5205
5205
|
exports.getImageInfo = getImageInfo;
|