I use tinymce in my project and installed @types/tinymce
. However when calling tinymce.init()
and passing the Settings
object some of the properties are missing in @types/tinymce
's index.d.ts
and I get an error:
Calling code:
tinymce.init({
selector: "#editor",
height: 400,
plugins: "paste",
element_format: "html",
paste_block_drop: true,
[...]
}
Error message:
Argument of type '{ selector: string; height: number; menubar: string; toolbar: string; plugins: string; element_format: string; paste_data_images: true; paste_block_drop: boolean; paste_enable_default_filters: boolean; paste_remove_styles: boolean; paste_retain_style_properties: string; setup: (editor: Editor) => void; }' is not assignable to parameter of type 'Settings'.
Object literal may only specify known properties, and 'paste_block_drop' does not exist in type 'Settings'.
The definition in index.d.ts
looks like this:
export interface Settings {
base_url?: string;
table_toolbar?: string;
[...]
}
I searched and read several StackOverflow answers and read Typescript docs and tried to create a file tinymce-extensions.d.ts
with this content:
export interface Settings {
paste_block_drop?: boolean;
}
However it does not work, I still get above error message. What am I doing wrong?