Utilising JSDoc, we can get Typescript types in .js
files.
@type
can reference types. The type can be:
string
@typedef
tagThe type syntax can be fairly complicated, like conditional types, unions, etc.
For example:
// jest.config.js /** @type { import("@jest/types").Config.InitialOptions } */ module.exports = { ... }
https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html