Skip to content

Commit

Permalink
feat: update to v2.32.2 & add canvas rendering context typings. close #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tidyzq committed Jun 9, 2023
1 parent f2fafa1 commit 82d28b6
Show file tree
Hide file tree
Showing 4 changed files with 3,157 additions and 126 deletions.
12 changes: 12 additions & 0 deletions test/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@ wx.request<ArrayBuffer>({
expectNotType<any>(thisShouldBeNumber)
expectType<number>(thisShouldBeNumber)
}

wx.createSelectorQuery()
.select('#canvas')
.node(({ node }) => {
const canvas = node as WechatMiniprogram.Canvas
const ctx = canvas.getContext('2d')

expectNotType<any>(ctx)
expectType<string>(ctx.font)
expectType<() => void>(ctx.save)
})
.exec()
1 change: 1 addition & 0 deletions types/wx/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SOFTWARE.
/// <reference path="./lib.wx.page.d.ts" />
/// <reference path="./lib.wx.api.d.ts" />
/// <reference path="./lib.wx.cloud.d.ts" />
/// <reference path="./lib.wx.canvas.d.ts" />
/// <reference path="./lib.wx.component.d.ts" />
/// <reference path="./lib.wx.behavior.d.ts" />
/// <reference path="./lib.wx.event.d.ts" />
Expand Down
Loading

0 comments on commit 82d28b6

Please sign in to comment.