ckeditor5-angular icon indicating copy to clipboard operation
ckeditor5-angular copied to clipboard

Just installed Ckeditor5-Angular and typings issue

Open shaklin-essenvia opened this issue 4 years ago • 3 comments

Hi,

I Just created a sample app where i was trying to integrate CKEditor-angular, as soon as i did it, i got the following error

Error: src/app/app.component.html:1:12 - error TS2322: Type 'typeof ClassicEditor' is not assignable to type 'EditorConstructor'.
  The types returned by 'create(...)' are incompatible between these types.
    Type 'Promise<ClassicEditor>' is not assignable to type 'Promise<Editor>'.
      Type 'ClassicEditor' is not assignable to type 'Editor'.
        Types of property 'delegate' are incompatible.
          Type '(...events: string[]) => EmitterMixinDelegateChain' is not assignable to type '(events: string[]) => any'.
            Types of parameters 'events' and 'events' are incompatible.
              Type 'string[]' is not assignable to type 'string'.

After a few stackoverflow answers was able to resolve it by creating a typings.d.ts file with the following,

declare module '@ckeditor/ckeditor5-build-classic' 
{ // or other CKEditor 5 build.

    const ClassicEditorBuild: any;    
    export default ClassicEditorBuild;
}

This however resolved the issue with the classic editor, while i am trying to do the same for BaloonBlock Editor, i am unable to resolve it.

shaklin-essenvia avatar Dec 09 '21 12:12 shaklin-essenvia

Same problem here. @shaklin-essenvia where did you put the file you created?

papagei-ma avatar Jan 12 '22 18:01 papagei-ma

Same problem here. @shaklin-essenvia where did you put the file you created?

src/app/typings.d.ts

PedramDev avatar Feb 25 '22 14:02 PedramDev

it woks if you are using ckeditor in application, but in library I still have the same issue, any solution for that?

musliuf1 avatar Apr 13 '22 09:04 musliuf1

My workaround for this in order to be able to use ckeditor in a library is

export class RichTextEditorComponent {
  editor = ClassicEditor as {
    create: any;
  };
  //...
}
<ckeditor
  [editor]="editor"
></ckeditor>

marcinstl avatar Oct 31 '22 07:10 marcinstl

The component contains its typings starting from version 6.0.0 (the latest version is equal to 7.0.0). It requires CKEditor 5 in version 37+ (latest 38.1.1).

Could you try to use the setup environment using the mentioned version above and try to reproduce the issue?

pomek avatar Jul 21 '23 06:07 pomek

Closing due to lack of activity. If you think the issue is still not resolved, please, re-open it and provide the feedback we asked for.

CKEditorBot avatar Aug 21 '23 01:08 CKEditorBot