ckeditor5-inspector icon indicating copy to clipboard operation
ckeditor5-inspector copied to clipboard

[TS] Provide TypeScript Typings for CKEditorInspector

Open mmichaelis opened this issue 1 year ago • 2 comments

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 avatar Apr 18 '23 10:04 mmichaelis

Agree

Acetyld avatar Dec 06 '23 13:12 Acetyld

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.

DeltekDavid avatar Mar 27 '24 19:03 DeltekDavid