Typings to be optimized for Autosave (save requires DataApi/DataApiMixin) / editor.getData on the Editor type
📝 Provide detailed reproduction steps (if any)
-
Configuring
Autosavefollowing the documentation:https://github.com/ckeditor/ckeditor5/blob/3dc1e52036bc89d488db92d3d440bb360ec1aa69/packages/ckeditor5-autosave/src/autosave.ts#L43-L48
or:
https://github.com/ckeditor/ckeditor5/blob/3dc1e52036bc89d488db92d3d440bb360ec1aa69/packages/ckeditor5-autosave/src/autosave.ts#L385-L403
✔️ Expected result
The example compiles successfully.
❌ Actual result
The example fails to compile editor.getData(), as Editor does not implement the required DataApi/DataApiMixin.
❓ Possible solution
Possibly extend typing of save:
https://github.com/ckeditor/ckeditor5/blob/3dc1e52036bc89d488db92d3d440bb360ec1aa69/packages/ckeditor5-autosave/src/autosave.ts#L385-L403
to, for example:
save?: ( editor: Editor & DataApi ) => Promise<unknown>;
📃 Other details
- Browser: Chrome
- OS: Windows
- First affected CKEditor version: 37.0.1
- Installed CKEditor plugins: Autosave
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
Thanks for the report. We were just discussing this but we are still unsure of how to approach the fix. The quick workaround could be directly accessing the data controller with the editor.data.get() API.
Thanks for the report. We were just discussing this but we are still unsure of how to approach the fix. The quick workaround could be directly accessing the data controller with the editor.data.get() API.
Would be fine for us. We just need to ensure, that we can pass the options (here: trim) - and this is part of the DataController API.
Scope:
- add
getDataandsetDatato theEditorclass. - deprecate
DataApiMixin. - create an issue to follow up with the removal of
DataApiMixin.
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).