jonasgeiler / svelte-infinite-loading

An infinite scroll component for Svelte, to help you implement an infinite scroll list more easily.
MIT License
304 stars 11 forks source link

Typescript types declaration #1

Closed dgellow closed 4 years ago

dgellow commented 4 years ago

Hey there. In case you're interested, I created a small declaration file for Typescript types for this library for my own use.

declare module "svelte-infinite-loading" {
    export interface InfiniteLoadingProps {
        distance?: number
        spinner?: "default" | "spiral" | "circles" | "bubbles" | "wavedots"
        direction?: "top" | "bottom"
        forceUseInfiniteWrapper?: boolean | string
        identifier?: any
    }

    export default class {
        $$prop_def: InfiniteLoadingProps
    }
}

If you add it to the files shipped to npm that would allow typescript users to get type information. I'm just sharing it here in case that might interest you, but feel free to close this issue if you don't care :)

Cheers!

jonasgeiler commented 4 years ago

@dgellow I've added the type declarations now! Thanks for your help.
Let me know if something doesn't work.

dgellow commented 4 years ago

Awesome, thank you :)