browser-image-resizer
browser-image-resizer copied to clipboard
Unable to use browser image resizer
** Could not find a declaration file for module 'browser-image-resizer'. 'E:/Angular/travelgram/node_modules/browser-image-resizer/dist/index.js' implicitly has an 'any' type.**
Unable to user browser image resizer: even though the module is present but it is showing is not present.
Please see the video ref: https://monosnap.com/direct/qbpKBmUth9pjpobJ0HzqtlH2ATs59i
Yeah there are no types, would be great to add them.
The solution for now is to define them yourself e.g. in a file src/@types/browser-image-resizer/index.d.ts
declare module 'browser-image-resizer' {
interface Config {
quality: number
maxWidth: number
maxHeight: number
autoRotate: boolean
debug: boolean
mimeType: 'image/jpeg' | 'image/png'
}
export function readAndCompressImage(file: File, userConfig?: Partial<Config>): Promise<Blob>
}
Types added in v2.3.0 thanks to #40, check it out and lmk if you continue to encounter issues