Giter Site home page Giter Site logo

wechat-miniprogram / minigame-api-typings Goto Github PK

View Code? Open in Web Editor NEW
115.0 11.0 24.0 1.29 MB

Type definitions for APIs of Wechat Mini Game in TypeScript

Home Page: https://developers.weixin.qq.com/minigame/dev/guide/

License: MIT License

TypeScript 96.05% JavaScript 3.95%

minigame-api-typings's Introduction

微信小游戏定义文件

English version

已在 NPM 发布 MIT 协议 GitHub Actions 测试状况

微信小游戏 API 的 TypeScript 类型定义文件

安装

npm install minigame-api-typings

安装后手动导入:

  • import 'minigame-api-typings';

或者在 ts 配置中指定:

  • tsconfig.json 中指定 types: ["minigame-api-typings"]

或者通过 三斜杠指令 引用:

  • /// <reference path="node_modules/minigame-api-typings/index.d.ts" />

更新日志

参考 CHANGELOG.md

贡献

API 的定义文件(lib.wx.api.d.ts)是随 文档 一起自动生成的,如果发现了 API 接口的定义错误,请提一个 issue 给我们,关于 API 的 PR 将 不会 被接受。

测试

本定义文件使用 tsd 进行测试,所有的测试样例放在 test 目录下。

想执行测试的话,克隆本项目并完成 npm install --save-dev 后执行 npm test 即可。

如果您发现了不能通过自动化测试的测试样例,可以提交 PR 或者提一个 issue。当然,能通过自动化测试的强有力的测试样例也是欢迎的。

minigame-api-typings's People

Contributors

dependabot[bot] avatar sgly avatar wechat-miniprogram-admin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minigame-api-typings's Issues

ERROR:类型定义将原生类型覆盖

类型定义当中无法找到数组的map方法
image
一些基础类型诸如 Number Date Array Symbol 等类型的原型方法全被微信小程序的命名空间覆盖掉了

ReconnectOption.accessInfo类型错了

interface ReconnectOption {
/** 需要重连的对局房间唯一标识 /
accessInfo: number应该是accessInfo: string
/
* 接口调用结束的回调函数(调用成功、失败都会执行) /
complete?: ReconnectCompleteCallback
/
* 接口调用失败的回调函数 /
fail?: ReconnectFailCallback
/
* 接口调用成功的回调函数 */
success?: ReconnectSuccessCallback
}

interface LoadSubpackageOption参数 name类型错误,应该是string

interface LoadSubpackageOption {
/** 分包加载结束回调事件(加载成功、失败都会执行) /
complete: Function;
/
* 分包加载失败回调事件 /
fail: Function;
/
* 分包的名字,可以填 name 或者 root /
name: Function;
/
* 分包加载成功回调事件 */
success: Function;
}

导出命名空间

这样使其能导入某个模块 因为命名空间无法被构建工具感知 从而编译出.d.ts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.