@girs/ide-50
v4.7.0
Published
GJS TypeScript type definitions for Ide-50, generated from library version 50.0.0
Readme
Ide-50
GJS TypeScript type definitions for Ide-50, generated from library version 50.0.0 using ts-for-gir v4.7.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/ide-50Any package manager works. The package has no dependencies beyond other @girs/*
type packages.
What it exports
| Import | What you get |
|---|---|
| @girs/ide-50 | the namespace as a default export, plus the ambient and global declarations |
| @girs/ide-50/ambient | only the gi:// module declarations |
| @girs/ide-50/import | only the imports.gi declarations |
| @girs/ide-50/ide-50 | the namespace, without the side-effecting declarations |
| @girs/ide-50/vocabulary | GIR-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 Ide from '@girs/ide-50';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/ide-50';{ "include": ["@girs/ide-50"] }Then the runtime spelling type-checks:
import Ide from 'gi://Ide?version=50';Referencing @girs/ide-50/ambient instead pulls in these declarations
alone. See ambient modules.
As imports.gi
GJS's global object works the same way, via @girs/ide-50/import:
const Ide = imports.gi.Ide;Widget vocabulary
ide-50 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/ide-50/vocabulary';
import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/ide-50/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.
