|
|
3 years ago | |
|---|---|---|
| .. | ||
| types | 3 years ago | |
| CHANGELOG.md | 3 years ago | |
| LICENSE | 3 years ago | |
| README-en.md | 3 years ago | |
| README.md | 3 years ago | |
| VERSIONS.md | 3 years ago | |
| index.d.ts | 3 years ago | |
| package.json | 3 years ago | |
| typings.json | 3 years ago | |
Type definitions for APIs of Wechat Mini Game in TypeScript
Install by NPM:
npm install minigame-api-typings
Manually import it after installed:
import 'minigame-api-typings';Or specify types in typescript config:
types: ["minigame-api-typings"] in tsconfig.jsonOr reference by Triple-Slash Directives:
/// <reference path="node_modules/minigame-api-typings/index.d.ts" />See CHANGELOG.md (Chinese only)
Definitions of Wechat APIs (lib.wx.api.d.ts) are auto-generated together with our documentations, therefore PRs including that file will not be merged. If you found some APIs defined wrongly, create an issue instead.
We use 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.