Coder Social home page Coder Social logo

node-gtk typings issues about ts-for-gir HOT 14 CLOSED

gjsify avatar gjsify commented on August 25, 2024
node-gtk typings issues

from ts-for-gir.

Comments (14)

romgrk avatar romgrk commented on August 25, 2024 1

Indeed, our overrides here are missing the JSDoc to change the typings (opened #284).

from ts-for-gir.

JumpLink avatar JumpLink commented on August 25, 2024

Thanks you for your helpful feedback @romgrk 💚
I will look at it as soon as possible, hopefully in a few weeks.

from ts-for-gir.

JumpLink avatar JumpLink commented on August 25, 2024

@romgrk Unfortunately I have no time at the moment, maybe you can see if you can implement some of these things yourself?

from ts-for-gir.

romgrk avatar romgrk commented on August 25, 2024

Sorry, no bandwidth for that :/ I might get around to it but I have more urgent issues to fix in node-gtk first.

from ts-for-gir.

JumpLink avatar JumpLink commented on August 25, 2024

Any updates in node-gtk @romgrk ?

from ts-for-gir.

romgrk avatar romgrk commented on August 25, 2024

Still no time, the project has other bugs that are more important to fix and I've been having trouble getting around to them :/

from ts-for-gir.

JumpLink avatar JumpLink commented on August 25, 2024

@romgrk I hope I've fixed the points 2, 3, 4 and 6 now. Can you take a look at @types/node-gtk on my fork?

from ts-for-gir.

romgrk avatar romgrk commented on August 25, 2024

I've taken a quick look, seems good overall :)

Fixing 5 would be awesome though. E.g. for Gtk, the methods signature usually take a Gtk.Widget, but we want child clasees (Gtk.Button, Gtk.Icon, ...) to fit in there so they need to inherit from Gtk.Widget.

from ts-for-gir.

mildsunrise avatar mildsunrise commented on August 25, 2024

I think it hasn't been mentioned (& I still need to look at it) but APIs like setProperty are incorrectly marked as taking a GValue, the correct type would be any I think?

edit: also, this tool also seems to mark arrays of primitives as any

from ts-for-gir.

mildsunrise avatar mildsunrise commented on August 25, 2024

Also to keep it in mind, the typings use Class.$gtype when it should be Class.prototype.__gtype__, but I'm not sure this was meant to be a public API, because it's missing on boxed objects (only available on actual instances).

from ts-for-gir.

romgrk avatar romgrk commented on August 25, 2024

Not public, those are used for edge cases where there is not enough info in either GIR or Glib's gtype system about a boxed instance. They might be removed when I find a better way to handle them.

from ts-for-gir.

mildsunrise avatar mildsunrise commented on August 25, 2024

In that case I suppose the best thing would be to add a public API at Class.$gtype to match gjs. It makes more sense than adding it on instances and the user can do instance.constructor.$gtype

from ts-for-gir.

romgrk avatar romgrk commented on August 25, 2024

Yes, adding it on the constructor seems like the best place to add a public API for that. I don't really like the $ notation though. But let's open an issue on node-gtk for further discussion on this, it will save @sammydre from hearing our node-gtk internal discussions.

from ts-for-gir.

JumpLink avatar JumpLink commented on August 25, 2024

Theoretically all points should be solved now, if there are still issues please open a new issue, I am happy about feedback. :)

from ts-for-gir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.