enter-view icon indicating copy to clipboard operation
enter-view copied to clipboard

Typescript support

Open michaelw85 opened this issue 3 years ago • 1 comments

It would be nice to add a d.ts file to support Typescript out of the box. Here's the d.ts file I created:

declare module 'enter-view' {
    export interface EnterViewArgs {
        selector: NodeListOf<Element> | Element | string;
        enter?: (el: Element) => void;
        exit?: (el: Element) => void;
        progress?: (el: Element, progress: number) => void;
        offset?: number;
        once?: boolean;
    }

    const enterView: (args: EnterViewArgs) => void;
    export default enterView;
}

For anyone stumbling on this post if this doesn't make it into the package; just add the above to your custom typings folder in a file called enter-view.d.ts and you are good to go.

michaelw85 avatar Aug 04 '21 08:08 michaelw85

submit a PR please!

russellsamora avatar Aug 04 '21 10:08 russellsamora