https://github.com/wechat-miniprogram/minigame-api-typings
Type definitions for APIs of Wechat Mini Game in TypeScript
https://github.com/wechat-miniprogram/minigame-api-typings
Last synced: about 2 months ago
JSON representation
Type definitions for APIs of Wechat Mini Game in TypeScript
- Host: GitHub
- URL: https://github.com/wechat-miniprogram/minigame-api-typings
- Owner: wechat-miniprogram
- License: mit
- Created: 2019-04-16T12:46:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-14T13:30:16.000Z (3 months ago)
- Last Synced: 2025-05-15T10:41:20.405Z (about 2 months ago)
- Language: TypeScript
- Homepage: https://developers.weixin.qq.com/minigame/dev/guide/
- Size: 1.85 MB
- Stars: 148
- Watchers: 11
- Forks: 27
- Open Issues: 12
-
Metadata Files:
- Readme: README-en.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Wechat MiniGame API Typings
> [中文版本](./README.md)
[](https://www.npmjs.com/package/minigame-api-typings)
[](https://github.com/wechat-miniprogram/minigame-api-typings)
[](https://github.com/wechat-miniprogram/minigame-api-typings/actions/workflows/test.yml)Type definitions for APIs of Wechat Mini Game in TypeScript
## Install
Install by NPM:
```bash
npm install minigame-api-typings
```
Manually import it after installed:
- `import 'minigame-api-typings';`Or specify types in typescript config:
- Specify `types: ["minigame-api-typings"]` in `tsconfig.json`Or reference by [Triple-Slash Directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html):
- `/// `## Changelog
See [CHANGELOG.md](https://github.com/wechat-miniprogram/minigame-api-typings/blob/master/CHANGELOG.md) (Chinese only)
## Contribution
Definitions of Wechat APIs (`lib.wx.api.d.ts`) are auto-generated together with our [documentations](https://developers.weixin.qq.com/minigame/en/dev/api/), therefore PRs including that file will __not__ be merged. If you found some APIs defined wrongly, create an issue instead.
### Automated tests
We use [`tsd`](https://github.com/SamVerschueren/tsd) to check if this definition is working properly. All test cases are under folder `test`.
To perform an automated test, clone this repo, `npm install --save-dev` and `npm test`.
If you have test case that fails the test, an issue or PR will be great. Strong test case that passes are also welcomed.