Google Apps脚本是否支持@TyPedef?
如果在库中描述了@TyPedef
,则似乎自动完成似乎无法正如导入库的文件上的预期工作;对象类型变成任何。是否有任何解决方案可以将对象的结构告诉另一个脚本?
请注意,我不想使用诸如Typescript之类的非气体技术。谢谢。
/**
* @typedef {Object} myVegetable
* @property {string} name
* @property {number} price
*/
/** @type {myVegetable} */
var myVegetable = { name: "carrot", price: 1 };
img1- @typedef
在同一文件中按预期工作。
img2- type myVegetable
变成了任何导入库的文件。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅天然气不支持打字稿
Google Apps脚本(GAS)而不添加其他工具不支持打字稿。基于文章使用toxpercript使用typescript 开发应用程序脚本使用
clasp
。但是,这需要您安装以下内容以启用您的本地开发环境:参考:
有关更多详细信息,您可以查看以下链接:
GAS Alone Does Not Support Typescript
Google Apps Script (GAS) does not support typescript without adding additional tools. Based on the article Develop Apps Script using TypeScript, you may incorporate typescript in GAS with
clasp
. However, this requires you to install the following to enable your local development environment:References:
For further details, you may view the following links: