0.1.1 • Published 8 years ago
gir-dts-generator v0.1.1
GIR DTS Generator (WIP)
This repository contains a CLI tool that uses node-gir to build TypeScript declaration files for GObject annotated libraries.
This project is a WIP. The goal is to provide automatic type declaration files for projects consuming GObject libraries through node-gir.
Usage
npm install -g gir-dts-generator
gir-dts-generator --helpUsage: gir-dts-generator [options] <libraryName> [libraryVersion]
Options:
  -V, --version        output the version number
  -o, --output <path>  A file to write the output to. Defaults to stdout
  -h, --help           output usage informationIn Code
not sure yet
Roadmap
- Add support for types that are used from other GObject libraries- Currently the declaration files are broken for most libs because classes that extend, or functions that use types from another library will reference undefined symbols. These symbols will have to be resolved and added as extra namespaces in the output declaration file.
 
- Determine how generated declaration files should be used in code- currently the generated declaration file just exports a namespace
but you can't use a namespace as a type. i.e. the following isn's legal
typescript: const GtkLib = load('Gtk', '3.0') as GtkwhereGtkis the ambient namespace exported by the generated .d.ts
 
- currently the generated declaration file just exports a namespace
but you can't use a namespace as a type. i.e. the following isn's legal
typescript: 
- Determine the best way to integrate directly with node-gir- ideally, typescript users consuming node-girshould automatically get types namespace objects when theyload('library').node-gircould probably be a consumer of this tool and use this feature https://github.com/Place1/node-gir/issues/8 to automatically type popular libraries.
 
- ideally, typescript users consuming