Open
Description
The type system currently has no way of referencing types in ES6 modules without importing them. We need some sort of weak reference / import type for ES6 modules.
Bike shedding ideas dump:
- Allow paths in type names. Use
:
as a delimiter forpath:type
.
/** @param {./foo.js:Type.Nested} n */
function foo(n) {}
- Some commented out import syntax that brings the names into the type scope.
// @import {Type} from './foo.js';
/** @param {Type.Nested} n */
function foo(n) {}
- Since the option above might be difficult with the current way we handle JsDoc (needs to be attached to something) and because
Type
doesn't really exist (it isn't a variable), we could modify the above option to act more like how we handle typedefs, i.e. annotate a variable declaration.
/** @import {Type} from './foo.js'; */
let Type;
/** @param {Type.Nested} n */
function foo(n) {}