sharu725 / youtube-embed

Embeds a clickable youtube thumbnail instead of the iframe. Upon clicking, loads the iframe.
https://embed.sveltethemes.dev
36 stars 7 forks source link

library doesn't play nice with typescript right now #31

Closed willgottschalk closed 1 week ago

willgottschalk commented 2 weeks ago

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!

sharu725 commented 1 week ago

I think that will not be necessary. I took some drastic measures to mitigate this. Please try 0.3.0

willgottschalk commented 1 week ago

this works now. Thank you so much!