I think it could be useful to provide an interface not only for Image objects but for File objects too.
Just create public method setFile(file: File) that will read file using FileReader internally and call setImage(img: Image). This will reduce the amount of boilerplate code and make your library more usable.
I think it could be useful to provide an interface not only for
Image
objects but forFile
objects too.Just create public method
setFile(file: File)
that will read file usingFileReader
internally and callsetImage(img: Image)
. This will reduce the amount of boilerplate code and make your library more usable.