【发布时间】:2021-10-24 01:49:49
【问题描述】:
我正在尝试按照 here 找到的插件设置指南进行操作,并且我有一个非常非常简单的插件,如下所示:
figma.showUI(__html__);
// @ts-ignore
console.log(figma.currentPage.selection[0].cornerRadius);
正如所写,插件工作正常并返回所选节点的边框半径。
但是,如果我删除 // @ts-ignore TS 会抱怨:“'SceneNode' 类型上不存在属性 'cornerRadius'。”
我已经安装了来自 here 的类型,我的 .tsconfig 看起来像这样:
{
"compilerOptions": {
"target": "es6",
"lib": ["es6", "dom"],
"typeRoots": [
"./node_modules/@types",
"./node_modules/@figma"
]
}
}
我错过了什么?
【问题讨论】:
标签: typescript figma figma-api