-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
ModulesfeatFeature RequestFeature Requestinternal-issue-createdAn internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issuetriage-doneHas been reviewed by someone on triage rotation.Has been reviewed by someone on triage rotation.
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) {}
rahbari, ray007, DrRataplan, teppeis, timdawborn and 4 more
Metadata
Metadata
Assignees
Labels
ModulesfeatFeature RequestFeature Requestinternal-issue-createdAn internal Google issue has been created to track this GitHub issueAn internal Google issue has been created to track this GitHub issuetriage-doneHas been reviewed by someone on triage rotation.Has been reviewed by someone on triage rotation.