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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@maai-types/maai

v0.0.12

Published

TypeScript definitions for maai modules

Readme

@maai-types/maai

为Maai自定义服务端引擎提供的TypeScript类型定义,支持VSCode智能感知和自动完成。

特性

  • 完整的类型定义,覆盖Maai服务端核心API
  • 与VSCode深度集成,提供智能代码补全
  • 严格的类型检查,减少运行时错误
  • 轻量级,无运行时依赖

安装

npm install @maai/types --save-dev
# 或
yarn add @maai/types -D

使用

安装后,TypeScript会自动识别类型定义。在代码中导入Maai模块即可获得类型支持:

import webUtils from "@maai/utils/web";
import asserts from "@maai/utils/asserts";

const body = webUtils.getBody();
asserts.isNotBlank(body.name, "名称不能为空");

模块说明

本模块为maai项目提供完整的TypeScript类型定义,包含以下子模块:

  • biz: 业务相关类型定义
  • utils: 工具类类型定义

类型定义规范

  1. 文件命名:
  • 使用小写字母和连字符,如user-auth.d.ts
  • 接口类型使用大驼峰命名,如UserAuth
  1. 定义要求:
// 示例:定义业务接口
interface UserProfile {
  id: string;
  name: string;
  roles: string[];
}
  1. 导出规则:
  • 每个.d.ts文件应在index.d.ts中导出
  • 避免使用默认导出

开发流程

  1. 添加新定义:
# 在biz目录创建新定义文件
touch biz/new-feature.d.ts

# 更新index.d.ts导出
echo 'export * from "./new-feature";' >> index.d.ts
  1. 版本发布:
  • 修改package.json版本号
  • 提交git tag