如何构建CKEditor5自定义构建的打字稿版本?

时间:2018-12-11 13:16:52

标签: angular typescript webpack typescript-typings ckeditor5

我正在尝试构建CKEditor5的自定义版本。

按照the official document中提到的步骤操作,我得到ckeditor.js。我希望生成一个打字稿文件(ckeditor.ts或ckeditor.d.ts),以便可以在Angular项目中使用它。

1 个答案:

答案 0 :(得分:0)

您也可以在TS项目中使用JS文件。您只需要在allowJs: true文件中设置tsconfig.json。如果将严格模式设置为true,则可能需要为构建添加一个简单的声明文件-https://github.com/ckeditor/ckeditor5-angular/blob/master/src/typings.d.ts

实际上有一个有关生成声明文件的待处理票据-https://github.com/ckeditor/ckeditor5/issues/504。此处提供了CKEditor 5构建的非常简单的声明文件:https://github.com/ckeditor/ckeditor5-angular/blob/46799e389bae907613774a893166646425d36de1/src/ckeditor/ckeditor.ts#L8

相关问题