Open vixalien opened 2 months ago
@vixalien Thank you for the issue. It would be very nice if you can help to complete this types. Contributions to overrides are very simple as they are also written by hand. The hand written type definitions for 'cairo' can be found here: https://github.com/gjsify/ts-for-gir/blob/main/packages%2Fgenerator-typescript%2Ftemplates%2Fgjs%2Fcairo.d.ts
Nice I'll take a stab at it soon
The issue seems to stem from the fact that both cairo-1.d.ts
(from cairo's GIR) and cairo.d.ts
are generated.
When using a type like Gtk.DrawingArea.set_drawing_func
, it uses the cairo.Context
from the GIR (cairo-1.d.ts
) instead of the handwritten cairo.Context
(from cairo.d.ts
)
It seems @ewlsh posted the types of cairo here https://gitlab.gnome.org/GNOME/gjs/-/snippets/2990, although the origin is unclear.
@vixalien Yes, that's right, currently the handwritten ones are only used for import, but not for the generated types. Perhaps a special treatment can be built in for this.
Some Cairo types are missing. For example,
Cairo.Surface
.It seems most of the types are defined here: https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/cairo-context.cpp#L824-921