toji / gl-matrix

Javascript Matrix and Vector library for High Performance WebGL apps
glmatrix.net
MIT License
5.4k stars 725 forks source link

Type definitions don't match the export structure of the sources #429

Open LinqLover opened 3 years ago

LinqLover commented 3 years ago

TypeScript is unable to derive types from gl-matrix when a single type is imported using require('gl-matrix/vec3') or something similar:

image image

Nevertheless, both require() statements are valid and equivalent as you can try in your REPL.

After filing an issue in the TypeScript repository, @RyanCavanaugh kindly explained to me that there must be a problem with the type definitions in this repository. As far as I understand, this repository would need to define all types that are exported in the src/index.js as default exports so that all entry points are declared correctly.

For the original issue, please see https://github.com/microsoft/TypeScript/issues/44077.