You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to resolve external @typedef definitions.
/** * A number, or a string containing a number. * @typedef {Object} NumberLike * @prop {number} Number to return *//** * A number, or a string containing a number. * @typedef {import('./NumberLikeTypes.js').NumberLike} NumberLikeExternal */exportdefaultclassMyElement{/** * Set the magic number (using a local @typedef annotation). * @param {(number|string)} x - The magic number. * @returns {NumberLike} - The magic number. */setMagicNumber(x){return{number: x}}/** * Set the magic number (using an external @typedef annotation). * @param {(number|string)} * @returns {NumberLikeExternal} - The magic number. */setMagicNumberExternal(x){return{number: x}}}
// NumberLikeTypes.js/** * A number, or a string containing a number. * @typedef {Object} NumberLike * @prop {number} Number to return */
I'm also curious if this is possible. In my case, Im expecting NumberLike to resolve to "'foo' | 'bar'" given its defined as export type NumberLike = 'foo' | 'bar';
See return type:
"declarations": [
{
"kind": "class",
"description": "A number, or a string containing a number.",
"name": "MyElement",
"members": [
{
"kind": "method",
"name": "setMagicNumber",
"parameters": [
{
"name": "x",
"description": "The magic number.",
"type": {
"text": "(number|string)"
}
}
],
"description": "Set the magic number (using a local @typedef annotation).",
"return": {
"type": {
"text": "'foo' | 'bar'"
}
}
}
]
}
]
Checklist
--dev
flag to get more information?Playground Reproduction
Expected behavior
Attempting to resolve external
@typedef
definitions.Output
Hoping that
NumberLikeExternal
andNumberLike
could be resolved to show the actual types, not just the string text of them.The text was updated successfully, but these errors were encountered: