Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

emeryao/typed-we-app

Repository files navigation

⚠ ARCHIVED since tencent finally got their own offical type definitions for WeApp

so goodbye and thanks for all the contributors

typed-we-app

TypeScript declaration file for WeApp API

NPM

Install

  • With npm installed

    npm install typed-we-app --save-dev
  • With typings installed

    typings 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

About

TypeScript declaration file for WeApp API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published