Description
ts-for-gir is a TypeScript type definition generator for GObject Introspection interfaces. It reads GObject Introspection data from GIR files and writes TypeScript definitions for GJS projects, so your editor knows the GNOME stack. You get jump to definition, autocompletion, and type errors, for example when you pass the wrong argument to g_object_set(). The README offers four project templates. types-gjsify is for a GJS app with no Node.js, types-npm is for a single package that uses @girs packages from npm with esbuild and Node, types-locally generates types into a local @types folder, and types-workspace sets up an npm workspace with locally generated @girs packages. Installation options include a GJS install that puts the binary in ~/.local/bin and can be updated with ts-for-gir self-update, a Node.js install, and running it without installing through gjsify dlx. Pre-generated npm packages for GNOME libraries are published under gjsify/types. The README also covers building a GNOME app that ships as a Flatpak, and links a project page and TypeScript API documentation for GLib, GTK and GStreamer. The project is on GitHub.…
Highlights
- Type definitions for GNOME libraries from GIR files
- Autocomplete and type errors in your editor
- Templates for GJS, npm, local and workspace setups
- Pre-generated @girs packages
- Install for GJS without Node.js
Ratings & Reviews
No ratings yet
Be the first to rate TS For Gir.
People also visit
TS For Gir FAQ
What does ts-for-gir do?
It generates TypeScript definitions from GObject Introspection data, so your editor understands GNOME libraries.
Do I need Node.js?
No. The README describes a GJS install that does not need Node.js. It installs to ~/.local/bin.
Which template should I use?
types-gjsify for a GJS app with no Node.js, types-npm for a single package using @girs packages, types-locally for a local @types folder, and types-workspace for npm workspaces.
Do I have to generate the types myself?
No. The README says pre-generated packages are listed at gjsify/types.
How do I update it?
For the GJS install, run ts-for-gir self-update.
What are the best TS For Gir alternatives?
Popular alternatives to TS For Gir include Sveld, Renderer and Typedoc. See all TS For Gir alternatives













