Open
Description
I'm using the SvelteKit workaround:
<script lang="ts">
let Carousel;
onMount(async () => {
const module = await import('svelte-carousel');
Carousel = module.default;
});
</script>
I'm also using TypeScript.
Here, I'm getting the following error:
Could not find a declaration file for module 'svelte-carousel'. '/home/lena/bespinian/bespinian.io-svelte/node_modules/svelte-carousel/src/main.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/svelte-carousel` if it exists or add a new declaration (.d.ts) file containing `declare module 'svelte-carousel';`
npm i --save-dev @types/svelte-carousel
doesn't work because that package doesn't exist.
I'm not sure if the problem is related to the SvelteKit workaround or if this package is generally not typed (correctly) for TypeScript.
My current workaround for this issue is to add declare module 'svelte-carousel';
to src/app.d.ts
. However, it feels like I shouldn't need to do that, if this package was typed correctly.
Furthermore, it would be very helpful to have typings for the Carousel
class and its options. Currently, I'm just typing it as SvelteComponent
explicitly.