https://github.com/aduros/dts2haxe
Typescript .d.ts to Haxe extern generator.
https://github.com/aduros/dts2haxe
Last synced: about 13 hours ago
JSON representation
Typescript .d.ts to Haxe extern generator.
- Host: GitHub
- URL: https://github.com/aduros/dts2haxe
- Owner: aduros
- Created: 2014-01-21T00:52:08.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-09T18:32:40.000Z (over 11 years ago)
- Last Synced: 2025-08-25T21:09:00.773Z (about 2 months ago)
- Language: Python
- Size: 152 KB
- Stars: 15
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Typescript .d.ts to Haxe extern generator
Conversion is decent, but still requires manual tweaking for many
libraries. Check the tests/ directory to see what's supported and what
the output looks like.Also check out https://github.com/Simn/ts2hx for a more complete
generator.## Usage
```
(sudo) pip install pyparsing
./dts2haxe input.d.ts
```## What works
* Classes.
* Interfaces (mapped to Haxe typedefs).
* Enums.
* Global variables and functions (placed as statics in a generated "Globals" class).
* Array types.
* Anonymous types.
* Varargs methods.
* Nested modules.
* Escaping Haxe keywords.## What doesn't work yet
* Generics.
* Method overloading.
* Certain weird JS patterns that don't map well to Haxe.
* Splitting generated Haxe into multiple .hx files.
* Importing external type dependencies. Converting HTML dependencies to js.html.*.
* Preserving jsdoc comments in output.
* Allowing quoted strings for identifiers.I'm not a Typescript developer, so there may be things I overlooked! If
one of these TODOs is interesting to you, please fork and contribute.