We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Search Terms: JSDoc default named exports @typedef
@typedef
Code Given the following files:
/// file1.js function foo() { return true; } export { foo }; /// file2.js /** * @typedef { ReturnType<import('./file1').foo> } Foo */
TypeScript / VSCode will correctly identify the type.
However, if it's a default export like:
/// file1.js function foo() { return true; } export default foo;
... then there seems to be no way for TS to recognize the type via @typedef. Neither of the following will work:
/// file2.js /** * @typedef { ReturnType<import('./file1')> } Foo */ /** * @typedef { ReturnType<import('./file1').default> } Foo */
Related Issues: Possibly Related? #33136
The text was updated successfully, but these errors were encountered:
Never mind! I made other changes, and the issue was my import path. Using .default worked. However, this would be great to see in the documented examples! -> https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html
.default
Sorry, something went wrong.
No branches or pull requests
Search Terms:
JSDoc default named exports
@typedef
Code
Given the following files:
TypeScript / VSCode will correctly identify the type.
However, if it's a default export like:
... then there seems to be no way for TS to recognize the type via
@typedef
. Neither of the following will work:Related Issues:
Possibly Related? #33136
The text was updated successfully, but these errors were encountered: