Closed ignaciocorball closed 2 years ago
Hey, image-compare-viewer isn't written in TypeScript (I know, I should update this when I have time). For now though, you can definitely use it in your project you just simply have to create a declaration file for it
I'm getting this error while import ImageCompare.
"ImageCompare" is declared, but its value is never read.ts(6133) No file declaration found for module 'node_modules/image-compare-viewer'. 'c:/frontend/node_modules/image-compare-viewer/src/scripts/index.js' implicitly has type "any". Try "npm i --save-dev @types/image-compare-viewer" if it exists or add a new declaration file (.d.ts) that includes "declare module 'node_modules/image-compare-viewer';".
My typescript file are:
import { Component, OnInit } from '@angular/core'; import ImageCompare from "node_modules/image-compare-viewer";
@Component({ selector: 'app-dzmt-carousel', templateUrl: './dzmt-carousel.component.html', styleUrls: ['./dzmt-carousel.component.css'] }) export class DzmtCarouselComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}