How to declare types when importing within a JSDoc type? #12404
Unanswered
jaydenseric
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is a way to declare types when importing:
But how do you do the same when importing within a JSDoc type?
For example in
x.js:In the above situation, if
Foois a type that comes from a.d.tsfile and isn't actually a named export in the ESM module, trying to import thex.jsmodule in a TypeScript module with type checking enabled will cause a TS error:TS2694 [ERROR]: Namespace '__' has no exported member 'Foo'..Beta Was this translation helpful? Give feedback.
All reactions