Skip to content

Commit 8dfd396

Browse files
author
sanfordsun
committed
init mini game api typings
1 parent b4e152e commit 8dfd396

9 files changed

+7354
-2
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019
3+
Copyright (c) 2018
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README-en.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Wechat MiniGame API Typings
2+
3+
> [中文版本](./README.md)
4+
5+
[![](https://img.shields.io/npm/v/minigame-api-typings.svg?style=flat)](https://www.npmjs.com/package/minigame-api-typings)
6+
[![](https://img.shields.io/github/license/wechat-miniprogram/minigame-api-typings.svg)](https://github.com/wechat-miniprogram/minigame-api-typings)
7+
8+
Type definitions for APIs of Wechat Mini Game in TypeScript
9+
10+
## Install
11+
12+
Install by NPM:
13+
```bash
14+
# install definitions for latest base library
15+
npm install minigame-api-typings
16+
```
17+
18+
or specify a base library version:
19+
20+
```bash
21+
# install definitions for base library version 2.4.1
22+
npm install [email protected]
23+
```
24+
25+
## Versions
26+
27+
Base Library version|npm version|command
28+
-|-|-
29+
[v2.6.5](https://developers.weixin.qq.com/miniprogram/dev/framework/release.html#v265-20190402) | [2.6.5](https://www.npmjs.com/package/minigame-api-typings/v/2.6.5) | `npm install [email protected]`
30+
31+
32+
## Contribution
33+
34+
Since definitions are auto-generated together with [documentations](https://developers.weixin.qq.com/miniprogram/dev/index.html), all PRs will __not__ be merged. If you have any bug reports or suggestions, create an issue instead. Thanks for contributing!

README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1-
# minigame-api-typings
1+
# 微信小游戏定义文件
2+
3+
> [English version](./README-en.md)
4+
5+
[![](https://img.shields.io/npm/v/minigame-api-typings.svg?style=flat)](https://www.npmjs.com/package/minigame-api-typings)
6+
[![](https://img.shields.io/github/license/wechat-miniprogram/minigame-api-typings.svg)](https://github.com/wechat-miniprogram/minigame-api-typings)
7+
8+
微信小游戏 API 的 TypeScript 类型定义文件
9+
10+
## 安装
11+
12+
通过 npm 安装:
13+
```bash
14+
# 安装对应最新基础库的定义文件
15+
npm install minigame-api-typings
16+
```
17+
18+
或者通过版本号指定一个基础库版本:
19+
```bash
20+
# 安装对应基础库版本 2.4.1 的定义文件
21+
npm install [email protected]
22+
```
23+
24+
## 版本
25+
26+
基础库版本|npm 版本|命令
27+
-|-|-
28+
[v2.6.5](https://developers.weixin.qq.com/miniprogram/dev/framework/release.html#v265-20190402) | [2.6.5](https://www.npmjs.com/package/minigame-api-typings/v/2.6.5) | `npm install [email protected]`
29+
30+
31+
## 贡献
32+
33+
定义文件是随 [文档](https://developers.weixin.qq.com/miniprogram/dev/index.html) 一起自动生成的,所以所有的 PR 都将 __不会__ 被接受。如果您有 bug 反馈或建议,请提一个 issue 给我们。非常感谢!

index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="./types/index.d.ts" />

package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "minigame-api-typings",
3+
"version": "2.6.5",
4+
"description": "Type definitions for APIs of Wechat MiniGame in TypeScript",
5+
"main": "./index.d.ts",
6+
"types": "./index.d.ts",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/wechat-miniprogram/minigame-api-typings.git"
13+
},
14+
"author": "wechat-miniprogram",
15+
"license": "MIT",
16+
"bugs": {
17+
"url": "https://github.com/wechat-miniprogram/minigame-api-typings/issues"
18+
},
19+
"homepage": "https://github.com/wechat-miniprogram/minigame-api-typings#readme"
20+
}

types/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="./wx/index.d.ts" />

types/wx/index.d.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*! *****************************************************************************
2+
Copyright (c) 2018 Tencent, Inc. All rights reserved.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9+
***************************************************************************** */
10+
11+
/// <reference path="./lib.wx.gameapi.d.ts" />
12+
13+
declare type IAnyObject = Record<string, any>;
14+
15+
declare type KVInfer<T> = { [K in keyof T]: T[K] };
16+
17+
declare type Void<T> = T | undefined | null;
18+
type PartialOptional<T, K extends keyof T> = Partial<Pick<T, K>> &
19+
Pick<T, Exclude<keyof T, K>>;

0 commit comments

Comments
 (0)