enter-view
enter-view copied to clipboard
Typescript support
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.
submit a PR please!