gjsify / ts-for-gir

TypeScript type definition generator for GObject introspection interfaces
https://gjsify.org/pages/projects
Apache License 2.0
233 stars 20 forks source link

Add `gi.d.ts` index file #173

Open vixalien opened 2 months ago

vixalien commented 2 months ago

Hi. Thanks for working on this!

I see there's now an option to generate an index tsconfig.json. Would it also be possible to generate a gi.d.ts file similar to https://gitlab.gnome.org/BrainBlasted/gi-typescript-definitions/-/blob/nightly/gi.d.ts?ref_type=heads where we can import just one file and have all the types available

JumpLink commented 2 months ago

@vixalien Good idea. Would this also solve #168 for you? Maybe a part of it?

vixalien commented 2 months ago

Most definitely. In fact the project almost meets the requirements.

I can theoretically do this manually by concatenating the -ambient.d.ts into a gi.d.ts file and then deleting them as they won't be needed 😅 but an option would be highly appreciated.

I would also delete the -import.d.ts files as they would be unused.

JumpLink commented 1 month ago

@vixalien Is also now implemented with the latest version and is the default if package.json support is disabled. In addition to the gi.d.ts with all GIR types, an index.d.ts is now also generated. This means that in addition to all GIR types, all types including the GJS core types can be imported by a single file, now.

vixalien commented 1 month ago

Wow, you're on a roll! I'll take a look ASAP