You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the new async FileDialog in Gtk. Unfortunately, the heuristic ts-for-gir employs to detect async functions doesn't catch Gtk.FileDialog.open and Gtk.FileDialog.select_folder (I guess it's because they're missing the _async suffix?). To work around this issue I have to cast to convince Typescript that I do indeed get a promise back, e.g.
That's not nice, but I understand that the introspection metadata ts-for-gir relies on currently doesn't expose any markers for async functions, so it's hard or even impossible to detect all async functions.
As an alternative, I'd be cool if we could specify additional promisified functions explicitly in configuration, e.g. mapping type names to a list of promisified function names mapped to the corresponding start and finish functions.
Would that be a desirable change? If so I could look into making a pull request. As far as I can see it shouldn't be too hard; GirModule.overloadPromisifiedFunctions would just need to make an extra lookup into this new config map and generate the extra overload.
The text was updated successfully, but these errors were encountered:
Hello,
I'm using the new async
FileDialog
in Gtk. Unfortunately, the heuristic ts-for-gir employs to detect async functions doesn't catchGtk.FileDialog.open
andGtk.FileDialog.select_folder
(I guess it's because they're missing the_async
suffix?). To work around this issue I have to cast to convince Typescript that I do indeed get a promise back, e.g.That's not nice, but I understand that the introspection metadata ts-for-gir relies on currently doesn't expose any markers for async functions, so it's hard or even impossible to detect all async functions.
As an alternative, I'd be cool if we could specify additional promisified functions explicitly in configuration, e.g. mapping type names to a list of promisified function names mapped to the corresponding start and finish functions.
Would that be a desirable change? If so I could look into making a pull request. As far as I can see it shouldn't be too hard;
GirModule.overloadPromisifiedFunctions
would just need to make an extra lookup into this new config map and generate the extra overload.The text was updated successfully, but these errors were encountered: