Skip to content

Commit 550f5c6

Browse files
authored
Merge pull request #153 from chiefGui/master
Add TypeScript definition
2 parents c7e7b73 + 690758f commit 550f5c6

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

index.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
declare module "react-visibility-sensor" {
2+
import * as React from "react";
3+
4+
interface Shape {
5+
top?: number;
6+
left?: number;
7+
bottom?: number;
8+
right?: number;
9+
}
10+
11+
interface Props {
12+
onChange?: (isVisible: boolean) => void;
13+
active?: boolean;
14+
partialVisibility?: boolean;
15+
offset?: Shape;
16+
minTopValue?: number;
17+
intervalCheck?: boolean;
18+
intervalDelay?: number;
19+
scrollCheck?: boolean;
20+
scrollDelay?: number;
21+
scrollThrottle?: number;
22+
resizeCheck?: boolean;
23+
resizeDelay?: number;
24+
resizeThrottle?: number;
25+
containment?: any;
26+
delayedCall?: boolean;
27+
children?:
28+
| React.ReactNode
29+
| ((
30+
args: { isVisible: boolean; visibilityRect?: Shape }
31+
) => React.ReactNode);
32+
}
33+
34+
const ReactVisibilitySensor: React.StatelessComponent<Props>;
35+
36+
export default ReactVisibilitySensor;
37+
}

0 commit comments

Comments
 (0)