@girs/node-gtk
TypeScript icon, indicating that this package has built-in type declarations

3.3.0 • Public • Published

node-gtk

version downloads/week

Node.js TypeScript type definitions for node-gtk using ts-for-gir v3.3.0.

node-gtk is a GObject Introspection import library for Node.js. Using node-gtk with the type definitions in this NPM package, you can build GTK applications in JavaScript or TypeScript with type checking, better autocompletion and inline documentations.

Install

To use this type definitions, install them with NPM:

npm install @girs/node-gtk

Usage

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 types for GObject Introspection modules, you have to add them to your dependencies and import them as well, see the description of these modules, e.g. node-gtk-4.0, node-gio-2.0, node-adw-1 and much more.

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.

Package Sidebar

Install

npm i @girs/node-gtk

Weekly Downloads

109

Version

3.3.0

License

MIT

Unpacked Size

5.95 kB

Total Files

10

Last publish

Collaborators

  • swsnr
  • ewlsh
  • totto16
  • schanz
  • jumplink