“找不到名称' tinymce' TS(2304)"据称是NPM安装类型之后

发布于 2025-01-23 09:58:22 字数 529 浏览 3 评论 0原文

我正在制作一个打字稿编码的Web应用程序以在SharePoint中运行(特别不是节点!),其中包括使用此有用的编辑器Tinymce。

我通常没有问题,可以通过npm i -save-dev @types/< system/project>终端命令来使TS检查器快乐。它适用于jQueryboot box等。我可以通过index.d.ts文件运行,以了解正在发生的事情。

但不是tinymce:它在index.d.ts文件中的注释中具有名称,但在代码中没有。有一些导出的对象,例如editormanager,依此类推,但是指令将其引用为tinymce

必须做些什么来解决此错误,因为我希望正确检查此名称的脚本? (这意味着声明const tinymce:任何;不是可接受的解决方案,我认为我认为在其他地方提到了这一点)。

I'm making a TypeScript-coded web app to run in SharePoint (specifically not Node!!) and which will include use of this useful editor TinyMCE.

I usually have no problem getting types I need through the npm i --save-dev @types/<system/project> terminal command to keep the TS checker happy. It works for jquery, bootbox, etc. I can run through the index.d.ts files to get an idea of what's going on.

But not tinymce: It has the name in comments in the index.d.ts file, but not in code. There are some exported objects like EditorManager, and so on, but the instruction is to reference it as tinymce.

What must be done to fix this error, as I want script properly checked for this name? (Which means declare const tinymce: any; is not an acceptable solution, something I think I found mentioned elsewhere).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文