Is there any way how to make PhpStorm recognize what is a ckeditorInstance
in this context?
const ckEditorElement = document.querySelector('.ck-editor__editable');
const ckEditorInstance = ckEditorElement?.ckeditorInstance;
Afterwards I try to access for example the model
property on the instance and it just looks ugly in the code as every property is underlined.
In the dev tools console using querySelector()
I can find the instance and it shows all of its available properties.
I see a bunch of ckeditor libraries in PhpStorm settings, but I am not sure if and how any of them are usable for what I need. Because just installing something wouldn't help in this case as I might need to typehint it somehow?
Example of what I mean, an issue I encountered before, but got a simple fix from How do I use WebStorm for Chrome Extension Development?
I resolved this by doing what is said in the posts accepted answer - which is to install a chrome type JS library in the settings. What I am doing is different obviously, but a similar issue, and maybe there is a fix to this?
Unresolved variable ckeditorInstance
. The code works, but then it underlines everything else I access on the instance, too, because it does not know what it is.ckEditorElement
to the IDE?HTMLElement
orObject
doesn't help IDE know what properties does it contain. I added an example in my post for clarification.