typed-we-app
v1.7.0-update.9
Published
typescript declaration for WeApp
Downloads
10,451
Maintainers
Readme
typed-we-app
TypeScript declaration file for WeApp API
Install
With
npm
installednpm install typed-we-app --save-dev
With
typings
installedtypings install github:Emeryao/typed-we-app -SG
Or get the declaration file here and include it to your project
About
Based on the official WeApp API documentation
Wechat Web DevTool Version 1.01.1712150
WAService.js Version 1.7.0
Sample
- TypeScript
wx.request({
url: 'request/url',
success: (res) => {
console.log(res.data);
}
});
let ctx = wx.createCanvasContext();
ctx.fillText('hello', 0, 0);
let actions = ctx.getActions();
wx.drawCanvas({
canvasId: 'canvas-id',
actions
});
wx.getBLEDeviceServices({
deviceId: '',
success: (res) => {
console.log(res.services[0].uuid);
},
});
Last Update
2019.05.19