@spcsn/taro 0.1.0

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 (140) hide show
  1. package/README.md +12 -0
  2. package/dist/index.js +147 -0
  3. package/dist/index.js.map +1 -0
  4. package/index.js +9 -0
  5. package/package.json +86 -0
  6. package/types/api/ad/index.d.ts +197 -0
  7. package/types/api/ai/face.d.ts +133 -0
  8. package/types/api/ai/inference.d.ts +129 -0
  9. package/types/api/ai/visionkit.d.ts +874 -0
  10. package/types/api/alipay/index.d.ts +69 -0
  11. package/types/api/base/crypto.d.ts +104 -0
  12. package/types/api/base/debug.d.ts +329 -0
  13. package/types/api/base/env.d.ts +19 -0
  14. package/types/api/base/index.d.ts +102 -0
  15. package/types/api/base/performance.d.ts +258 -0
  16. package/types/api/base/system.d.ts +742 -0
  17. package/types/api/base/update.d.ts +130 -0
  18. package/types/api/base/weapp/app-event.d.ts +265 -0
  19. package/types/api/base/weapp/life-cycle.d.ts +155 -0
  20. package/types/api/canvas/index.d.ts +2162 -0
  21. package/types/api/cloud/index.d.ts +2622 -0
  22. package/types/api/data-analysis/index.d.ts +122 -0
  23. package/types/api/device/accelerometer.d.ts +102 -0
  24. package/types/api/device/accessibility.d.ts +26 -0
  25. package/types/api/device/battery.d.ts +46 -0
  26. package/types/api/device/bluetooth-ble.d.ts +601 -0
  27. package/types/api/device/bluetooth-peripheral.d.ts +430 -0
  28. package/types/api/device/bluetooth.d.ts +463 -0
  29. package/types/api/device/calendar.d.ts +98 -0
  30. package/types/api/device/clipboard.d.ts +81 -0
  31. package/types/api/device/compass.d.ts +105 -0
  32. package/types/api/device/contact.d.ts +110 -0
  33. package/types/api/device/gyroscope.d.ts +85 -0
  34. package/types/api/device/iBeacon.d.ts +168 -0
  35. package/types/api/device/keyboard.d.ts +97 -0
  36. package/types/api/device/memory.d.ts +52 -0
  37. package/types/api/device/motion.d.ts +88 -0
  38. package/types/api/device/network.d.ts +172 -0
  39. package/types/api/device/nfc.d.ts +1238 -0
  40. package/types/api/device/phone.d.ts +30 -0
  41. package/types/api/device/scan.d.ts +111 -0
  42. package/types/api/device/screen.d.ts +217 -0
  43. package/types/api/device/sms.d.ts +26 -0
  44. package/types/api/device/vibrate.d.ts +51 -0
  45. package/types/api/device/wifi.d.ts +301 -0
  46. package/types/api/ext/index.d.ts +64 -0
  47. package/types/api/files/index.d.ts +1472 -0
  48. package/types/api/framework/index.d.ts +51 -0
  49. package/types/api/location/index.d.ts +517 -0
  50. package/types/api/media/audio.d.ts +1013 -0
  51. package/types/api/media/background-audio.d.ts +291 -0
  52. package/types/api/media/camera.d.ts +207 -0
  53. package/types/api/media/editor.d.ts +239 -0
  54. package/types/api/media/image.d.ts +469 -0
  55. package/types/api/media/live.d.ts +461 -0
  56. package/types/api/media/map.d.ts +638 -0
  57. package/types/api/media/media-recorder.d.ts +117 -0
  58. package/types/api/media/recorder.d.ts +317 -0
  59. package/types/api/media/video-decoder.d.ts +117 -0
  60. package/types/api/media/video-processing.d.ts +84 -0
  61. package/types/api/media/video.d.ts +527 -0
  62. package/types/api/media/voip.d.ts +393 -0
  63. package/types/api/navigate/index.d.ts +327 -0
  64. package/types/api/network/download.d.ts +173 -0
  65. package/types/api/network/mdns.d.ts +191 -0
  66. package/types/api/network/request.d.ts +480 -0
  67. package/types/api/network/tcp.d.ts +181 -0
  68. package/types/api/network/udp.d.ts +218 -0
  69. package/types/api/network/upload.d.ts +201 -0
  70. package/types/api/network/websocket.d.ts +383 -0
  71. package/types/api/open-api/account.d.ts +51 -0
  72. package/types/api/open-api/address.d.ts +68 -0
  73. package/types/api/open-api/authorize.d.ts +80 -0
  74. package/types/api/open-api/card.d.ts +110 -0
  75. package/types/api/open-api/channels.d.ts +225 -0
  76. package/types/api/open-api/customer-service.d.ts +45 -0
  77. package/types/api/open-api/device-voip.d.ts +103 -0
  78. package/types/api/open-api/facial.d.ts +98 -0
  79. package/types/api/open-api/favorites.d.ts +101 -0
  80. package/types/api/open-api/group.d.ts +59 -0
  81. package/types/api/open-api/invoice.d.ts +87 -0
  82. package/types/api/open-api/license-plate.d.ts +27 -0
  83. package/types/api/open-api/login.d.ts +115 -0
  84. package/types/api/open-api/my-miniprogram.d.ts +28 -0
  85. package/types/api/open-api/privacy.d.ts +107 -0
  86. package/types/api/open-api/redpackage.d.ts +24 -0
  87. package/types/api/open-api/settings.d.ts +174 -0
  88. package/types/api/open-api/soter.d.ts +184 -0
  89. package/types/api/open-api/sticker.d.ts +83 -0
  90. package/types/api/open-api/subscribe-message.d.ts +305 -0
  91. package/types/api/open-api/user-info.d.ts +182 -0
  92. package/types/api/open-api/werun.d.ts +101 -0
  93. package/types/api/payment/index.d.ts +119 -0
  94. package/types/api/qq/index.d.ts +354 -0
  95. package/types/api/route/index.d.ts +324 -0
  96. package/types/api/share/index.d.ts +354 -0
  97. package/types/api/skyline/index.d.ts +345 -0
  98. package/types/api/storage/background-fetch.d.ts +131 -0
  99. package/types/api/storage/cache-manager.d.ts +249 -0
  100. package/types/api/storage/index.d.ts +405 -0
  101. package/types/api/swan/bookshelf.d.ts +307 -0
  102. package/types/api/swan/download-package.d.ts +80 -0
  103. package/types/api/swan/index.d.ts +251 -0
  104. package/types/api/swan/pay.d.ts +139 -0
  105. package/types/api/taro.extend.d.ts +233 -0
  106. package/types/api/taro.hooks.d.ts +148 -0
  107. package/types/api/ui/animation.d.ts +427 -0
  108. package/types/api/ui/background.d.ts +69 -0
  109. package/types/api/ui/custom-component.d.ts +23 -0
  110. package/types/api/ui/fonts.d.ts +77 -0
  111. package/types/api/ui/interaction.d.ts +281 -0
  112. package/types/api/ui/menu.d.ts +29 -0
  113. package/types/api/ui/navigation-bar.d.ts +130 -0
  114. package/types/api/ui/pull-down-refresh.d.ts +50 -0
  115. package/types/api/ui/scroll.d.ts +114 -0
  116. package/types/api/ui/sticky.d.ts +32 -0
  117. package/types/api/ui/tab-bar.d.ts +196 -0
  118. package/types/api/ui/window.d.ts +71 -0
  119. package/types/api/worker/index.d.ts +83 -0
  120. package/types/api/wxml/index.d.ts +540 -0
  121. package/types/compile/compiler.d.ts +32 -0
  122. package/types/compile/config/h5.d.ts +134 -0
  123. package/types/compile/config/harmony.d.ts +118 -0
  124. package/types/compile/config/index.d.ts +8 -0
  125. package/types/compile/config/manifest.d.ts +155 -0
  126. package/types/compile/config/mini.d.ts +118 -0
  127. package/types/compile/config/plugin.d.ts +34 -0
  128. package/types/compile/config/project.d.ts +338 -0
  129. package/types/compile/config/rn.d.ts +85 -0
  130. package/types/compile/config/util.d.ts +179 -0
  131. package/types/compile/hooks.d.ts +13 -0
  132. package/types/compile/index.d.ts +11 -0
  133. package/types/compile/viteCompilerContext.d.ts +167 -0
  134. package/types/global.d.ts +428 -0
  135. package/types/index.d.ts +190 -0
  136. package/types/taro.api.d.ts +130 -0
  137. package/types/taro.component.d.ts +168 -0
  138. package/types/taro.config.d.ts +712 -0
  139. package/types/taro.lifecycle.d.ts +220 -0
  140. package/types/taro.runtime.d.ts +9 -0
@@ -0,0 +1,30 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace makePhoneCall {
5
+ interface Option {
6
+ /** 需要拨打的电话号码 */
7
+ phoneNumber: string
8
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
9
+ complete?: (res: TaroGeneral.CallbackResult) => void
10
+ /** 接口调用失败的回调函数 */
11
+ fail?: (res: TaroGeneral.CallbackResult) => void
12
+ /** 接口调用成功的回调函数 */
13
+ success?: (res: TaroGeneral.CallbackResult) => void
14
+ }
15
+ }
16
+
17
+ interface TaroStatic {
18
+ /** 拨打电话
19
+ * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid
20
+ * @example
21
+ * ```tsx
22
+ * Taro.makePhoneCall({
23
+ * phoneNumber: '1340000' //仅为示例,并非真实的电话号码
24
+ * })
25
+ * ```
26
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/phone/wx.makePhoneCall.html
27
+ */
28
+ makePhoneCall(option: makePhoneCall.Option): Promise<TaroGeneral.CallbackResult>
29
+ }
30
+ }
@@ -0,0 +1,111 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace scanCode {
5
+ interface Option {
6
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
+ complete?: (res: TaroGeneral.CallbackResult) => void
8
+ /** 接口调用失败的回调函数 */
9
+ fail?: (res: TaroGeneral.CallbackResult) => void
10
+ /** 是否只能从相机扫码,不允许从相册选择图片
11
+ * @default false
12
+ */
13
+ onlyFromCamera?: boolean
14
+ /** 扫码类型 */
15
+ scanType?: (keyof ScanType)[]
16
+ /** 接口调用成功的回调函数 */
17
+ success?: (result: SuccessCallbackResult) => void
18
+ }
19
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
20
+ /** 所扫码的字符集 */
21
+ charSet: string
22
+ /** 当所扫的码为当前小程序二维码时,会返回此字段,内容为二维码携带的 path */
23
+ path: string
24
+ /** 原始数据,base64编码 */
25
+ rawData: string
26
+ /** 所扫码的内容 */
27
+ result: string
28
+ /** 所扫码的类型 */
29
+ scanType: keyof QRType
30
+ /** 调用结果 */
31
+ errMsg: string
32
+ }
33
+ /** 扫码类型 */
34
+ interface ScanType {
35
+ /** 一维码 */
36
+ barCode
37
+ /** 二维码 */
38
+ qrCode
39
+ /** Data Matrix 码 */
40
+ datamatrix
41
+ /** PDF417 条码 */
42
+ pdf417
43
+ }
44
+ /** 所扫码的类型 */
45
+ interface QRType {
46
+ /** 二维码 */
47
+ QR_CODE
48
+ /** 一维码 */
49
+ AZTEC
50
+ /** 一维码 */
51
+ CODABAR
52
+ /** 一维码 */
53
+ CODE_39
54
+ /** 一维码 */
55
+ CODE_93
56
+ /** 一维码 */
57
+ CODE_128
58
+ /** 二维码 */
59
+ DATA_MATRIX
60
+ /** 一维码 */
61
+ EAN_8
62
+ /** 一维码 */
63
+ EAN_13
64
+ /** 一维码 */
65
+ ITF
66
+ /** 一维码 */
67
+ MAXICODE
68
+ /** 二维码 */
69
+ PDF_417
70
+ /** 一维码 */
71
+ RSS_14
72
+ /** 一维码 */
73
+ RSS_EXPANDED
74
+ /** 一维码 */
75
+ UPC_A
76
+ /** 一维码 */
77
+ UPC_E
78
+ /** 一维码 */
79
+ UPC_EAN_EXTENSION
80
+ /** 二维码 */
81
+ WX_CODE
82
+ /** 一维码 */
83
+ CODE_25
84
+ }
85
+ }
86
+
87
+ interface TaroStatic {
88
+ /**
89
+ * 调起客户端扫码界面,扫码成功后返回对应的结果
90
+ * @supported weapp, swan, jd, qq, tt, h5, rn
91
+ * @example
92
+ * ```tsx
93
+ * // 允许从相机和相册扫码
94
+ * Taro.scanCode({
95
+ * success: (res) => {
96
+ * console.log(res)
97
+ * }
98
+ * })
99
+ * // 只允许从相机扫码
100
+ * Taro.scanCode({
101
+ * onlyFromCamera: true,
102
+ * success: (res) => {
103
+ * console.log(res)
104
+ * }
105
+ * })
106
+ * ```
107
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/scan/wx.scanCode.html
108
+ */
109
+ scanCode(option: scanCode.Option): Promise<scanCode.SuccessCallbackResult>
110
+ }
111
+ }
@@ -0,0 +1,217 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace setVisualEffectOnCapture {
5
+ interface Option {
6
+ /** 截屏/录屏时的表现,仅支持 none / hidden,传入 hidden 则表示在截屏/录屏时隐藏屏幕
7
+ * @default "none"
8
+ */
9
+ visualEffect?: 'none' | 'hidden'
10
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
11
+ complete?: (res: TaroGeneral.CallbackResult) => void
12
+ /** 接口调用失败的回调函数 */
13
+ fail?: (res: TaroGeneral.CallbackResult) => void
14
+ /** 接口调用成功的回调函数 */
15
+ success?: (res: TaroGeneral.CallbackResult) => void
16
+ }
17
+ }
18
+
19
+ namespace setScreenBrightness {
20
+ interface Option {
21
+ /** 屏幕亮度值,范围 0 ~ 1。0 最暗,1 最亮 */
22
+ value: number
23
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
24
+ complete?: (res: TaroGeneral.CallbackResult) => void
25
+ /** 接口调用失败的回调函数 */
26
+ fail?: (res: TaroGeneral.CallbackResult) => void
27
+ /** 接口调用成功的回调函数 */
28
+ success?: (res: TaroGeneral.CallbackResult) => void
29
+ }
30
+ }
31
+
32
+ namespace setKeepScreenOn {
33
+ interface Promised extends TaroGeneral.CallbackResult {
34
+ /** 调用结果 */
35
+ errMsg: string
36
+ }
37
+ interface Option {
38
+ /** 是否保持屏幕常亮 */
39
+ keepScreenOn: boolean
40
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
41
+ complete?: (res: TaroGeneral.CallbackResult) => void
42
+ /** 接口调用失败的回调函数 */
43
+ fail?: (res: TaroGeneral.CallbackResult) => void
44
+ /** 接口调用成功的回调函数 */
45
+ success?: (res: TaroGeneral.CallbackResult) => void
46
+ }
47
+ }
48
+
49
+ namespace onUserCaptureScreen {
50
+ /** 用户主动截屏事件的回调函数 */
51
+ type Callback = (
52
+ result: TaroGeneral.CallbackResult,
53
+ ) => void
54
+ }
55
+
56
+ namespace onScreenRecordingStateChanged {
57
+ interface ScreenRecordingState {
58
+ /** 开始录屏 */
59
+ start
60
+ /** 结束录屏 */
61
+ stop
62
+ }
63
+ /** 用户录屏事件的监听函数 */
64
+ type Callback = (
65
+ /** 录屏状态 */
66
+ state: keyof ScreenRecordingState,
67
+ ) => void
68
+ }
69
+
70
+ namespace getScreenRecordingState {
71
+ interface Option {
72
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
73
+ complete?: (res: TaroGeneral.CallbackResult) => void
74
+ /** 接口调用失败的回调函数 */
75
+ fail?: (res: TaroGeneral.CallbackResult) => void
76
+ /** 接口调用成功的回调函数 */
77
+ success?: (option: SuccessCallbackResult) => void
78
+ }
79
+ interface ScreenRecordingState {
80
+ /** 开启 */
81
+ on
82
+ /** 关闭 */
83
+ off
84
+ }
85
+ interface SuccessCallbackResult {
86
+ /** 录屏状态 */
87
+ state: keyof ScreenRecordingState
88
+ }
89
+ }
90
+
91
+ namespace getScreenBrightness {
92
+ interface Option {
93
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
94
+ complete?: (res: TaroGeneral.CallbackResult) => void
95
+ /** 接口调用失败的回调函数 */
96
+ fail?: (res: TaroGeneral.CallbackResult) => void
97
+ /** 接口调用成功的回调函数 */
98
+ success?: (option: SuccessCallbackOption) => void
99
+ }
100
+
101
+ interface SuccessCallbackOption {
102
+ /** 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮 */
103
+ value: number
104
+ }
105
+ }
106
+
107
+ interface TaroStatic {
108
+ /** 设置截屏/录屏时屏幕表现,仅支持在 Android 端调用
109
+ * @supported weapp, alipay
110
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setVisualEffectOnCapture.html
111
+ */
112
+ setVisualEffectOnCapture(option: setVisualEffectOnCapture.Option): Promise<TaroGeneral.CallbackResult>
113
+
114
+ /** 设置屏幕亮度。
115
+ * @supported weapp, swan, jd, qq, tt, rn
116
+ * @example
117
+ * ```tsx
118
+ * Taro.setScreenBrightness(params).then(...)
119
+ * ```
120
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setScreenBrightness.html
121
+ */
122
+ setScreenBrightness(option: setScreenBrightness.Option): Promise<TaroGeneral.CallbackResult>
123
+
124
+ /**
125
+ * 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。
126
+ * @supported weapp, alipay, swan, jd, qq, tt, rn, harmony_hybrid
127
+ * @example
128
+ * ```tsx
129
+ * // 保持屏幕常亮
130
+ * Taro.setKeepScreenOn({
131
+ * keepScreenOn: true
132
+ * })
133
+ * ```
134
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setKeepScreenOn.html
135
+ */
136
+ setKeepScreenOn(option: setKeepScreenOn.Option): Promise<setKeepScreenOn.Promised>
137
+
138
+ /**
139
+ * 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件
140
+ * @supported weapp, alipay, swan, jd, tt, harmony_hybrid
141
+ * @example
142
+ * ```tsx
143
+ * Taro.onUserCaptureScreen(function (res) {
144
+ * console.log('用户截屏了')
145
+ * })
146
+ * ```
147
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.onUserCaptureScreen.html
148
+ */
149
+ onUserCaptureScreen(
150
+ /** 用户主动截屏事件的回调函数 */
151
+ callback: onUserCaptureScreen.Callback,
152
+ ): void
153
+
154
+ /** 监听用户录屏事件
155
+ * @supported weapp
156
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.onScreenRecordingStateChanged.html
157
+ * @example
158
+ * ```tsx
159
+ * // 监听用户录屏事件
160
+ * const handler = function (res) {
161
+ * console.log(res.state)
162
+ * }
163
+ * Taro.onScreenRecordingStateChanged(handler)
164
+ * ```
165
+ */
166
+ onScreenRecordingStateChanged(
167
+ /** 用户录屏事件的监听函数 */
168
+ callback: onScreenRecordingStateChanged.Callback
169
+ ): void
170
+
171
+ /** 用户主动截屏事件。取消事件监听。
172
+ * @supported weapp, alipay, swan, jd, tt
173
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html
174
+ */
175
+ offUserCaptureScreen(
176
+ /** 用户主动截屏事件的回调函数 */
177
+ callback: onUserCaptureScreen.Callback,
178
+ ): void
179
+
180
+ /** 取消用户录屏事件的监听函数
181
+ * @supported weapp
182
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
183
+ */
184
+ offScreenRecordingStateChanged(
185
+ /** 用户录屏事件的监听函数 */
186
+ callback?: onScreenRecordingStateChanged.Callback
187
+ ): void
188
+
189
+ /** 查询用户是否在录屏
190
+ * @supported weapp
191
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenRecordingState.html
192
+ * @example
193
+ * ```tsx
194
+ * Taro.getScreenRecordingState({
195
+ * success: function (res) {
196
+ * console.log(res.state)
197
+ * },
198
+ * })
199
+ * ```
200
+ */
201
+ getScreenRecordingState(
202
+ option?: getScreenRecordingState.Option
203
+ ): Promise<getScreenRecordingState.SuccessCallbackResult>
204
+
205
+ /**
206
+ * 获取屏幕亮度。
207
+ *
208
+ * **说明**
209
+ * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。
210
+ * @supported weapp, alipay, swan, jd, qq, rn, harmony
211
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html
212
+ */
213
+ getScreenBrightness(
214
+ option?: getScreenBrightness.Option
215
+ ): Promise<getScreenBrightness.SuccessCallbackOption>
216
+ }
217
+ }
@@ -0,0 +1,26 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace sendSms {
5
+ interface Option {
6
+ /** 预填到发送短信面板的手机号 */
7
+ phoneNumber?: string
8
+ /** 预填到发送短信面板的内容 */
9
+ content?: string
10
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
11
+ complete?: (res: TaroGeneral.CallbackResult) => void
12
+ /** 接口调用失败的回调函数 */
13
+ fail?: (res: TaroGeneral.CallbackResult) => void
14
+ /** 接口调用成功的回调函数 */
15
+ success?: (res: TaroGeneral.CallbackResult) => void
16
+ }
17
+ }
18
+
19
+ interface TaroStatic {
20
+ /** 拉起手机发送短信界面
21
+ * @supported weapp, tt
22
+ * @see declare module '../../index'
23
+ */
24
+ sendSms(option: sendSms.Option): Promise<TaroGeneral.CallbackResul>
25
+ }
26
+ }
@@ -0,0 +1,51 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace vibrateShort {
5
+ interface Option {
6
+ /** 震动强度类型,有效值为:heavy、medium、light */
7
+ type?: 'heavy' | 'medium' | 'light'
8
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
9
+ complete?: (res: TaroGeneral.CallbackResult) => void
10
+ /** 接口调用失败的回调函数 */
11
+ fail?: (res: TaroGeneral.CallbackResult) => void
12
+ /** 接口调用成功的回调函数 */
13
+ success?: (res: TaroGeneral.CallbackResult) => void
14
+ }
15
+ }
16
+
17
+ namespace vibrateLong {
18
+ interface Option {
19
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
20
+ complete?: (res: TaroGeneral.CallbackResult) => void
21
+ /** 接口调用失败的回调函数 */
22
+ fail?: (res: TaroGeneral.CallbackResult) => void
23
+ /** 接口调用成功的回调函数 */
24
+ success?: (res: TaroGeneral.CallbackResult) => void
25
+ }
26
+ }
27
+
28
+ interface TaroStatic {
29
+ /** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效
30
+ *
31
+ * 仅微信小程序平台支持 type 参数
32
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
33
+ * @example
34
+ * ```tsx
35
+ * Taro.vibrateShort(params).then(...)
36
+ * ```
37
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateShort.html
38
+ */
39
+ vibrateShort(option?: vibrateShort.Option): Promise<TaroGeneral.CallbackResult>
40
+
41
+ /** 使手机发生较长时间的振动(400ms)
42
+ * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony
43
+ * @example
44
+ * ```tsx
45
+ * Taro.vibrateLong(params).then(...)
46
+ * ```
47
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateLong.html
48
+ */
49
+ vibrateLong(option?: vibrateLong.Option): Promise<TaroGeneral.CallbackResult>
50
+ }
51
+ }