nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.84k stars 1.26k forks source link

The `loadImageFromURL` type definition is misleading #842

Open marlo22 opened 1 year ago

marlo22 commented 1 year ago

Describe the bug The loadImageFromURL method's type suggests that the second parameter (imageName) is optional, but it's required.

To Reproduce Just use the method and look that TS doesn't complain when we don't pass imageName. If you run the application, it logs an error.

Here, we can see that the function rejects a Promise if imageName is falsy. https://github.com/nhn/tui.image-editor/blob/9ee993e21135a0bdb69d1400b19d89d7e78f7378/apps/image-editor/src/js/imageEditor.js#L751-L754

Expected behavior The imageName parameter in the loadImageFromURL definition is marked as required.