Skip to content

Commit 70a4db9

Browse files
committed
docs: 4.0.0
1 parent 32d8f29 commit 70a4db9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 2024-09-24 v4.0.0
2+
合入 [#332](https://github.com/wechat-miniprogram/api-typings/pull/332), [#333](https://github.com/wechat-miniprogram/api-typings/pull/333), [#334](https://github.com/wechat-miniprogram/api-typings/pull/334) by [@lvzl](https://github.com/lv-z-l)。这几个 Pull Request 对 `Component``Behavior` 的实现进行了较大改动,以支持:
3+
1. 对于 `Array``Object` 类型的 `property``data`,以值的实际类型作为泛型推导的结果,而非固定推导为 `any[]``Record<string, any>`
4+
2. 改变了 `BehaviorIdentifier` 的类型,通过为其交叉一个带有 `Behavior` 定义信息的虚假类型,使 `Component``Behavior` 能自动推导其使用到的 `Behavior``data`, `properties``methods`
5+
6+
这是一个比较大的 **破坏性改动**,从低于 4.0.0 的版本升级时,可能需要进行一些适配:
7+
1. 全局函数 `Component``Behavior` 的第四个泛型现在是新的 `TBehavior`,如果之前的代码中有为这两个函数手动指定泛型的用例,需要手动添加这个泛型;
8+
2. `Behavior()` 的返回值不再是 `string`(或者说不完全是),之前使用 `string` 接受 `Behavior()` 返回值的实现需要修改为 `WechatMiniprogram.Behavior.BehaviorIdentifier`
9+
3. 自定义组件的 `this.data``this.property` 的推导类型可能会有所变化,需要根据推导类型进行响应改动。
10+
111
## 2024-08-08 v3.12.3
212
- 更新 API 定义到 3.5.2
313
- 修复 [#235](https://github.com/wechat-miniprogram/api-typings/issues/235), [#302](https://github.com/wechat-miniprogram/api-typings/issues/302), [#303](https://github.com/wechat-miniprogram/api-typings/issues/303), [#304](https://github.com/wechat-miniprogram/api-typings/issues/304) by [@Yang Mingshan](https://github.com/yangmingshan)

README-en.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Both PR and issue are welcomed for definitions of pages (`Page`), custom compone
5858
- [xieyuhang](https://github.com/haiya6)
5959
- [苏杰豪](https://github.com/Megasu)
6060
- [Yang Mingshan](https://github.com/yangmingshan)
61+
- [lvzl](https://github.com/lv-z-l)
6162

6263
### Automated tests
6364

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ API 的定义文件(`lib.wx.api.d.ts`)是随 [文档](https://developers.wei
5858
- [xieyuhang](https://github.com/haiya6)
5959
- [苏杰豪](https://github.com/Megasu)
6060
- [Yang Mingshan](https://github.com/yangmingshan)
61+
- [lvzl](https://github.com/lv-z-l)
6162

6263
### 测试
6364

0 commit comments

Comments
 (0)