Skip to content

Commit

Permalink
feat(baselib): definition for 2.9.4
Browse files Browse the repository at this point in the history
closes #88, #89, #91
  • Loading branch information
SgLy committed Dec 20, 2019
1 parent ff08d2d commit f62b1c3
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 94 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2019-12-20 v2.9.4
- 同步 API 定义到基础库 2.9.4
- 修正一些接口错误(#88#89#91

## 2019-12-06 v2.9.3
- 同步 API 定义到基础库 2.9.3
- 补齐 `Component` 纯数据字段(`pureDataPattern`
Expand Down
1 change: 1 addition & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

基础库版本|npm 版本|命令
-|-|-
[v2.9.4](https://developers.weixin.qq.com/miniprogram/dev/framework/release/#v2-9-4-2019-11-28) | [2.9.4](https://www.npmjs.com/package/miniprogram-api-typings/v/2.9.4) | `npm install [email protected]`
[v2.9.3](https://developers.weixin.qq.com/miniprogram/dev/framework/release/) | [2.9.3](https://www.npmjs.com/package/miniprogram-api-typings/v/2.9.3) | `npm install [email protected]`
[v2.9.2](https://developers.weixin.qq.com/miniprogram/dev/framework/release/#v2-9-2-2019-11-04) | [2.9.2](https://www.npmjs.com/package/miniprogram-api-typings/v/2.9.2) | `npm install [email protected]`
[v2.9.1](https://developers.weixin.qq.com/miniprogram/dev/framework/release/#v2-9-1-2019-10-29) | [2.9.1](https://www.npmjs.com/package/miniprogram-api-typings/v/2.9.1) | `npm install [email protected]`
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miniprogram-api-typings",
"version": "2.9.3",
"version": "2.9.4",
"description": "Type definitions for APIs of Wechat Mini Program in TypeScript",
"main": "./index.d.ts",
"types": "./index.d.ts",
Expand Down
24 changes: 24 additions & 0 deletions test/issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,27 @@ import WX = WechatMiniprogram
const t: ILoginResult = { code: '', errMsg: '' }
expectType<WechatMiniprogram.LoginSuccessCallbackResult>(t)
}

// https://github.com/wechat-miniprogram/api-typings/issues/88
{
wx.canvasToTempFilePath({ canvas: '#canvas' })
wx.canvasToTempFilePath({ canvasId: '' })
wx.canvasToTempFilePath({ canvas: '', quality: 0.5 })
}

// https://github.com/wechat-miniprogram/api-typings/issues/89
{
const udp = wx.createUDPSocket()
const port = udp.bind()
expectType<number>(port)
}

// https://github.com/wechat-miniprogram/api-typings/issues/91
{
expectType<Record<string, any>>(wx.getExtConfigSync())
wx.getExtConfig({
success(res) {
expectType<Record<string, any>>(res.extConfig)
},
})
}
Loading

0 comments on commit f62b1c3

Please sign in to comment.