GrapesJS / GrapesJS/ckeditor

typescript errors

Open
#75 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
110
Forks
107
PR merge metrics
No merged PRs in 30d

Description

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' 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, (child) => {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/grapesjs-plugin-ckeditor/src/index.ts:128:15 - error TS2352: Conversion of type 'HTMLCollection' to type 'Iterable' 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'.

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

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

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

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

node_modules/typescript/lib/lib.es2015.iterable.d.ts:51:5
51 [Symbol.iterator](): Iterator;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'[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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.