Skip to content

Commit aeded29

Browse files
committed
Add TypeScript definition
1 parent c7e7b73 commit aeded29

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

index.d.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
args: { isVisible: boolean; visibilityRect?: Shape }
29+
) => React.ReactNode;
30+
}
31+
32+
const ReactVisibilitySensor: React.StatelessComponent<Props>;
33+
34+
export default ReactVisibilitySensor;
35+
}

0 commit comments

Comments
 (0)