@girs/snapd-1
v4.3.0
Published
GJS TypeScript type definitions for Snapd-1
Readme
Snapd-1
GJS TypeScript type definitions for Snapd-1 using ts-for-gir v4.3.0.
Install
Install the type definitions with npm:
npm install @girs/snapd-1Usage
Import it like any other module:
import Snapd from '@girs/snapd-1';Ambient Modules
Ambient modules let you write the same import you would in plain JavaScript.
For this you need to include @girs/snapd-1 or @girs/snapd-1/ambient in your tsconfig or entry point Typescript file:
index.ts:
import '@girs/snapd-1'tsconfig.json:
{
"compilerOptions": {
...
},
"include": ["@girs/snapd-1"],
...
}The ambient module now resolves with types:
import Snapd from 'gi://Snapd?version=1';Global import
GJS's global imports.gi works too, with types.
For this you need to include @girs/snapd-1 or @girs/snapd-1/import in your tsconfig or entry point Typescript file:
index.ts:
import '@girs/snapd-1'tsconfig.json:
{
"compilerOptions": {
...
},
"include": ["@girs/snapd-1"],
...
}That form carries types as well:
const Snapd = imports.gi.Snapd;Bundle
Most projects want a bundler. esbuild is the smallest thing that works; the examples directory has setups for several others.
Other packages
All existing pre-generated packages can be found on gjsify/types.
