@girs/gda-6.0

中文文档
5.6.0发布于 2026/10/28MITTypeScriptES Module构建来源已验证近 30 天下载 1.3万

GJS TypeScript type definitions for Gda-6.0

原始使用文档
文档目录9 节
  1. Install
  2. What it exports
  3. Three ways to import
  4. As a module
  5. As gi://
  6. As imports.gi
  7. Widget vocabulary
  8. Building
  9. Other packages

Gda-6.0

version downloads/week

GJS TypeScript type definitions for Gda-6.0 using ts-for-gir v5.6.0.

This package contains type declarations only. It ships no runtime code, so it adds nothing to your program and works with any bundler or none at all.

Install

npm install @girs/gda-6.0

Any package manager works. The package has no dependencies beyond other @girs/* type packages.

What it exports

ImportWhat you get
@girs/gda-6.0the namespace as a default export, plus the ambient and global declarations
@girs/gda-6.0/ambientonly the gi:// module declarations
@girs/gda-6.0/importonly the imports.gi declarations
@girs/gda-6.0/gda-6.0the namespace, without the side-effecting declarations
@girs/gda-6.0/vocabularyGIR-derived widget data: settable properties, enum nicks, slot candidates

Three ways to import

Which one you use depends on how you write imports elsewhere, not on your toolchain.

As a module

import Gda from '@girs/gda-6.0';

As gi://

GJS resolves gi:// at runtime. To give it types, reference the package once, either from your entry point or from tsconfig.json:

import '@girs/gda-6.0';
{ "include": ["@girs/gda-6.0"] }

Then the runtime spelling type-checks:

import Gda from 'gi://Gda?version=6.0';

Referencing @girs/gda-6.0/ambient instead pulls in these declarations alone. See ambient modules.

As imports.gi

GJS's global object works the same way, via @girs/gda-6.0/import:

const Gda = imports.gi.Gda;

Widget vocabulary

gda-6.0 declares widgets, so it also carries what the GIR says about them, as types and as values a test can read:

import type { Widgets, PropsOf } from '@girs/gda-6.0/vocabulary';
import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/gda-6.0/vocabulary';

Properties are keyed the way GObject registered them, writable-only and optional, so they match g_object_set, GtkBuilder XML and Blueprint. PROVENANCE.libraryVersion names the library release this was generated from, which lets a check tell "newer than what is installed" from "wrong".

This subpath answers what the GIR says, not what the installed library has. For the second question, ask the library.

Building

The declarations need no build step. If you bundle, every bundler works, since there is no runtime code to resolve. The examples show working setups for several.

Other packages

Every pre-generated package is at gjsify/types.

版本与发布记录

@girs/gda-6.0 共发布 95 个版本,首次发布于 2023/03/24;过去 12 个月发布了 44 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.6.0latest2026/10/2819 天前
5.5.02026/10/021 个月前
5.4.02026/09/211 个月前
5.3.02026/09/191 个月前
5.2.02026/09/152 个月前
5.1.02026/09/152 个月前

其他发布通道:next → 6.0.0-4.0.0-beta.5。

关于 @girs/gda-6.0 的常见问题

@girs/gda-6.0 是什么?

GJS TypeScript type definitions for Gda-6.0

如何安装 @girs/gda-6.0?

在项目目录运行 npm install @girs/gda-6.0,或使用 pnpm add / yarn add / bun add。

@girs/gda-6.0 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@girs/gda-6.0 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@girs/gda-6.0 可以商用吗?

@girs/gda-6.0 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@girs/gda-6.0 的下载量有多少?

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

@girs/gda-6.0 还在维护吗?

最新版本 5.6.0 发布于 2026/10/28(19 天前);至今共发布 95 个版本,其中过去 12 个月发布了 44 个;首次发布于 2023/03/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。