If @typedef
is described in a library it seems that autocomplete doesn't work as expected on a file which imports library; object type is turned into any. Is there any solution to tell object's structure to another script?
Please note that I don't want to use non-gas technique like TypeScript. Thanks.
/**
* @typedef {Object} myVegetable
* @property {string} name
* @property {number} price
*/
/** @type {myVegetable} */
var myVegetable = { name: "carrot", price: 1 };
img1 - @typedef
works as expected in same file.
img2 - type myVegetable
is turned into any on file which imports library.