tui.image-editor icon indicating copy to clipboard operation
tui.image-editor copied to clipboard

The `loadImageFromURL` type definition is misleading

Open marlo22 opened this issue 2 years ago • 0 comments

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.

marlo22 avatar Feb 19 '23 13:02 marlo22