gjsify/ts-for-gir

GNOME Shell type generation incomplete

sdellysse opened this issue · 2 comments

I put together an example repo here to reproduce the issue I'm running into: sdellysse/scrolltiler@fcf619b

I'm trying to follow the example in this repo to get a gnome shell extension up and going but either I'm doing something wrong, my base OS (Fedora 37) or something is not right in general.

The generated @types/Gjs/index.d.ts has errors. The line import type * as Gjs from './Gjs.js' gives the error File '/home/notroot/src/scrolltiler/@types/Gjs/Gjs.d.ts' is not a module.ts(2306), as the file @types/Gjs/Gjs.d.ts exists but is blank.

Later down the file, the declaration of

    interface BooleanConstructor {
        $gtype: GObject20.GType<boolean>
    }

gives the error: Cannot find namespace 'GObject20'.ts(2503)

I admit I don't know too much about GTK/GLib so I'm not sure what more to do

@sdellysse Some depending .gir files like GObject-2.0.gir are not found on your system. Which distribution / os do you use? Can you check if the file GObject-2.0.gir is present on your system under /usr/share/gir-1.0 or /usr/local/share/gir-1.0? If this files are located under /usr/local/share/gir-1.0 instead of /usr/share/gir-1.0 , you need to update your ts-for-gir.config.js for that.

@JumpLink Thanks, that led me down the right path! Turns out GObject-2.0.gir, GLib-2.0 and the like are part of gobject-introspection-devel on Fedora. I had already installed gtk3-devel thinking that was all I needed but this other package was required as well. Thanks again!