TypeScript type definitions auto-generated by parsing official WebIDL bindings for Ammo.js.
Ammo.js is direct port of the Bullet physics engine to JavaScript using Emscripten.
There wasn't a complete type definitions package for Ammo.js before this project has started. This package is developed by parsing official WebIDL bindings of Ammo.js with a Node.js script automatically. The latest WebIDL bindings of Ammo.js can be found at https://github.com/kripken/ammo.js/blob/master/ammo.idl. A copy of "ammo.idl" file is kept in this repository and updated at each release.
While Emscripten uses a non-conforming WebIDL parser, this package uses W3C's WebIDL parser. So I had to modify "ammo.idl" to pass WebIDL validation. Note that modified "ammo.idl" is not completely correct from the WebIDL specification perspective (e.g. FrozenArray<T>
is used as a mutable array for an attribute). Since the build script is only specialized for this package, it doesn't matter for our goal. But, corrections and workarounds are always welcome.
Currently, there is no NPM package yet. But, you can use it anyway by using the following command:
$ npm install github:osman-turan/ammo.js-typings
If you want to modify WebIDL bindings and generate corresponding type definitions, clone this repository and run the following command to install required NPM packages:
$ npm install
Then, apply your changes to "ammo.idl" file and run the following command to generate updated type definitions:
$ npm run build
Please open an issue before submitting any pull-requests.
This project is licensed under the MIT License - see the LICENSE file for details.