by syspec · 3y ago · 0 comments
/// Top of file usually
/**
* @typedef {import('./typedefs/MyThing')} MyThing
*/
/// Later
/**
* @param {MyThing} x
*/
function(x) {
//
} /** @param { import('./foo.js').SomeType } arg */
function doThing(arg) {
// ...
}
The thing being imported can be a JS thing like an exported class, or a JSDoc type that's defined with @typedef.