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

[TS] Provide TypeScript Typings for CKEditorInspector #173

Open
mmichaelis opened this issue Apr 18, 2023 · 2 comments
Open

[TS] Provide TypeScript Typings for CKEditorInspector #173

mmichaelis opened this issue Apr 18, 2023 · 2 comments
Labels
domain:dx squad:core Issue to be handled by the Core team.

Comments

@mmichaelis
Copy link

mmichaelis commented Apr 18, 2023

Now, that CKEditor 5 37.x ships with TypeScript typings, it would be great to benefit from corresponding typings also for CKEditorInspector.

Workaround

declare class CKEditorInspector {
  static attach(editorOrConfig: Editor | Record<string, Editor>, options?: { isCollapsed?: boolean }): string[];
}

(if I got the documentation straight and skipping attachToAll)

mmichaelis added a commit to CoreMedia/ckeditor-plugins that referenced this issue Apr 18, 2023
As stated in ckeditor/ckeditor5-inspector#173, `CKEditorInspector`
does not ship with typings yet. Providing some adhoc typings
instead.
@Witoso Witoso added domain:dx squad:core Issue to be handled by the Core team. labels May 10, 2023
@Witoso Witoso changed the title Provide TypeScript Typings for CKEditorInspector [TS] Provide TypeScript Typings for CKEditorInspector May 10, 2023
@Acetyld
Copy link

Acetyld commented Dec 6, 2023

Agree

@DeltekDavid
Copy link

DeltekDavid commented Mar 27, 2024

Yes, please--trying to work through the React custom component tutorial with TypeScript, but can't use CKEditorInspector!

Can anyone supply sample code using a workaround? Not sure how to integrate @mmichaelis 's example.

Edit: I ended up creating ckeditor5-inspector.d.ts with the content:

declare module '@ckeditor/ckeditor5-inspector'; // workaround until they release types for CKEditorInspector

...and this silenced the type error, allowed me to follow the integration steps from the tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx squad:core Issue to be handled by the Core team.
Projects
None yet
Development

No branches or pull requests

4 participants