typed-jweixin

1.2.0-update.2 • Public • Published

typed-jweixin

TypeScript declaration file for Wexin JSSDK

NPM

PR Welcome npm type definitions

About

Install

  • With npm installed

    $ npm install typed-jweixin --save-dev
  • With typings installed

    $ typings install github:Emeryao/typed-jweixin -SG
  • Or find the declaration file and include it to your project

  • Then start coding with the power of IntelliSense of VS Code

Sample Code

  • Config

    let configData: Wechat.ConfigData = {};
    configData.appId = 'appid';
    configData.nonceStr = 'nonceStr';
    configData.signature = 'signature';
    configData.timestamp = 1234567;
    wx.config(configData);
  • Share Timeline

    let shareData: Wechat.ShareData = {};
    shareData.imgUrl = 'imgUrl';
    shareData.link = 'link';
    shareData.title = 'title';
    shareData.success = () => {
        console.log('share successed');
    };
    shareData.cancel = () => {
        console.log('cancelled');
    }
    wx.onMenuShareTimeline(shareData);
  • for Angular
    projects created with ng new have a ./src/tsconfig.app.json with default content

    {
        "extends": "../tsconfig.json",
        "compilerOptions": {
            "outDir": "../out-tsc/app",
            "types": []
        },
        "exclude": []
    }

    the line of "types":[] should be removed to make the declaration file work

Contributors

Thanks for your contributions

@Emeryao
@neoblackcap

Last Update

2018.08.30

Package Sidebar

Install

npm i typed-jweixin

Weekly Downloads

3

Version

1.2.0-update.2

License

MIT

Unpacked Size

25.1 kB

Total Files

6

Last publish

Collaborators

  • emeryao