@gerritcodereview/typescript-api

中文文档
3.14.0发布于 2026/05/16Apache-2.0零依赖近 30 天下载 34.9万

Gerrit Code Review - TypeScript API

原始使用文档

Gerrit TypeScript Plugin API

This package contains the types for developing browser plugins for the Gerrit Code Review web application. General documentation for plugin developers can be found at gerrit-review.googlesource.com.

The .ts files only contain types, interfaces and enums, and thus the compiled .js files only contain the enums. For JavaScript plugins this package is not really useful or necessary, but it also serves as the source of truth for what plugin APIs are actually supported.

Versioning of this API matches the MAJOR and MINOR versions of the general Gerrit releases, but the PATCH version is independent. When you are building a plugin for Gerrit x.y.z, then you should use the API package x.y.n, where n is the highest available patch version of the API. Patch versions will only contain additions and fixes, minor versions may include API removals.

All types in here should use the declare keyword to prevent bundlers from renaming fields, which would break communication across separately built bundles. enums are the exception, because their keys are not referenced across bundles, and values will not be renamed by bundlers as they are strings.

This API is also used by other apps embedding gr-diff and any breaking changes should be discussed with the Gerrit core team and properly versioned.

版本与发布记录

@gerritcodereview/typescript-api 共发布 16 个版本,首次发布于 2021/07/13;过去 12 个月发布了 1 个版本。

版本发布日期距今
3.14.0latest2026/05/166 个月前
3.13.02025/11/111 年前
3.12.02025/05/201.5 年前
3.11.02024/12/032 年前
3.10.02024/05/182 年前
3.9.12023/12/072 年前

关于 @gerritcodereview/typescript-api 的常见问题

@gerritcodereview/typescript-api 是什么?

Gerrit Code Review - TypeScript API

如何安装 @gerritcodereview/typescript-api?

在项目目录运行 npm install @gerritcodereview/typescript-api,或使用 pnpm add / yarn add / bun add。

@gerritcodereview/typescript-api 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/gerritcodereview__typescript-api 是否存在。

@gerritcodereview/typescript-api 可以商用吗?

@gerritcodereview/typescript-api 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@gerritcodereview/typescript-api 的下载量有多少?

根据 npm 官方下载统计,@gerritcodereview/typescript-api 在 2026/10/16 – 2026/11/14 这 30 天内被下载 348,534 次,日均约 11,618 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gerritcodereview/typescript-api 还在维护吗?

最新版本 3.14.0 发布于 2026/05/16(6 个月前);至今共发布 16 个版本,其中过去 12 个月发布了 1 个;首次发布于 2021/07/13。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。