@girs/st-18
v4.7.0
Published
GJS TypeScript type definitions for St-18
Readme
St-18
GJS TypeScript type definitions for St-18 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/st-18Any package manager works. The package has no dependencies beyond other @girs/*
type packages.
What it exports
| Import | What you get |
|---|---|
| @girs/st-18 | the namespace as a default export, plus the ambient and global declarations |
| @girs/st-18/ambient | only the gi:// module declarations |
| @girs/st-18/import | only the imports.gi declarations |
| @girs/st-18/st-18 | the namespace, without the side-effecting declarations |
Three ways to import
Which one you use depends on how you write imports elsewhere, not on your toolchain.
As a module
import St from '@girs/st-18';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/st-18';{ "include": ["@girs/st-18"] }Then the runtime spelling type-checks:
import St from 'gi://St?version=18';Referencing @girs/st-18/ambient instead pulls in these declarations
alone. See ambient modules.
As imports.gi
GJS's global object works the same way, via @girs/st-18/import:
const St = imports.gi.St;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.
