chenjuneking / quill-image-drop-and-paste

A quill editor module for drop and paste image, with a callback hook before insert image into the editor
ISC License
101 stars 42 forks source link

ImageData.toFile argument is required in type definition #33

Closed lafiosca closed 2 years ago

lafiosca commented 2 years ago

Hello, just a very minor issue here. It appears the type definition requires the filename parameter of ImageData.toFile although the documentation says it is optional: https://github.com/chenjuneking/quill-image-drop-and-paste/blob/8fb0defb4e44972afed41e4f78939960fb3aa462/src/index.d.ts#L14

I think this is due to the abstract method definition here: https://github.com/chenjuneking/quill-image-drop-and-paste/blob/8fb0defb4e44972afed41e4f78939960fb3aa462/src/ImageData.ts#L14

Even though the implementation makes it optional here: https://github.com/chenjuneking/quill-image-drop-and-paste/blob/8fb0defb4e44972afed41e4f78939960fb3aa462/src/ImageData.ts#L78

Judging by the code there, I can work around this by passing an empty string as the parameter, but I thought you might like to fix the typing to match.

chenjuneking commented 2 years ago

Thanks your PR, @lafiosca .