GitXplorerGitXplorer
w

jweixin-esm

public
12 stars
3 forks
1 issues

Commits

List of commits on branch main.
Verified
36295e58feb8d14afb825e1e36a4dbdf5f37a8c8

Merge pull request #36 from wtto00/dependabot/npm_and_yarn/typescript-5.6.3

wwtto00 committed 3 months ago
Verified
e2d8d2eaba16869db291fa26eb5e798daa4eb76b

chore(deps-dev): bump typescript from 5.6.2 to 5.6.3

ddependabot[bot] committed 3 months ago
Verified
262e2e1f32dd4f21e008f8f2b229448e50b872eb

Merge pull request #35 from wtto00/dependabot/npm_and_yarn/typescript-5.6.2

wwtto00 committed 4 months ago
Verified
c053525120fd3338d4431d05c8d98e63586c4320

chore(deps-dev): bump typescript from 5.5.4 to 5.6.2

ddependabot[bot] committed 4 months ago
Verified
d02761cf38132f7df97ebd9bfb473ff93977a697

Merge pull request #34 from wtto00/dependabot/npm_and_yarn/typescript-5.5.4

wwtto00 committed 5 months ago
Verified
5a3c19baba94c82da2eae01634b6da7ce98529d7

chore(deps-dev): bump typescript from 5.5.3 to 5.5.4

ddependabot[bot] committed 6 months ago

README

The README file for this repository.

jweixin-esm

微信 JSSDK, ESM 模块, 附带 TS 类型以及详细注释

jweixin:1.6.0 DOCUMENT
NPM GitHub Package TypeScript:SUPPORT
PR:WELCOME ISSUE:WELCOME

About

基于微信官方的 JSSDK jweixin-1.6.0.js 改造的 ESM 模块,支持 TypeScript 类型,并且附带完整的注释文档微信官方文档

Installation

pnpm add @wtto00/jweixin-esm
# npm i @wtto00/jweixin-esm
# yarn add @wtto00/jweixin-esm

Usage

import weixin from '@wtto00/jweixin-esm'
// or:
// import '@wtto00/jweixin-esm'

// weixin的类型是WX,已全局声明

console.log(weixin) // 导入的名称
console.log(window.wx) // wx已挂载全局window
console.log(window.jWeixin) // jWeixin已挂载全局window

// 这里 weixin=window.wx=window.jWeixin

// 所有的类型全部在WX中,可以直接使用,不用额外导入或配置。已全局声明。

const configData: WX.ConfigOptions = {
  debug: true,
  appId: '',
  timestamp: '',
  nonceStr: '',
  signature: '',
  jsApiList: [], // WX.JsApi[]
  openTagList: [] // WX.OpenTag[]
}
weixin.config(configData)

Note

使用过程中有任何问题,请提 ISSUE。也非常欢迎所有的 PR。

有一些接口我只是看官方文档写的类型定义,并没有全部测试过,所以可能是会有错误的。如果发现了错误,麻烦提个 ISSUE,非常感谢。