Import matter-js in typescript project
You can try to load it using import * as matter from 'matter-js'
, that should work.
I load the matter.js library with a script tag. Did you forget that?
<script src="js/matter.min.js"></script>
And I installed the typings with
npm install @types/matter-js
Unfortunately, the typescript lib seems outdated. Last commit 2 years ago. Parameters that should be optional are instead required in the typescript definitions...