Open Velmoren opened 2 months ago
@Velmoren do you have more information? Where does "getIcon" comes from?
I take this param in CHANGELOG
## 4.0.0.beta-0
#### :boom: Breaking Change
- !!! Build files removed from repository and only available in npm package !!!
- !!! bowers.json was removed !!!
- server.js was removed
- All build js files was rewritten to typescript
- `build-system` was renamed as `tools`
- Removed `exludeLangs` build option. Instead use `--includeLanguages=en` option.
- Default target for build was changed to es2015
- Build in es2018 target was removed, instead es2021 was added
- Event `getIcon` was removed. Use option `getIcon` instead
```ts
Jodit.make('#editor', {
getIcon: (name: string, clearName: string) => {
if (name === 'bold') {
return '<svg>...</svg>';
}
return null;
}
});
@julianpoemp
@julianpoemp But getIcon
property does'nt exist type JoditConfig
@Velmoren I'm able to reproduce this issue. getIcon
is a property handled by Jodit, but seems not to be defined in the typings of jodit that I use to create JoditConfig type:
export type JoditConfig = Partial<JoditCoreConfig.Config & JoditESMConfig.Config>;
As a temporary workaround convert your options to any
while I'm looking for a solution. I think getIcon
is either defined in another type definition I don't use for JoditConfig or the property does not exist in any typing from Jodit.
@julianpoemp Thank you! We will be waiting!
@Velmoren opened an issue on Jodit repository: https://github.com/xdan/jodit/issues/1157
I'm very sure that it's because of out-of-sync typings. Instead of converting to "any" you can use "IViewOptions" from jodit package. This interface contains the correct typings.
@julianpoemp Thank you! But, IViewOptions not exported from jodit lib. As a temporary workaround i extended the JoditConfig type. We look forward to the fix, thanks again for your assistance!
Type JoditConfig not have 'getIcon' property
Package versions