https://github.com/wechat-miniprogram/api-typings
Type definitions for APIs of Wechat Mini Program in TypeScript
https://github.com/wechat-miniprogram/api-typings
Last synced: about 1 month ago
JSON representation
Type definitions for APIs of Wechat Mini Program in TypeScript
- Host: GitHub
- URL: https://github.com/wechat-miniprogram/api-typings
- Owner: wechat-miniprogram
- License: mit
- Created: 2018-11-19T13:16:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-24T10:20:08.000Z (2 months ago)
- Last Synced: 2025-04-24T11:28:44.313Z (2 months ago)
- Language: TypeScript
- Size: 1.82 MB
- Stars: 766
- Watchers: 15
- Forks: 113
- Open Issues: 70
-
Metadata Files:
- Readme: README-en.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- stars - wechat-miniprogram/api-typings
- awesome - wechat-miniprogram/api-typings - Type definitions for APIs of Wechat Mini Program in TypeScript (TypeScript)
README
# Wechat Mini Program API Typings
> [中文版本](./README.md)
[](https://www.npmjs.com/package/@types/wechat-miniprogram)
[](https://www.npmjs.com/package/miniprogram-api-typings)
[](https://github.com/wechat-miniprogram/api-typings)
[](https://github.com/wechat-miniprogram/api-typings/actions/workflows/test.yml)Type definitions for APIs of Wechat Mini Program in TypeScript
## Install
### By standalone npm package
```bash
npm install miniprogram-api-typings
```Manually import it after installed:
- `import 'miniprogram-api-typings';`
Or specify types in typescript config:
- Specify `types: ["miniprogram-api-typings"]` in `tsconfig.json`
Or reference by [Triple-Slash Directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html):
- `/// `
or:
### By DefinitelyTyped
```bash
npm install @types/wechat-miniprogram
```## Changelog
See [CHANGELOG.md](https://github.com/wechat-miniprogram/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/miniprogram/en/dev/api/), therefore PRs including that file will __not__ be merged. If you found some APIs defined wrongly, create an issue instead.
Both PR and issue are welcomed for definitions of pages (`Page`), custom components (`Component`) and other else, since they are written manually. Help us improve this definition if you have any bug reports or suggestions! Thanks for contributing!
### Contributors
- [Baran](https://github.com/baranwang)
- [MinLiang Zeng](https://github.com/zenml/)
- [Garfield Lee](https://github.com/Garfield550)
- [Mr.Hope](https://github.com/Mister-Hope)
- [chs97](https://github.com/chs97)
- [Jelf](https://github.com/okxiaoliang4)
- [xieyuhang](https://github.com/haiya6)
- [苏杰豪](https://github.com/Megasu)
- [Yang Mingshan](https://github.com/yangmingshan)
- [lvzl](https://github.com/lv-z-l)### 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.