Skip to content

Commit 9baef47

Browse files
committed
refactor(types): sync components types
1 parent 2948133 commit 9baef47

File tree

8 files changed

+30
-9
lines changed

8 files changed

+30
-9
lines changed

docs/apis/media/audio/createInnerAudioContext.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Taro.createInnerAudioContext()
2+
title: Taro.createInnerAudioContext(option)
33
sidebar_label: createInnerAudioContext
44
---
55

@@ -12,9 +12,21 @@ sidebar_label: createInnerAudioContext
1212
## 类型
1313

1414
```tsx
15-
() => InnerAudioContext
15+
(option?: Option) => InnerAudioContext
1616
```
1717

18+
## 参数
19+
20+
| 参数 | 类型 |
21+
| --- | --- |
22+
| option | `Option` |
23+
24+
### Option
25+
26+
| 参数 | 类型 | 说明 |
27+
| --- | --- | --- |
28+
| useWebAudioImplement | `boolean` | 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。<br />API 支持度: weapp |
29+
1830
## 示例代码
1931

2032
```tsx

packages/taro-components/types/Input.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface InputProps extends StandardProps, FormItemProps {
66
*/
77
value?: string
88
/** 设置 React 非受控输入框的初始内容
9-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
9+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
1010
* @unique
1111
*/
1212
defaultValue?: string

packages/taro-components/types/Picker.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ interface PickerSelectorProps extends PickerStandardProps {
6262
*/
6363
value?: number
6464
/** 设置 React 非受控状态下的初始取值
65-
* @supported weapp, h5, rn
65+
* @supported weapp, h5, rn, harmony_hybrid
6666
*/
6767
defaultValue?: number
6868
/**

packages/taro-components/types/Slider.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface SliderProps extends StandardProps, FormItemProps {
2727
*/
2828
value?: number
2929
/** 设置 React 非受控状态下的初始取值
30-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
30+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
3131
* @unique
3232
*/
3333
defaultValue?: string

packages/taro-components/types/Switch.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface SwitchProps extends StandardProps, FormItemProps {
77
*/
88
checked?: boolean
99
/** 设置在 React 非受控状态下,当前是否选中
10-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
10+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
1111
* @unique
1212
*/
1313
defaultChecked?: boolean

packages/taro-components/types/Textarea.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface TextareaProps extends StandardProps, FormItemProps {
66
*/
77
value?: string
88
/** 设置 React 非受控输入框的初始内容
9-
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
9+
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
1010
* @unique
1111
*/
1212
defaultValue?: string

packages/taro/types/api/media/audio.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,15 @@ declare module '../../index' {
800800
setPosition(...args: any[]): void
801801
}
802802

803+
namespace createInnerAudioContext {
804+
interface Option {
805+
/** 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。
806+
* @supported weapp
807+
*/
808+
useWebAudioImplement: boolean
809+
}
810+
}
811+
803812
interface TaroStatic {
804813
/** 结束播放语音。
805814
* **注意:1.6.0 版本开始,本接口不再维护。建议使用能力更强的 [Taro.createInnerAudioContext](./createInnerAudioContext) 接口**
@@ -979,7 +988,7 @@ declare module '../../index' {
979988
* ```
980989
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createInnerAudioContext.html
981990
*/
982-
createInnerAudioContext(): InnerAudioContext
991+
createInnerAudioContext(option?: createInnerAudioContext.Option): InnerAudioContext
983992

984993
/** 创建 audio 上下文 AudioContext 对象。
985994
* **注意:1.6.0 版本开始,本接口不再维护。建议使用能力更强的 [Taro.createInnerAudioContext](./createInnerAudioContext) 接口**

packages/taro/types/api/taro.extend.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ declare module '../index' {
145145
Current: getCurrentInstance.Current
146146

147147
/** Vue3 插件,用于设置 `getApp()` 中的全局变量
148-
* @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp
148+
* @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp, harmony_hybrid
149149
* @example
150150
* ```js
151151
* // 使用插件

0 commit comments

Comments
 (0)