Skip to content

Typescript support #15

@michaelw85

Description

@michaelw85

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions