-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No type definitions for CKEditor5.Config? #70
Comments
Hi, @seanbotha123! Unfortunately, type definitions for CKEditor 5 builds still don't exist. You can subscribe to the ckeditor/ckeditor5#504 issue. Different builds provide different sets of plugins thus different toolbar options, so it can't be done from the You can check all possible options here: https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html |
Your documentation suggests to import the editor into the component that uses it: import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic'; or ckeditor5-build-inline This results in an error because of typescript being unable to find the declaration file d.ts
Given that typescript is the default language for angular and thus your component, could you give a detailed example that lets us use that angular version of the editor with typescript out of the box, even if you declare the build as any. In fact you should add that to the doc. Thank you for your help |
Hi @PMoransais.
We can't add declaration files for builds to our integration. It's up to the developer to choose the build or even build the editor from source and use that build in the angular integration later. But we should mention it in our docs indeed (Note that this error happens only for the strict mode). That part is on the review already - https://github.com/ckeditor/ckeditor5/pull/1535/files#diff-bba2ee914d15379a204c8e67fbb57176R72.
Defining declaration files isn't such easy for existing JS libraries. Unless you want to define all interfaces and actualize them later on your own. We started working on the ckeditor/ckeditor5#1415, but things get complicated and there's no ROI for it at this moment. You'll be also intreseted in ckeditor/ckeditor5#504. |
For anyone having the problem with importing the CKEditor 5 builds in the future, this should fix the problem:
// Empty typings for the editor used in the app to satisfy the TS compiler in the strict mode:
declare module '@ckeditor/ckeditor5-build-classic' { // or other CKEditor 5 build.
const ClassicEditorBuild: any;
export = ClassicEditorBuild;
}
Note: Depending on your TypeScript configuration you should have either namespace or default imports and exports. |
please, add types |
Thanks :) |
works for me. Thanks. |
just uninstall this type |
Hi,
Can we not have type definitions for the config property of the editor?
Regards
Sean
The text was updated successfully, but these errors were encountered: