Tool used for automatically generating Haxe externs from the Defold API documentation. The main defold API definitions are provided at d.defold.com in JSON format, however the extensions APIs are not. Therefore this tool fetches and parses the HTML pages directly.
Note that the API documentation is somewhat incomplete, so in cases where a type cannot be determined automatically, it is left with a placeholder UNKNOWN
to be fixed manually.
Treat this tool only as the first step in generating externs. All the classes are created, along with the correct enums and documentations; but the final touches are left up to the user.
The following example shows how to generate externs for the Facebook API.
hxdefold-extern-gen https://defold.com/extension-facebook/api/ defold.extensions.facebook Facebook gen/defold/extensions/facebook
This will generate the extern Facebook
class in the file gen/defold/extensions/facebook/Facebook.hx
, and any necessary enums in their own separate files under the same folder.