Skip to content

Commit

Permalink
Add typescript definition
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Oct 28, 2017
1 parent b9656ec commit 711f34c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import * as React from "react";

interface TrackVisibilityProps {
/**
* Define if the visibility need to be tracked once
*/
once?: boolean;

/**
* Tweak the throttle interval
* Check https://css-tricks.com/debouncing-throttling-explained-examples/ for more details
*/
throttleInterval?: number;

/**
* Additional style to apply
*/
style?: object;

/**
* Additional className to apply
*/
className?: string;

/**
* Define an offset. Can be useful for lazy loading
*/
offset?: number;

/**
* Update the visibility state as soon as a part of the tracked component is visible
*/
partialVisibility?: boolean;
}

export class TrackVisibility extends React.Component<TrackVisibilityProps> {}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"screen"
],
"main": "lib/index.js",
"typings": "./index.d.ts",
"scripts": {
"lint": "eslint src/",
"pretest": "npm run lint",
Expand Down

0 comments on commit 711f34c

Please sign in to comment.