@tarojs/taro-h5 3.4.13 → 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.
@@ -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';
@@ -1,4 +1,4 @@
1
1
  import Taro from '@tarojs/api';
2
2
  export declare const getApp: typeof Taro.getApp;
3
3
  export { getCurrentPages } from '@tarojs/router';
4
- export declare const getCurrentInstance: () => Taro.Current;
4
+ export declare const getCurrentInstance: any;
@@ -1,2 +1 @@
1
- import Taro from '@tarojs/api';
2
- export declare const getLocation: (options?: Partial<Taro.getLocation.Option>) => Promise<Taro.getLocation.SuccessCallbackResult>;
1
+ export declare const getLocation: (options?: any) => Promise<any>;
@@ -26,4 +26,7 @@ export { getLocation } from './getLocation';
26
26
  export declare const choosePoi: () => Promise<{
27
27
  errMsg: string;
28
28
  }>;
29
+ export declare const getFuzzyLocation: () => Promise<{
30
+ errMsg: string;
31
+ }>;
29
32
  export { chooseLocation } from './chooseLocation';
@@ -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: Taro.InnerAudioContext.onErrorDetail) => void) | undefined) => void;
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: Taro.InnerAudioContext.onErrorDetail) => void) | undefined) => void;
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: (callback: (...args: any[]) => any) => void;
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): Taro.NodesRef;
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() {
@@ -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;