Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
f05af85
fix(api): fix some api type mistake
SgLy Jan 8, 2020
6113474
feat(baselib): definition for 2.10.1 and bug fix
SgLy Jan 19, 2020
36613f9
feat(page): 暴露 page 的 options
baranwang Feb 1, 2020
693d4ef
Merge pull request #101 from baranwang
SgLy Feb 10, 2020
abb25c0
fix: minor fixes, see below
SgLy Feb 10, 2020
f9af0f8
feat(baselib): definition for 2.10.2
SgLy Mar 6, 2020
94a01f9
feat(api): support api promisify in 2.10.2
SgLy Mar 18, 2020
4f12387
feat(baselib): definition for 2.10.3
SgLy Mar 26, 2020
806f66c
fix(component): getOpenerEventChannel
baranwang Mar 31, 2020
6cff144
Merge pull request #112 from baranwang/patch-1
SgLy Mar 31, 2020
dad454b
test: add openerEventChannel test
SgLy Mar 31, 2020
0e9121a
refactor: remove redundant defs
SgLy Mar 31, 2020
371dda6
feat(event): definition for event
mlzzen Apr 2, 2020
21e87e5
feat(event): import event
mlzzen Apr 2, 2020
0029275
Merge pull request #115 from zenml/master
SgLy Apr 3, 2020
f3d700b
feat: update cloud api
SgLy Apr 3, 2020
9ba99c2
Merge branch 'master' of https://github.com/wechat-miniprogram/api-ty…
SgLy Apr 3, 2020
9f70f56
chore: publish 2.10.3-1
SgLy Apr 3, 2020
cfe8a0c
fix(animation): fix animation.export() return types
Garfield550 Apr 18, 2020
207a536
feat(baselib): definition for 2.10.4
SgLy Apr 20, 2020
348b171
feat(baselib): definition for 2.11.0
SgLy May 21, 2020
1ae404c
fix: several bugs, see changelog for detail
SgLy Jun 15, 2020
3c473cb
2.11.0-1
wechat-miniprogram-admin Jul 15, 2020
1ee86dc
2.11.2-beta
wechat-miniprogram-admin Jul 15, 2020
33cf08f
2.11.2-beta
wechat-miniprogram-admin Jul 15, 2020
a00b89c
2.11.3-beta
wechat-miniprogram-admin Jul 17, 2020
41cfcde
2.11.3-beta
wechat-miniprogram-admin Jul 24, 2020
bdf14e9
2.12.0
wechat-miniprogram-admin Jul 28, 2020
97bd643
2.12.0
wechat-miniprogram-admin Jul 28, 2020
a36e18e
2.12.0
wechat-miniprogram-admin Jul 29, 2020
adb7d69
feat: bump version to 3.0.0
SgLy Jul 30, 2020
d7161a2
feat: update api tp baselib
SgLy Aug 3, 2020
89af833
fix: animate api issue
Mister-Hope Aug 17, 2020
37ac873
Merge pull request #145 from Mister-Hope/animate-fix
wechat-miniprogram-admin Aug 19, 2020
d35941e
Merge pull request #124 from Garfield550/master
wechat-miniprogram-admin Aug 19, 2020
cc0d4df
feat: regular bug fix and update
SgLy Aug 19, 2020
6be8dc9
feat: rebuild event type
Mister-Hope Aug 30, 2020
ca5df11
fix: RegionChange type issue
Mister-Hope Sep 3, 2020
ab11feb
feat: add onShareTimeline
Mister-Hope Sep 3, 2020
b70f3bd
fix: query is an Object
Mister-Hope Sep 3, 2020
b4bdf1a
Merge pull request #152 from Mister-Hope/page
SgLy Sep 17, 2020
14e9d7e
Merge pull request #151 from Mister-Hope/event
SgLy Sep 17, 2020
655e66f
docs: add contributors to readme
SgLy Sep 17, 2020
b24d8fc
style: format contributed code
Mister-Hope Sep 22, 2020
bcfbbad
style: migrate from tslint to eslint
SgLy Sep 22, 2020
0c0e86d
feat: update api to baselib 2.13.0
SgLy Sep 22, 2020
e930e54
doc: fix chinese in english readme
SgLy Sep 22, 2020
79ebe8b
refactor: nested namespace
SgLy Sep 24, 2020
07a400f
feat: support component as page
SgLy Sep 24, 2020
903ddd4
feat: update definition to baselib 2.13.1
SgLy Sep 30, 2020
61b6980
fix: type of query in ICustomTimelineContent
SgLy Oct 14, 2020
8f59fec
feat: update to baselib 2.13.2
SgLy Oct 28, 2020
6744f83
feat: update baselib
SgLy Oct 29, 2020
f704467
fix: requirePlugin && requireMiniProgram
SgLy Nov 4, 2020
c7fb54c
feat: update to baselib 2.14.0
SgLy Nov 13, 2020
43c0a22
feat: update baselib 2.14.1
SgLy Jan 8, 2021
0e75402
chore(deps): bump ini from 1.3.5 to 1.3.8
dependabot[bot] Jan 8, 2021
90e20af
docs: format markdown files and update links
Mister-Hope Jan 9, 2021
3894635
Merge pull request #179 from Mister-Hope/format-readme
SgLy Jan 11, 2021
6604bd2
ci: use github action
Mister-Hope Jan 12, 2021
d3b6436
style: use 4 tabs to pass the new linter
Mister-Hope Jan 12, 2021
8e89191
Merge pull request #172 from wechat-miniprogram/dependabot/npm_and_ya…
SgLy Jan 12, 2021
384b8d6
Merge pull request #182 from Mister-Hope/github-action
SgLy Jan 12, 2021
44c1fdb
fix: several promisified api
SgLy Jan 14, 2021
005756b
feat(component): add export function to other options
chs97 Jan 22, 2021
9bdcf28
Merge pull request #187 from chs97/types/components
SgLy Jan 22, 2021
5b107de
feat: update to 2.15.0 and bug fixes
SgLy Feb 22, 2021
0e72ac7
Merge branch 'master' of http://github.com/wechat-miniprogram/api-typ…
SgLy Feb 22, 2021
8dbf0fa
feat: update to 3.3.0
SgLy Mar 3, 2021
e3246bc
feat: update to baselib 2.16.0
SgLy Apr 9, 2021
15ac1fc
feat: update to baselib 2.16.1
SgLy Apr 21, 2021
a534f96
feat: update to baselib 2.18.0
SgLy Jul 2, 2021
151fb80
feat: add some test cases from doc
SgLy Jul 2, 2021
2222854
chore: update packages
SgLy Jul 2, 2021
95861ee
docs: update github actions badge
SgLy Jul 2, 2021
e966032
docs: add contributor
SgLy Jul 7, 2021
7590cd1
fix: #204 and #202
SgLy Jul 7, 2021
7595236
test: add a component type test
SgLy Jul 7, 2021
6177876
3.4.0
SgLy Jul 7, 2021
f810ac8
chore: add .npmrc
SgLy Jul 7, 2021
efde0cd
fix: remove unexpected char
SgLy Jul 7, 2021
6b07cf1
chore: bump to npm 3.4.1
SgLy Jul 7, 2021
08f64e6
chore: remove beta tag
SgLy Jul 7, 2021
eebdc03
feat: update baselib defs to 2.19.0
SgLy Aug 2, 2021
cba3766
refactor: improve comments
SgLy Aug 2, 2021
d8269ee
feat: update baselib defs to 2.19.2
SgLy Aug 24, 2021
dd6b9d3
feat: update baselib defs to 2.20.1
SgLy Oct 29, 2021
5dab2fb
feat: update baselib defs to 2.21.3
SgLy Jan 20, 2022
08f9ff4
feat: update baselib defs to 2.23.2
TtTRz Apr 1, 2022
36f991f
3.4.6
TtTRz Apr 1, 2022
006bfe2
fix: type fix
TtTRz Apr 2, 2022
aa73e6b
fix: hideToast optional args
TtTRz Apr 6, 2022
1cc8ccb
feat: update baselib defs to 2.24.6
SgLy Jun 24, 2022
0080a92
fix(page): Autocomplete IShareOption 'from' field
xieyhn Aug 1, 2022
13c21b7
feat: update version of tsd
SgLy Sep 9, 2022
b9c51b7
feat: update baselib defs to 2.26.0
SgLy Sep 9, 2022
5625675
fix(page): normalize IShareOption 'from' field
xieyhn Sep 14, 2022
37f4065
chore(ButtonGetPhoneNumber): improve types
okxiaoliang4 Nov 9, 2022
746ae44
feat: bump dependencies version
SgLy Dec 13, 2022
70f2dbd
feat: update baselib defs to 2.28.0
SgLy Dec 13, 2022
78986d1
feat: bump npm package version
SgLy Dec 13, 2022
507bdc7
feat: add missing scene-list (#269)
SgLy Dec 13, 2022
55344e1
feat: support xr-frame
SgLy Dec 13, 2022
9ab0c8b
Merge pull request #267 from okxiaoliang4/master
SgLy Dec 13, 2022
b60cb4b
Merge pull request #259 from haiya6/master
SgLy Dec 13, 2022
9abb5c0
feat: bump npm package version
SgLy Dec 13, 2022
36eb6a2
调整安装命令顺序
Megasu Dec 28, 2022
c4f4e7e
feat: update baselib defs to 2.29.1
SgLy Jan 12, 2023
daaffe5
style: fix
SgLy Apr 10, 2023
739a95c
feat: update baselib defs to 2.30.4
SgLy Apr 10, 2023
32e9a91
Update CHANGELOG.md
Megasu May 4, 2023
8367d7c
Merge pull request #287 from Megasu/patch-4
SgLy May 5, 2023
c0f01bb
Merge pull request #274 from Megasu/patch-1
SgLy May 5, 2023
f2fafa1
docs: update readme
SgLy May 5, 2023
82d28b6
feat: update to v2.32.2 & add canvas rendering context typings. close…
Tidyzq Jun 9, 2023
9136ba4
Merge pull request #292 from wechat-miniprogram/v2.32.2
SgLy Jun 9, 2023
c6e2285
chore: update npm version
SgLy Jun 9, 2023
a56354e
test: add test case for offscreenCanvas
SgLy Jun 9, 2023
9f9da24
feat: update to v3.0.0 and add WXWebAssembly
SgLy Aug 4, 2023
f7ab924
3.11.0
SgLy Aug 4, 2023
3076f88
docs: update date typo in CHANGELOG
SgLy Aug 4, 2023
3e2f8fb
feat: update baselib defs to 3.0.1
SgLy Aug 24, 2023
754672c
3.11.1
SgLy Aug 24, 2023
7c22bf6
fix: remove unintended invisible characters
SgLy Aug 24, 2023
7da83ca
fix: typing of referrerInfo in App#onShow and query in LaunchOptions
SgLy Aug 24, 2023
c20a945
3.12.0
SgLy Aug 24, 2023
fe39ffd
feat: bump lock by npm audit fix
SgLy Aug 24, 2023
a20a689
feat: update baselib defs to 3.1.2
SgLy Oct 17, 2023
5363e95
3.12.1
SgLy Oct 17, 2023
89ae58a
feat: update baselib defs to 3.2.3
SgLy Dec 5, 2023
9f98eb4
3.12.2
SgLy Dec 5, 2023
89e7dfe
feat: add missing types
yangmingshan Jan 25, 2024
6191ce5
fix: format
yangmingshan Jan 25, 2024
4864c77
Merge pull request #317 from yangmingshan/missing
SgLy Jun 26, 2024
74d2597
feat: update baselib defs to 3.3.3
SgLy Aug 8, 2024
fa965f6
docs: add contributor
SgLy Aug 8, 2024
77f276f
feat: update baselib defs to 3.5.2
SgLy Aug 8, 2024
6a7f4f9
3.12.3
SgLy Aug 8, 2024
c54c382
feat: supports the issues/331 mentioned in points 2, 3, 4
lv-z-l Sep 2, 2024
78a21eb
feat: issues/331 2,3,4 test case
lv-z-l Sep 2, 2024
40e11c6
feat: support behaviors mentioned in issues/331 point 1
lv-z-l Sep 3, 2024
8a05832
feat: comments resolve
lv-z-l Sep 3, 2024
14bb344
Merge branch 'master' into behavior-ts-support
lv-z-l Sep 3, 2024
5b43e54
revert: TCustomInstanceProperty
lv-z-l Sep 3, 2024
b9aacb6
revert: TCustomInstanceProperty
lv-z-l Sep 3, 2024
3a100d0
Merge branch 'master' into behavior-ts-support
lv-z-l Sep 3, 2024
7002da6
chore: remove useless comments
lv-z-l Sep 3, 2024
0a76c78
Merge pull request #332 from lv-z-l/master
SgLy Sep 3, 2024
56d3e56
Merge branch 'wechat-miniprogram:master' into behavior-ts-support
lv-z-l Sep 3, 2024
f78974b
chore: remove unuse comments
lv-z-l Sep 3, 2024
3af2210
feat: 优化实现
lv-z-l Sep 4, 2024
5e6a22b
feat: optimize the implementation of behavior type inference
lv-z-l Sep 5, 2024
57d4c82
feat: pull/333 issuecomment-2333434425 support
lv-z-l Sep 9, 2024
e940cb8
chore: resolve conversation
lv-z-l Sep 12, 2024
6b8e1d3
Merge pull request #333 from lv-z-l/behavior-ts-support
SgLy Sep 13, 2024
22eb0fe
fix: behavior data、properties、methods 没有全部存在时访问为定义的属性不报错问题修复
lv-z-l Sep 19, 2024
535264e
feat: rename
lv-z-l Sep 20, 2024
b7e6fe5
revert: package.json
lv-z-l Sep 20, 2024
32d8f29
Merge pull request #334 from lv-z-l/master
SgLy Sep 24, 2024
70a4db9
docs: 4.0.0
SgLy Sep 24, 2024
5c2b157
4.0.0
SgLy Sep 24, 2024
83e59b6
feat: update baselib defs to 3.5.7
SgLy Sep 24, 2024
4e9e50d
4.0.1
SgLy Sep 24, 2024
cfd31b5
fix: add RaycastHit
SgLy Nov 13, 2024
14df520
4.0.2
SgLy Nov 13, 2024
11b17b4
feat: add missing instance methods
yangmingshan Dec 7, 2024
f971662
Merge pull request #339 from yangmingshan/missing
SgLy Dec 11, 2024
12a8004
fix: 类型补全Aggregate
agentdong Jan 6, 2025
863ab95
Merge pull request #341 from agentdong/fix-aggregateType
SgLy Jan 6, 2025
a4c8d08
feat: update baselib defs to 3.7.4
SgLy Jan 14, 2025
01a2539
feat: copyright 2025
SgLy Jan 14, 2025
41356d7
4.0.3
SgLy Jan 14, 2025
50e1b27
feat: settle security issue by npm audit fix
SgLy Jan 14, 2025
bb384cf
4.0.4
SgLy Jan 14, 2025
1a32a4f
fix: rest param type for setTimeout and setInterval (#323)
SgLy Feb 8, 2025
263b7fd
feat: update baselib defs to 3.7.7
SgLy Feb 8, 2025
7dc4302
4.0.5
SgLy Feb 8, 2025
9c691dd
feat: bump github actions version
SgLy Mar 17, 2025
9c251db
feat: add cloud extend interfaces
Cubelrti Mar 14, 2025
53deacf
fix(cloud): async iterators
Cubelrti Mar 14, 2025
be3883f
Merge pull request #345 from wechat-miniprogram/feat-cloud-extend
SgLy Mar 17, 2025
5d91aad
docs: typo
SgLy Apr 15, 2025
a807dbf
feat: update baselib defs to 3.8.0
SgLy Apr 18, 2025
08ee84c
4.0.6
SgLy Apr 18, 2025
2526678
Merge remote-tracking branch 'origin/master'
SgLy Apr 18, 2025
c0f2e30
feat: cloud extend changelog
SgLy Apr 18, 2025
443a5f5
4.0.7
SgLy Apr 18, 2025
8a4dc47
chore: switch to pnpm and bump dependency minor versions
SgLy Apr 24, 2025
3c28190
feat: 优化FilterUnknownType工具类
Jun 11, 2025
2176c76
fix: 将FilterUnknownType的实现修正为通过key过滤以确保TS能对未知类型正确抛出异常
busy-dog Jun 11, 2025
e289e93
feat: 添加 FilterUnknownType 的测试用例
Jun 12, 2025
7404116
feat: 将 FilterUnknownType 的测试用例迁移至 issue.test.ts
Jun 12, 2025
66649c0
docs: 将 FilterUnknownType 测试用例注释更新为pr地址
Jun 12, 2025
6a85798
Merge pull request #351 from busy-dog/feat/filter-unknown-type
SgLy Jun 12, 2025
3a44a32
feat: update baselib defs to 3.8.10
SgLy Jul 15, 2025
8b81912
4.0.8
SgLy Jul 15, 2025
335d8a2
fix: settle security issue
SgLy Jul 15, 2025
3d91e03
fix: getOpenerEventChannel may return an empty object
SgLy Jul 15, 2025
560a5a9
4.1.0
SgLy Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json'
},
plugins: [
'@typescript-eslint',
],
rules: {
indent: ['error', 4],
'no-trailing-spaces': ['error'],
semi: ['off'],
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/no-extra-semi': ['error'],
quotes: ['off'],
'@typescript-eslint/quotes': ['error', 'single'],
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/adjacent-overload-signatures': ['error'],
'@typescript-eslint/ban-types': ['error', {
extendDefaults: true,
types: {
/**
* we are using `{}` as noop
* e.g. `type A<P> = B & (P extends Q ? C : {})`
* will get `B & C` when `P extends Q` and `B` otherwise
*/
'{}': false,
/**
* we actually need a type accepting any function-like value
* e.g. `type Methods = Record<string, Function>`
*/
'Function': false,
}
}],
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'none',
requireLast: false,
},
singleline: {
delimiter: 'comma',
requireLast: false
}
}],
'@typescript-eslint/naming-convention': ['error', {
selector: 'enum',
format: ['PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
}, {
selector: 'typeLike',
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
}],
'@typescript-eslint/array-type': ['error', {
default: 'array-simple',
readonly: 'array-simple'
}],
'@typescript-eslint/no-unnecessary-qualifier': ['error'],
},
}
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run test
run: npm run test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

247 changes: 236 additions & 11 deletions CHANGELOG.md

Large diffs are not rendered by default.

45 changes: 34 additions & 11 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,64 @@

> [中文版本](./README.md)

[![Published on DefinitelyTyped](https://img.shields.io/npm/v/@types/wechat-miniprogram?label=%40types)](https://www.npmjs.com/package/@types/wechat-miniprogram)
[![Published on NPM](https://img.shields.io/npm/v/miniprogram-api-typings.svg?style=flat)](https://www.npmjs.com/package/miniprogram-api-typings)
[![MIT License](https://img.shields.io/github/license/wechat-miniprogram/api-typings.svg)](https://github.com/wechat-miniprogram/api-typings)
[![Travis CI Test Status](https://travis-ci.org/wechat-miniprogram/api-typings.svg?branch=master)](https://travis-ci.org/wechat-miniprogram/api-typings)
[![GitHub Actions Test Status](https://github.com/wechat-miniprogram/api-typings/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/wechat-miniprogram/api-typings/actions/workflows/test.yml)

Type definitions for APIs of Wechat Mini Program in TypeScript

## Install

Install by NPM:
### By standalone npm package

```bash
# install definitions for latest base library
npm install miniprogram-api-typings
```

or specify a base library version:
Manually import it after installed:

```bash
# install definitions for base library version 2.4.1
npm install [email protected]
```
- `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):

## Versions
- `/// <reference path="node_modules/miniprogram-api-typings/index.d.ts" />`

Check out all available versions corresponding to base library version in [VERSIONS.md](https://github.com/wechat-miniprogram/api-typings/blob/master/VERSIONS.md)
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/dev/index.html), therefore PRs including that file will __not__ be merged. If you found some APIs defined wrongly, create an issue instead.
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`.
Expand Down
46 changes: 35 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,64 @@

> [English version](./README-en.md)

[![已在 DefinitelyTyped 发布](https://img.shields.io/npm/v/@types/wechat-miniprogram?label=%40types)](https://www.npmjs.com/package/@types/wechat-miniprogram)
[![已在 NPM 发布](https://img.shields.io/npm/v/miniprogram-api-typings.svg?style=flat)](https://www.npmjs.com/package/miniprogram-api-typings)
[![MIT 协议](https://img.shields.io/github/license/wechat-miniprogram/api-typings.svg)](https://github.com/wechat-miniprogram/api-typings)
[![Travis CI 测试状况](https://travis-ci.org/wechat-miniprogram/api-typings.svg?branch=master)](https://travis-ci.org/wechat-miniprogram/api-typings)
[![GitHub Actions 测试状况](https://github.com/wechat-miniprogram/api-typings/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/wechat-miniprogram/api-typings/actions/workflows/test.yml)

微信小程序 API 的 TypeScript 类型定义文件

## 安装

通过 npm 安装:
### 通过独立 npm 包

```bash
# 安装对应最新基础库的定义文件
npm install miniprogram-api-typings
```

或者通过版本号指定一个基础库版本:
```bash
# 安装对应基础库版本 2.4.1 的定义文件
npm install [email protected]
```
安装后手动导入:

- `import 'miniprogram-api-typings';`

或者在 ts 配置中指定:

- 在 `tsconfig.json` 中指定 `types: ["miniprogram-api-typings"]`

## 版本
或者通过 [三斜杠指令](https://www.tslang.cn/docs/handbook/triple-slash-directives.html) 引用:

所有可用的版本和对应的基础库版本,参考 [VERSIONS.md](https://github.com/wechat-miniprogram/api-typings/blob/master/VERSIONS.md)
- `/// <reference path="node_modules/miniprogram-api-typings/index.d.ts" />`

或:

### 通过 DefinitelyTyped

```bash
npm install @types/wechat-miniprogram
```

## 更新日志

参考 [CHANGELOG.md](https://github.com/wechat-miniprogram/api-typings/blob/master/CHANGELOG.md)

## 贡献

API 的定义文件(`lib.wx.api.d.ts`)是随 [文档](https://developers.weixin.qq.com/miniprogram/dev/index.html) 一起自动生成的,如果发现了 API 接口的定义错误,请提一个 issue 给我们,关于 API 的 PR 将 __不会__ 被接受。
API 的定义文件(`lib.wx.api.d.ts`)是随 [文档](https://developers.weixin.qq.com/miniprogram/dev/api/) 一起自动生成的,如果发现了 API 接口的定义错误,请提一个 issue 给我们,关于 API 的 PR 将 __不会__ 被接受。

如果有针对页面(`Page`)、自定义组件(`Component`)等接口的 bug 和建议,欢迎 PR 或提一个 issue 给我们。非常感谢!

### 贡献者

- [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)

### 测试

本定义文件使用 [`tsd`](https://github.com/SamVerschueren/tsd) 进行测试,所有的测试样例放在 `test` 目录下。
Expand Down
19 changes: 0 additions & 19 deletions VERSIONS.md

This file was deleted.

Loading