npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dragongate/miniprogram-api-typings

v2.8.3

Published

Type definitions for APIs of Wechat Mini Program in TypeScript

Downloads

96

Readme

微信小程序定义文件-改

为了更完善的进行自动类型推断,推荐使用最新版TypeScript ( >= 3.4)

扩展完善

  • [x] event 相关类型声明
  • [x] console 类型定义(去除dom依赖)
  • [x] wxs 类型定义
  • [x] requirePlugin
  • App
    • [x] app 事件参数自动推断
  • Page
    • [x] this.setData() 无需感叹号,强类型验证
    • [x] this.route 无感叹号
    • [x] 补充 this.options
    • [x] 补充 this.getTabBar() 支持 (含类型安全检查、泛型参数)
    • [x] Page.onLoad 支持undefined
    • [x] Page.onLoad / onPageScroll / onResize 等参数自动绑定
  • Component
    • [x] properties 完整定义支持和类型绑定
    • [x] data 绑定 properties 数据
    • [x] observer/observers this 绑定(支持data/properties/methods调用)
    • [x] lifetimes/pageLifetimes/relations/methods 完整this绑定(支持data/properties/methods调用)
    • [x] setData 强类型校验和自动提示
    • [x] this.getTabBar() 支持类型安全检查、泛型参数
  • Behavior (beta) Fixed 修复官方的错误定义
  • [x] fix wx.AuthSetting 类型错误
  • [x] fix chooseimage
  • [x] fix choosefile
  • [x] fix component 定义
  • [x] fix page 定义错误
  • [x] fix wx.OnStopCallbackResult (RecorderManager)
  • [x] fix wx.Color 定义错误
  • [x] fix 支持 canvasContext.setFillStyle() 传入 wx.CanvasGradient 类型
  • [x] fix canvasContext.drawImage() 可选 3/5/9 个参数
  • [x] fix canvasContext setTextAlign / setTextBaseline 约束
  • [x] fix relativeToViewport()
  • [x] fix setTimeout/setInterval rest 参数
  • [x] fix innerAudio onerror/offerror callback

English version

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

安装

通过 npm 安装:

# 安装对应最新基础库的定义文件
npm install @dragongate/miniprogram-api-typings -D

或者通过版本号指定一个基础库版本:

# 安装对应基础库版本 2.4.1 的定义文件
npm install @dragongate/miniprogram-api-typings@version -D

版本

基础库版本|npm 版本|命令 -|-|- v2.6.5 | 2.6.5-2 | npm install [email protected] v2.4.2|2.4.2-2|npm install [email protected] v2.4.1|2.4.1|npm install [email protected] v2.4.0|2.4.0-1|npm install [email protected]

贡献

PR Welcomed!

Supported by Microsoft.