ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Automatic text transformation TS typings are inconsistent with documentation

Open f1ames opened this issue 1 year ago • 0 comments

📝 Provide detailed reproduction steps (if any)

Looking at "Automatic text transformation" feature documentation it says:

This feature comes pre-configured with a set of the most popular transformations. You can, however, remove existing ones or add your own autocorrect entries.

Followed by the example code (simplified for clarity):

ClassicEditor
    .create( editorElement, {
        typing: {
            transformations: {
                remove: [...],
                extra: [...],
            }
        }
    } )
    .then( /* ... */ )
    .catch( /* ... */ );

However, TS typings define transformations object as one requiring include property (see API docs):

image

Meaning that above code snippet will cause TS error.

✔️ Expected result

My interpretation is that I should be able to use transformations with only extra or remove with no errors.

❌ Actual result

TS error due to missing include property.

❓ Possible solution

The include property should by optional (as long as it's only typings issue not anything more complex).

📃 Other details

Not relevant.


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

f1ames avatar May 24 '24 14:05 f1ames