@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.
Files changed (100) hide show
  1. package/dist/api/ad/index.d.ts +2 -6
  2. package/dist/api/ai/facial.d.ts +3 -9
  3. package/dist/api/ai/visual.d.ts +2 -6
  4. package/dist/api/alipay/index.d.ts +1 -3
  5. package/dist/api/base/crypto.d.ts +1 -3
  6. package/dist/api/base/debug.d.ts +3 -9
  7. package/dist/api/base/index.d.ts +1 -3
  8. package/dist/api/base/performance.d.ts +2 -6
  9. package/dist/api/base/system.d.ts +2 -8
  10. package/dist/api/base/system.js +1 -1
  11. package/dist/api/base/update.d.ts +2 -6
  12. package/dist/api/base/weapp/app-event.d.ts +12 -36
  13. package/dist/api/base/weapp/life-cycle.d.ts +3 -6
  14. package/dist/api/base/weapp/life-cycle.js +14 -3
  15. package/dist/api/canvas/CanvasContext.js +1 -1
  16. package/dist/api/canvas/index.d.ts +1 -3
  17. package/dist/api/cloud/index.d.ts +9 -27
  18. package/dist/api/data-analysis/index.d.ts +4 -12
  19. package/dist/api/device/accessibility.d.ts +1 -3
  20. package/dist/api/device/battery.d.ts +1 -3
  21. package/dist/api/device/bluetooth-ble.d.ts +16 -48
  22. package/dist/api/device/bluetooth-peripheral.d.ts +3 -9
  23. package/dist/api/device/bluetooth.d.ts +13 -39
  24. package/dist/api/device/calendar.d.ts +2 -6
  25. package/dist/api/device/contact.d.ts +2 -6
  26. package/dist/api/device/crypto.d.ts +1 -3
  27. package/dist/api/device/gyroscope.d.ts +4 -12
  28. package/dist/api/device/iBeacon.d.ts +7 -21
  29. package/dist/api/device/keyboard.d.ts +4 -12
  30. package/dist/api/device/memory.d.ts +2 -6
  31. package/dist/api/device/network.d.ts +3 -9
  32. package/dist/api/device/nfc.d.ts +7 -21
  33. package/dist/api/device/screen.d.ts +6 -18
  34. package/dist/api/device/wifi.d.ts +11 -33
  35. package/dist/api/ext/index.d.ts +2 -6
  36. package/dist/api/files/index.d.ts +8 -24
  37. package/dist/api/location/index.d.ts +9 -27
  38. package/dist/api/media/EditorContext.d.ts +13 -39
  39. package/dist/api/media/audio/index.d.ts +8 -24
  40. package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +4 -12
  41. package/dist/api/media/background-audio/index.d.ts +8 -24
  42. package/dist/api/media/camera.d.ts +1 -3
  43. package/dist/api/media/image/index.d.ts +4 -12
  44. package/dist/api/media/live.d.ts +2 -6
  45. package/dist/api/media/map.d.ts +1 -3
  46. package/dist/api/media/media-recorder.d.ts +1 -3
  47. package/dist/api/media/recorder.d.ts +3 -9
  48. package/dist/api/media/video/index.d.ts +5 -15
  49. package/dist/api/media/video-decoder.d.ts +1 -3
  50. package/dist/api/media/video-processing.d.ts +1 -3
  51. package/dist/api/media/voip.d.ts +14 -42
  52. package/dist/api/navigate/index.d.ts +5 -15
  53. package/dist/api/network/download.js +4 -3
  54. package/dist/api/network/mdns.d.ts +10 -30
  55. package/dist/api/network/request/index.js +5 -4
  56. package/dist/api/network/tcp.d.ts +1 -3
  57. package/dist/api/network/udp.d.ts +1 -3
  58. package/dist/api/network/upload.js +4 -3
  59. package/dist/api/open-api/account.d.ts +1 -3
  60. package/dist/api/open-api/address.d.ts +1 -3
  61. package/dist/api/open-api/authorize.d.ts +2 -6
  62. package/dist/api/open-api/card.d.ts +2 -6
  63. package/dist/api/open-api/channels-live.d.ts +6 -18
  64. package/dist/api/open-api/customer-service.d.ts +1 -3
  65. package/dist/api/open-api/facial.d.ts +4 -12
  66. package/dist/api/open-api/favorites.d.ts +2 -6
  67. package/dist/api/open-api/group.d.ts +1 -3
  68. package/dist/api/open-api/invoice.d.ts +2 -6
  69. package/dist/api/open-api/license-plate.d.ts +1 -3
  70. package/dist/api/open-api/login.d.ts +3 -9
  71. package/dist/api/open-api/red-package.d.ts +1 -3
  72. package/dist/api/open-api/settings.d.ts +2 -6
  73. package/dist/api/open-api/soter.d.ts +3 -9
  74. package/dist/api/open-api/subscribe-message.d.ts +1 -3
  75. package/dist/api/open-api/user-info.d.ts +2 -6
  76. package/dist/api/open-api/werun.d.ts +2 -6
  77. package/dist/api/payment/index.d.ts +2 -6
  78. package/dist/api/share/index.d.ts +10 -30
  79. package/dist/api/storage/background-fetch.d.ts +4 -12
  80. package/dist/api/storage/index.d.ts +2 -6
  81. package/dist/api/swan/index.d.ts +21 -63
  82. package/dist/api/taro.d.ts +1 -3
  83. package/dist/api/ui/background.d.ts +2 -6
  84. package/dist/api/ui/interaction/index.d.ts +2 -6
  85. package/dist/api/ui/menu.d.ts +1 -3
  86. package/dist/api/ui/navigation-bar/index.d.ts +3 -9
  87. package/dist/api/ui/sticky.d.ts +1 -3
  88. package/dist/api/ui/window.d.ts +1 -3
  89. package/dist/api/worker/index.d.ts +1 -3
  90. package/dist/api/wxml/index.d.ts +1 -3
  91. package/dist/index.cjs.d.ts +308 -924
  92. package/dist/index.cjs.js +155 -131
  93. package/dist/index.cjs.js.map +1 -1
  94. package/dist/index.esm.d.ts +308 -924
  95. package/dist/index.esm.js +155 -131
  96. package/dist/index.esm.js.map +1 -1
  97. package/dist/taroApis.d.ts +307 -921
  98. package/dist/utils/index.d.ts +4 -9
  99. package/dist/utils/index.js +48 -36
  100. package/package.json +8 -4
@@ -1,18 +1,6 @@
1
- export declare const setVisualEffectOnCapture: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const setScreenBrightness: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const setKeepScreenOn: () => Promise<{
8
- errMsg: string;
9
- }>;
10
- export declare const onUserCaptureScreen: () => Promise<{
11
- errMsg: string;
12
- }>;
13
- export declare const offUserCaptureScreen: () => Promise<{
14
- errMsg: string;
15
- }>;
16
- export declare const getScreenBrightness: () => Promise<{
17
- errMsg: string;
18
- }>;
1
+ export declare const setVisualEffectOnCapture: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const setScreenBrightness: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const setKeepScreenOn: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const onUserCaptureScreen: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const offUserCaptureScreen: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const getScreenBrightness: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,33 +1,11 @@
1
- export declare const stopWifi: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const startWifi: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const setWifiList: () => Promise<{
8
- errMsg: string;
9
- }>;
10
- export declare const onWifiConnectedWithPartialInfo: () => Promise<{
11
- errMsg: string;
12
- }>;
13
- export declare const onWifiConnected: () => Promise<{
14
- errMsg: string;
15
- }>;
16
- export declare const onGetWifiList: () => Promise<{
17
- errMsg: string;
18
- }>;
19
- export declare const offWifiConnected: () => Promise<{
20
- errMsg: string;
21
- }>;
22
- export declare const offGetWifiList: () => Promise<{
23
- errMsg: string;
24
- }>;
25
- export declare const getWifiList: () => Promise<{
26
- errMsg: string;
27
- }>;
28
- export declare const getConnectedWifi: () => Promise<{
29
- errMsg: string;
30
- }>;
31
- export declare const connectWifi: () => Promise<{
32
- errMsg: string;
33
- }>;
1
+ export declare const stopWifi: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const startWifi: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const setWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const onWifiConnectedWithPartialInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const onWifiConnected: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const onGetWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export declare const offWifiConnected: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const offGetWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ export declare const getWifiList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
+ export declare const getConnectedWifi: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
11
+ export declare const connectWifi: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,6 +1,2 @@
1
- export declare const getExtConfigSync: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const getExtConfig: () => Promise<{
5
- errMsg: string;
6
- }>;
1
+ export declare const getExtConfigSync: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const getExtConfig: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,24 +1,8 @@
1
- export declare const saveFileToDisk: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const saveFile: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const removeSavedFile: () => Promise<{
8
- errMsg: string;
9
- }>;
10
- export declare const openDocument: () => Promise<{
11
- errMsg: string;
12
- }>;
13
- export declare const getSavedFileList: () => Promise<{
14
- errMsg: string;
15
- }>;
16
- export declare const getSavedFileInfo: () => Promise<{
17
- errMsg: string;
18
- }>;
19
- export declare const getFileSystemManager: () => Promise<{
20
- errMsg: string;
21
- }>;
22
- export declare const getFileInfo: () => Promise<{
23
- errMsg: string;
24
- }>;
1
+ export declare const saveFileToDisk: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const saveFile: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const removeSavedFile: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const openDocument: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const getSavedFileList: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const getSavedFileInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export declare const getFileSystemManager: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const getFileInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,32 +1,14 @@
1
- export declare const stopLocationUpdate: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const startLocationUpdateBackground: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const startLocationUpdate: () => Promise<{
8
- errMsg: string;
9
- }>;
1
+ export declare const stopLocationUpdate: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const startLocationUpdateBackground: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const startLocationUpdate: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
4
  export declare const openLocation: (options?: Partial<{
11
5
  scale: number;
12
6
  }>) => Promise<any>;
13
- export declare const onLocationChangeError: () => Promise<{
14
- errMsg: string;
15
- }>;
16
- export declare const onLocationChange: () => Promise<{
17
- errMsg: string;
18
- }>;
19
- export declare const offLocationChangeError: () => Promise<{
20
- errMsg: string;
21
- }>;
22
- export declare const offLocationChange: () => Promise<{
23
- errMsg: string;
24
- }>;
7
+ export declare const onLocationChangeError: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const onLocationChange: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ export declare const offLocationChangeError: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
+ export declare const offLocationChange: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
25
11
  export { getLocation } from './getLocation';
26
- export declare const choosePoi: () => Promise<{
27
- errMsg: string;
28
- }>;
29
- export declare const getFuzzyLocation: () => Promise<{
30
- errMsg: string;
31
- }>;
12
+ export declare const choosePoi: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
13
+ export declare const getFuzzyLocation: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
32
14
  export { chooseLocation } from './chooseLocation';
@@ -1,42 +1,16 @@
1
1
  import Taro from '@tarojs/api';
2
2
  export declare class EditorContext implements Taro.EditorContext {
3
- blur: () => Promise<{
4
- errMsg: string;
5
- }>;
6
- clear: () => Promise<{
7
- errMsg: string;
8
- }>;
9
- format: () => Promise<{
10
- errMsg: string;
11
- }>;
12
- getContents: () => Promise<{
13
- errMsg: string;
14
- }>;
15
- getSelectionText: () => Promise<{
16
- errMsg: string;
17
- }>;
18
- insertDivider: () => Promise<{
19
- errMsg: string;
20
- }>;
21
- insertImage: () => Promise<{
22
- errMsg: string;
23
- }>;
24
- insertText: () => Promise<{
25
- errMsg: string;
26
- }>;
27
- redo: () => Promise<{
28
- errMsg: string;
29
- }>;
30
- removeFormat: () => Promise<{
31
- errMsg: string;
32
- }>;
33
- scrollIntoView: () => Promise<{
34
- errMsg: string;
35
- }>;
36
- setContents: () => Promise<{
37
- errMsg: string;
38
- }>;
39
- undo: () => Promise<{
40
- errMsg: string;
41
- }>;
3
+ blur: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ clear: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ format: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ getContents: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ getSelectionText: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ insertDivider: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ insertImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
+ insertText: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
11
+ redo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
12
+ removeFormat: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
13
+ scrollIntoView: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
14
+ setContents: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
15
+ undo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
42
16
  }
@@ -1,29 +1,13 @@
1
1
  import Taro from '@tarojs/api';
2
- export declare const stopVoice: () => Promise<{
3
- errMsg: string;
4
- }>;
5
- export declare const setInnerAudioOption: () => Promise<{
6
- errMsg: string;
7
- }>;
8
- export declare const playVoice: () => Promise<{
9
- errMsg: string;
10
- }>;
11
- export declare const pauseVoice: () => Promise<{
12
- errMsg: string;
13
- }>;
14
- export declare const getAvailableAudioSources: () => Promise<{
15
- errMsg: string;
16
- }>;
17
- export declare const createWebAudioContext: () => Promise<{
18
- errMsg: string;
19
- }>;
20
- export declare const createMediaAudioPlayer: () => Promise<{
21
- errMsg: string;
22
- }>;
2
+ export declare const stopVoice: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const setInnerAudioOption: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const playVoice: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const pauseVoice: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const getAvailableAudioSources: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export declare const createWebAudioContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const createMediaAudioPlayer: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
23
9
  /**
24
10
  * 创建内部 audio 上下文 InnerAudioContext 对象。
25
11
  */
26
12
  export declare const createInnerAudioContext: typeof Taro.createInnerAudioContext;
27
- export declare const createAudioContext: () => Promise<{
28
- errMsg: string;
29
- }>;
13
+ export declare const createAudioContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -46,12 +46,8 @@ export declare class BackgroundAudioManager implements Taro.BackgroundAudioManag
46
46
  onEnded: (callback?: () => void) => void | undefined;
47
47
  onStop: (callback?: () => void) => void;
48
48
  onTimeUpdate: (callback?: () => void) => void | undefined;
49
- onPrev: () => Promise<{
50
- errMsg: string;
51
- }>;
52
- onNext: () => Promise<{
53
- errMsg: string;
54
- }>;
49
+ onPrev: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
50
+ onNext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
55
51
  offCanplay: (callback?: () => void) => void | undefined;
56
52
  offWaiting: (callback?: () => void) => void | undefined;
57
53
  offError: (callback?: () => void) => void;
@@ -62,10 +58,6 @@ export declare class BackgroundAudioManager implements Taro.BackgroundAudioManag
62
58
  offEnded: (callback?: () => void) => void | undefined;
63
59
  offStop: (callback?: () => void) => void;
64
60
  offTimeUpdate: (callback?: () => void) => void | undefined;
65
- offPrev: () => Promise<{
66
- errMsg: string;
67
- }>;
68
- offNext: () => Promise<{
69
- errMsg: string;
70
- }>;
61
+ offPrev: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
62
+ offNext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
71
63
  }
@@ -1,28 +1,12 @@
1
1
  import { BackgroundAudioManager } from './BackgroundAudioManager';
2
- export declare const stopBackgroundAudio: () => Promise<{
3
- errMsg: string;
4
- }>;
5
- export declare const seekBackgroundAudio: () => Promise<{
6
- errMsg: string;
7
- }>;
8
- export declare const playBackgroundAudio: () => Promise<{
9
- errMsg: string;
10
- }>;
11
- export declare const pauseBackgroundAudio: () => Promise<{
12
- errMsg: string;
13
- }>;
14
- export declare const onBackgroundAudioStop: () => Promise<{
15
- errMsg: string;
16
- }>;
17
- export declare const onBackgroundAudioPlay: () => Promise<{
18
- errMsg: string;
19
- }>;
20
- export declare const onBackgroundAudioPause: () => Promise<{
21
- errMsg: string;
22
- }>;
23
- export declare const getBackgroundAudioPlayerState: () => Promise<{
24
- errMsg: string;
25
- }>;
2
+ export declare const stopBackgroundAudio: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const seekBackgroundAudio: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const playBackgroundAudio: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const pauseBackgroundAudio: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const onBackgroundAudioStop: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export declare const onBackgroundAudioPlay: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const onBackgroundAudioPause: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ export declare const getBackgroundAudioPlayerState: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
26
10
  /**
27
11
  * 获取全局唯一的背景音频管理器
28
12
  */
@@ -1,3 +1 @@
1
- export declare const createCameraContext: () => Promise<{
2
- errMsg: string;
3
- }>;
1
+ export declare const createCameraContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,15 +1,7 @@
1
- export declare const saveImageToPhotosAlbum: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const previewMedia: () => Promise<{
5
- errMsg: string;
6
- }>;
1
+ export declare const saveImageToPhotosAlbum: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const previewMedia: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
3
  export * from './getImageInfo';
8
4
  export * from './previewImage';
9
- export declare const compressImage: () => Promise<{
10
- errMsg: string;
11
- }>;
12
- export declare const chooseMessageFile: () => Promise<{
13
- errMsg: string;
14
- }>;
5
+ export declare const compressImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const chooseMessageFile: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
15
7
  export * from './chooseImage';
@@ -1,6 +1,2 @@
1
- export declare const createLivePusherContext: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const createLivePlayerContext: () => Promise<{
5
- errMsg: string;
6
- }>;
1
+ export declare const createLivePusherContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const createLivePlayerContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,3 +1 @@
1
- export declare const createMapContext: () => Promise<{
2
- errMsg: string;
3
- }>;
1
+ export declare const createMapContext: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,3 +1 @@
1
- export declare const createMediaRecorder: () => Promise<{
2
- errMsg: string;
3
- }>;
1
+ export declare const createMediaRecorder: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,9 +1,3 @@
1
- export declare const stopRecord: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const startRecord: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const getRecorderManager: () => Promise<{
8
- errMsg: string;
9
- }>;
1
+ export declare const stopRecord: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const startRecord: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const getRecorderManager: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,24 +1,14 @@
1
1
  import Taro from '@tarojs/api';
2
- export declare const saveVideoToPhotosAlbum: () => Promise<{
3
- errMsg: string;
4
- }>;
5
- export declare const openVideoEditor: () => Promise<{
6
- errMsg: string;
7
- }>;
8
- export declare const getVideoInfo: () => Promise<{
9
- errMsg: string;
10
- }>;
2
+ export declare const saveVideoToPhotosAlbum: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const openVideoEditor: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const getVideoInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
11
5
  /**
12
6
  * 创建 video 上下文 VideoContext 对象。
13
7
  */
14
8
  export declare const createVideoContext: typeof Taro.createVideoContext;
15
- export declare const compressVideo: () => Promise<{
16
- errMsg: string;
17
- }>;
9
+ export declare const compressVideo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
18
10
  /**
19
11
  * 拍摄视频或从手机相册中选视频。
20
12
  */
21
13
  export declare const chooseVideo: typeof Taro.chooseVideo;
22
- export declare const chooseMedia: () => Promise<{
23
- errMsg: string;
24
- }>;
14
+ export declare const chooseMedia: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,3 +1 @@
1
- export declare const createVideoDecoder: () => Promise<{
2
- errMsg: string;
3
- }>;
1
+ export declare const createVideoDecoder: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,3 +1 @@
1
- export declare const createMediaContainer: () => Promise<{
2
- errMsg: string;
3
- }>;
1
+ export declare const createMediaContainer: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,42 +1,14 @@
1
- export declare const updateVoIPChatMuteConfig: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const subscribeVoIPVideoMembers: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const setEnable1v1Chat: () => Promise<{
8
- errMsg: string;
9
- }>;
10
- export declare const onVoIPVideoMembersChanged: () => Promise<{
11
- errMsg: string;
12
- }>;
13
- export declare const onVoIPChatStateChanged: () => Promise<{
14
- errMsg: string;
15
- }>;
16
- export declare const onVoIPChatSpeakersChanged: () => Promise<{
17
- errMsg: string;
18
- }>;
19
- export declare const onVoIPChatMembersChanged: () => Promise<{
20
- errMsg: string;
21
- }>;
22
- export declare const onVoIPChatInterrupted: () => Promise<{
23
- errMsg: string;
24
- }>;
25
- export declare const offVoIPVideoMembersChanged: () => Promise<{
26
- errMsg: string;
27
- }>;
28
- export declare const offVoIPChatStateChanged: () => Promise<{
29
- errMsg: string;
30
- }>;
31
- export declare const offVoIPChatMembersChanged: () => Promise<{
32
- errMsg: string;
33
- }>;
34
- export declare const offVoIPChatInterrupted: () => Promise<{
35
- errMsg: string;
36
- }>;
37
- export declare const joinVoIPChat: () => Promise<{
38
- errMsg: string;
39
- }>;
40
- export declare const exitVoIPChat: () => Promise<{
41
- errMsg: string;
42
- }>;
1
+ export declare const updateVoIPChatMuteConfig: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const subscribeVoIPVideoMembers: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const setEnable1v1Chat: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const onVoIPVideoMembersChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const onVoIPChatStateChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const onVoIPChatSpeakersChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export declare const onVoIPChatMembersChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const onVoIPChatInterrupted: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ export declare const offVoIPVideoMembersChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
+ export declare const offVoIPChatStateChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
11
+ export declare const offVoIPChatMembersChanged: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
12
+ export declare const offVoIPChatInterrupted: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
13
+ export declare const joinVoIPChat: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
14
+ export declare const exitVoIPChat: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,15 +1,5 @@
1
- export declare const openEmbeddedMiniProgram: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const navigateToMiniProgram: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const navigateBackMiniProgram: () => Promise<{
8
- errMsg: string;
9
- }>;
10
- export declare const exitMiniProgram: () => Promise<{
11
- errMsg: string;
12
- }>;
13
- export declare const openBusinessView: () => Promise<{
14
- errMsg: string;
15
- }>;
1
+ export declare const openEmbeddedMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const navigateToMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const navigateBackMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const exitMiniProgram: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const openBusinessView: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -1,6 +1,6 @@
1
1
  import { CallbackManager } from '../../utils/handler';
2
2
  import { NETWORK_TIMEOUT, setHeader, XHR_STATS } from './utils';
3
- const createDownloadTask = ({ url, header, success, error }) => {
3
+ const createDownloadTask = ({ url, header, withCredentials = true, success, error }) => {
4
4
  let timeout;
5
5
  const apiName = 'downloadFile';
6
6
  const xhr = new XMLHttpRequest();
@@ -9,7 +9,7 @@ const createDownloadTask = ({ url, header, success, error }) => {
9
9
  progressUpdate: new CallbackManager()
10
10
  };
11
11
  xhr.open('GET', url, true);
12
- xhr.withCredentials = true;
12
+ xhr.withCredentials = !!withCredentials;
13
13
  xhr.responseType = 'blob';
14
14
  setHeader(xhr, header);
15
15
  xhr.onprogress = e => {
@@ -100,12 +100,13 @@ const createDownloadTask = ({ url, header, success, error }) => {
100
100
  * 下载文件资源到本地。客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径。使用前请注意阅读相关说明。
101
101
  * 注意:请在服务端响应的 header 中指定合理的 Content-Type 字段,以保证客户端正确处理文件类型。
102
102
  */
103
- export const downloadFile = ({ url, header, success, fail, complete }) => {
103
+ export const downloadFile = ({ url, header, withCredentials, success, fail, complete }) => {
104
104
  let task;
105
105
  const result = new Promise((resolve, reject) => {
106
106
  task = createDownloadTask({
107
107
  url,
108
108
  header,
109
+ withCredentials,
109
110
  success: res => {
110
111
  success && success(res);
111
112
  complete && complete(res);
@@ -1,30 +1,10 @@
1
- export declare const stopLocalServiceDiscovery: () => Promise<{
2
- errMsg: string;
3
- }>;
4
- export declare const startLocalServiceDiscovery: () => Promise<{
5
- errMsg: string;
6
- }>;
7
- export declare const onLocalServiceResolveFail: () => Promise<{
8
- errMsg: string;
9
- }>;
10
- export declare const onLocalServiceLost: () => Promise<{
11
- errMsg: string;
12
- }>;
13
- export declare const onLocalServiceFound: () => Promise<{
14
- errMsg: string;
15
- }>;
16
- export declare const onLocalServiceDiscoveryStop: () => Promise<{
17
- errMsg: string;
18
- }>;
19
- export declare const offLocalServiceResolveFail: () => Promise<{
20
- errMsg: string;
21
- }>;
22
- export declare const offLocalServiceLost: () => Promise<{
23
- errMsg: string;
24
- }>;
25
- export declare const offLocalServiceFound: () => Promise<{
26
- errMsg: string;
27
- }>;
28
- export declare const offLocalServiceDiscoveryStop: () => Promise<{
29
- errMsg: string;
30
- }>;
1
+ export declare const stopLocalServiceDiscovery: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export declare const startLocalServiceDiscovery: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ export declare const onLocalServiceResolveFail: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
+ export declare const onLocalServiceLost: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ export declare const onLocalServiceFound: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ export declare const onLocalServiceDiscoveryStop: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export declare const offLocalServiceResolveFail: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
8
+ export declare const offLocalServiceLost: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ export declare const offLocalServiceFound: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
+ export declare const offLocalServiceDiscoveryStop: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -93,15 +93,14 @@ function _request(options) {
93
93
  for (const key of response.headers.keys()) {
94
94
  res.header[key] = response.headers.get(key);
95
95
  }
96
- if (!response.ok) {
97
- throw response;
98
- }
99
96
  if (options.responseType === 'arraybuffer') {
100
97
  return response.arrayBuffer();
101
98
  }
102
99
  if (res.statusCode !== 204) {
103
100
  if (options.dataType === 'json' || typeof options.dataType === 'undefined') {
104
- return response.json();
101
+ return response.json().catch(() => {
102
+ return null;
103
+ });
105
104
  }
106
105
  }
107
106
  if (options.responseType === 'text' || options.dataType === 'text') {
@@ -118,6 +117,8 @@ function _request(options) {
118
117
  .catch(err => {
119
118
  typeof fail === 'function' && fail(err);
120
119
  typeof complete === 'function' && complete(res);
120
+ err.statusCode = res.statusCode;
121
+ err.errMsg = err.message;
121
122
  return Promise.reject(err);
122
123
  });
123
124
  }