⚠ ARCHIVED since tencent finally got their own offical type definitions for WeApp
so goodbye and thanks for all the contributors
TypeScript declaration file for WeApp API
-
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
Based on the official WeApp API documentation
Wechat Web DevTool Version 1.01.1712150
WAService.js Version 1.7.0
- 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);
},
});
2019.05.19