-
Notifications
You must be signed in to change notification settings - Fork 50
/
index.d.ts
46 lines (37 loc) · 951 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
/**
* Define a custom html tag
*/
tag?: string;
/**
* Pass a render function or a ReactNode as child
*/
children: React.ReactNode | ((value: { isVisible: boolean }) => React.ReactNode);
}
export default class TrackVisibility extends React.Component<TrackVisibilityProps> {}