Typescript conversion to pascal
PAS2JS ships with several such import units. Making such a unit is tedious work.
Fortunately, there is now a solution.
Typescript programmers have the same problem as PAS2JS programmers:
How does this help us ?
We went a step further, and convert the TypeScript type declarations to pascal.
Better yet, the tool has been put in a CGI program, and is available online;
Selecting the correct file and pressing "Go" will convert the file for you: a ready made pascal import unit.
The tool is not perfect, but it will take 99% of the work out of your hands. It parses 99.5% of all files in DefinitelyTyped.
From the 7500 files I tested with the conversion tool, only 50 fail to convert.
More than 2000 generated files compile out-of-the box. The rest will need some tweaking.
and you will most likely encounter an 'Identifier not found' error.
In many cases, this can be remedied by running the tool on the imported file, and adding the generated unit to the uses clause.
The tool is committed in the FPC repository.
It will still be improved, just as the online version, but can already be used quite well today.
Michael van Canneyt