Package Exports
- @girs/node-gtk
- @girs/node-gtk/ambient
Readme
node-gtk
Node.js TypeScript type definitions for node-gtk using ts-for-gir v3.0.0-beta.16.
Install
To use this type definitions, install them with NPM:
npm install @girs/node-gtkUsage
You can import this package into your project like this:
import NodeGtk from '@girs/node-gtk';Or if you prefer CommonJS, you can also use this:
const NodeGtk = require('@girs/node-gtk');Ambient Modules
You can import core ambient module types.
For this you need to include the @girs/node-gtk or @girs/node-gtk/ambient in your tsconfig or entry point Typescript file:
index.ts:
import '@girs/node-gtk'tsconfig.json:
{
"compilerOptions": {
...
},
"include": ["@girs/node-gtk"],
...
}Now you can import node-gtk with Typescript support:
const gi = require('node-gtk');
gi.startLoop();If you want to have more types for GIR modules, you have to add them to your dependencies and import them as well, see the description of these modules, e.g. Gtk-4.0.
Bundle
Depending on your project configuration, it is recommended to use a bundler like esbuild. You can find examples using different bundlers here.
Other packages
All existing pre-generated packages can be found on gjsify/types.