Skip to content
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

typescript errors #75

Open
hirisov opened this issue Nov 23, 2023 · 1 comment
Open

typescript errors #75

hirisov opened this issue Nov 23, 2023 · 1 comment

Comments

@hirisov
Copy link

hirisov commented Nov 23, 2023

Hello,

I get the following typescript errors with 1.0.1 in my vue3 / vite project:

node_modules/grapesjs-plugin-ckeditor/src/index.ts:109:16 - error TS7006: Parameter 'el' implicitly has an 'any' type.

109     getContent(el, rte: CKE.editor) {
                   ~~

node_modules/grapesjs-plugin-ckeditor/src/index.ts:113:12 - error TS7006: Parameter 'el' implicitly has an 'any' type.

113     enable(el, rte?: CKE.editor) {
               ~~

node_modules/grapesjs-plugin-ckeditor/src/index.ts:128:15 - error TS2352: Conversion of type 'HTMLCollection' to type 'Iterable<HTMLElement>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.

128       forEach(rteToolbar.children as Iterable<HTMLElement>, (child) => {
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/grapesjs-plugin-ckeditor/src/index.ts:128:15 - error TS2352: Conversion of type 'HTMLCollection' to type 'Iterable<HTMLElement>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Property '[Symbol.iterator]' is missing in type 'HTMLCollection' but required in type 'Iterable<HTMLElement>'.

128       forEach(rteToolbar.children as Iterable<HTMLElement>, (child) => {
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.es2015.iterable.d.ts:51:5
    51     [Symbol.iterator](): Iterator<T>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.iterator]' is declared here.

node_modules/grapesjs-plugin-ckeditor/src/index.ts:176:17 - error TS2345: Argument of type 'NodeListOf<HTMLElement>' is not assignable to parameter of type 'Iterable<HTMLElement>'.
  Property '[Symbol.iterator]' is missing in type 'NodeListOf<HTMLElement>' but required in type 'Iterable<HTMLElement>'.

176         forEach(els, (child) => {
                    ~~~

  node_modules/typescript/lib/lib.es2015.iterable.d.ts:51:5
    51     [Symbol.iterator](): Iterator<T>;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.iterator]' is declared here.

node_modules/grapesjs-plugin-ckeditor/src/index.ts:192:13 - error TS7006: Parameter 'el' implicitly has an 'any' type.

192     disable(el, rte?: CKE.editor) {
                ~~


Found 6 errors in the same file, starting at: node_modules/grapesjs-plugin-ckeditor/src/index.ts:109

I use es2017 in my project, is there any way to get it working with TS project?

thanks, Gabor

@Afrin127329
Copy link

Most likely, 'el' refers to either HTMLElement or just Element. You can declare it explicitly. Or else simply use any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants