-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing type declarations for nested entrypoints #423
Comments
Hm. On https://www.npmjs.com/package/gl-matrix I see NPM claims the package has types from |
Relevant: #390 |
For the time being I'm working around this by adding an additional declare module 'gl-matrix/vec4' {
import { vec4 } from 'gl-matrix';
export = vec4;
}
declare module 'gl-matrix/vec3' {
import { vec3 } from 'gl-matrix';
export = vec3;
}
declare module 'gl-matrix/vec2' {
import { vec2 } from 'gl-matrix';
export = vec2;
}
declare module 'gl-matrix/mat4' {
import { mat4 } from 'gl-matrix';
export = mat4;
}
declare module 'gl-matrix/mat3' {
import { mat3 } from 'gl-matrix';
export = mat3;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been importing from
gl-matrix
with the following syntax:My code builds correctly (microbundle 0.13 + TypeScript 4.2.3) but the type declarations are not found, so the imports are implicitly typed "any":
In a TypeScript project, this is easiest to spot with
"noImplicitAny": true,
enabled intsconfig.json
, because it becomes a compiler error. I found this issue in the process of converting a codebase to the TS "strict" mode.Are these entrypoints a valid way of importing, and do you know if it's possible to provide type declarations for them? If I import from the root as
import { mat4 } from 'gl-matrix'
thenmat4.determinant
will have the correct type information, so certainly the type information exists, but is just not accessible when imported in the other way. Unfortunately I think the latter syntax defeats tree-shaking and will increase my library's bundle size, so I'd prefer to use the deeper entrypoints.Thanks!
The text was updated successfully, but these errors were encountered: