RepositoryTypeScript
gjsify

gjsify/ts-for-gir

TypeScript type definition generator for GObject introspection interfaces

291stars
23forks
8issues
9views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: gobject

#1 Repository of the month

1
TINIX TRENDING·Topic: gjs

#1 Repository of the month

1
TINIX TRENDING·Topic: glib

#1 Repository of the month

TS for GIR

TypeScript type definition generator for GObject introspection GIR files

ts-for-gir generates accurate TypeScript definitions from GObject Introspection for GJS projects — strong typing, IDE jump-to-definition, autocompletion across the whole GNOME stack.

📖 Project page on the gjsify website: gjsify.github.io/gjsify/projects/ts-for-gir — install paths, quickstart, generator usage, links to the related Patterns docs.

Browse the full TypeScript API Documentation for GLib, GTK, GStreamer, and more.

Quick Start

gjsify dlx @ts-for-gir/cli create my-app   # no install, no Node.js
# or
npx @ts-for-gir/cli create my-app          # via npm

Pick a template interactively, or pass --template <id>:

TemplateBest for
types-gjsifyNode-free GJS app — all dev scripts (install, build, run, format) routed through gjsify
types-npmSingle-package, types from @girs/* NPM, esbuild + node
types-locallyGenerate types into ./@types/ (no @girs/* dep)
types-workspacenpm workspace with @girs/* as locally-generated workspace packages
cd my-app && npm start    # or `gjsify run start` for types-gjsify

Installation

GJS — no Node.js required

curl -fsSL https://raw.githubusercontent.com/gjsify/ts-for-gir/main/install.js -o /tmp/install.js
gjs -m /tmp/install.js && rm /tmp/install.js

Installs to ~/.local/bin/. Update later with ts-for-gir self-update. Powered by GJSify.

Alternative — if you already have the gjsify CLI installed: gjsify dlx @ts-for-gir/cli <args> (npx-style, no install) or gjsify install -g @ts-for-gir/cli (managed global).

Node.js

npx @ts-for-gir/cli --help
# or globally:
npm install -g @ts-for-gir/cli

CLI Usage

ts-for-gir generate Gtk-4.0                          # generate types for a single module
ts-for-gir generate Gtk-4.0 --reporter               # with diagnostics
ts-for-gir analyze -f ./ts-for-gir-report.json       # inspect the report
ts-for-gir --help                                    # all commands

See the CLI documentation for advanced options.

Pre-generated NPM Packages

If you just want the types without generating them yourself:

npm install @girs/gjs @girs/gtk-4.0
import "@girs/gjs";
import "@girs/gjs/dom";
import "@girs/gtk-4.0";

import Gtk from "gi://Gtk?version=4.0";

const button = new Gtk.Button();

All packages are listed at gjsify/types. Missing a module? Open an issue.

Showcase

GNOME Applications

GNOME Shell Extensions

Example Projects

Looking for a starting point? These example projects demonstrate how to use the TypeScript definitions with various bundlers:

More examples with screenshots and descriptions can be found in the Examples directory. For information on using the examples with different CLI options, refer to the CLI documentation.

Project Structure

ts-for-gir consists of several packages:

Submodules

This repo contains Git submodules for pre-generated types and documentation:

  • types-dev (branch dev) — used during local development. Scripts write generated packages here.
  • types-release (branch main) — updated by the release workflow on tags.
  • docs (branch main) — generated HTML documentation, deployed to gjsify.github.io/docs.

Useful scripts:

gjsify run build:types          # regenerate into ./types-dev
gjsify run build:types:release  # regenerate into ./types-release
gjsify run build:doc            # build HTML docs into ./docs

Further Reading

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
gtk-rs/gir

Tool to generate rust bindings and user API for glib-based libraries

277
Nov 23, 2026
RepositoryJavaScript
gjsify/gnome-shell

GJS TypeScript type definitions for GNOME Shell Extensions

82
Nov 11, 2026
RepositoryCrystal
hugopl/gi-crystal

Tool to generate Crystal bindings for gobject-based libraries (i.e. GTK)

59
Nov 30, 2026
RepositoryTypeScript
microsoft/vscode

Visual Studio Code

195.9k
Nov 30, 2026
RepositoryTypeScript
DefinitelyTyped/DefinitelyTyped

The repository for high quality TypeScript type definitions.

51.5k
Nov 27, 2026
RepositoryTypeScript
n8n-io/n8n

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

213.0k
Dec 3, 2026
RepositoryCSS
vinceliuice/WhiteSur-gtk-theme

MacOS like theme for all gtk based desktops

9.5k
Sep 11, 2026
RepositoryJavaScript
johnfactotum/foliate

Read e-books in style

8.9k
Apr 8, 2026
RepositoryC#
hbons/SparkleShare

Share and collaborate by syncing with any Git repository instantly. Linux, macOS, and Windows

5.0k
Nov 15, 2026