dc-tencent-wx-jssdk
TypeScript icon, indicating that this package has built-in type declarations

1.6.0-2 • Public • Published

tencent-wx-jssdk

Weixin JS-SDK

This is lib not maintain anymore, please use [@types/jweixin](https://www.npmjs.com/package/@types/jweixin) instead.

SDK Version

1.3.2

Install

npm install tencent-wx-jssdk --save

How to Use

TypeScript

// sometime you want import this module, eg. use this with webpack
import { scanQRCode } from 'tencent-wx-jssdk';

scanQRCode({
	needResult: 0,
	scanType: ['qrCode'],
	success(res) {
		console.log(res);
	}
});

or, you could add this module in your tsconfig.json

{
	"compilerOptions": {
		"types": [
			"tencent-wx-jssdk"
		]
	}
}

then use it freely.

jWeixin.scanQRCode({
	needResult: 0,
	scanType: ['qrCode'],
	success(res) {
		console.log(res);
	}
});

// sometimes you must use WeixinJSBridge, like wexin paying
WeixinJSBridge.invoke("getBrandWCPayRequest", {}, (res) => {
});

javascript

You will need this only if you would like get your project packed.

const wx = require('tencent-wx-jssdk');
wx.scanQRCode({
	needResult: 0,
	scanType: ['qrCode'],
	success(res) {
		console.log(res);
	}
});

Others

ts Error

If you get this Error: [ts] Initializers are not allowed in ambient contexts.

Try add "skipLibCheck": true to compilerOptions in file tsconfig.json.

Good luck!

Package Sidebar

Install

npm i dc-tencent-wx-jssdk

Weekly Downloads

1

Version

1.6.0-2

License

MIT

Unpacked Size

63 kB

Total Files

10

Last publish

Collaborators

  • denglian1008