I tried importing the library into a typescript project and got the following error:
Cannot find module 'svelte-youtube-embed' or its corresponding type declarations.ts(2307)
To work around this, I added the following to my app.d.ts file
declare module 'svelte-youtube-embed' {
import type { SvelteComponentTyped } from 'svelte';
class Youtube extends SvelteComponentTyped<{
id: string;
thumbnail?: string;
animations?: boolean;
}> {}
export default Youtube;
}
While this solves the problem today, I'd like to see the library itself maintain it's types because apis/props can be added and (more importantly) be removed and I'd like to be able to get that information for free!
I tried importing the library into a typescript project and got the following error:
To work around this, I added the following to my
app.d.ts
fileWhile this solves the problem today, I'd like to see the library itself maintain it's types because apis/props can be added and (more importantly) be removed and I'd like to be able to get that information for free!