-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.d.ts
28 lines (25 loc) · 945 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
import * as React from 'react';
export interface Dimensions {
top: number;
right: number;
bottom: number;
left: number;
width: number;
height: number;
}
export interface ContainerDimensionsProps {
/**
* Can either be a function that's responsible for rendering children.
* This function should implement the following signature:
* ({ height, width }) => PropTypes.element
* Or a React element, with width and height injected into its props.
*/
children: ((props: Dimensions) => React.ReactNode) | React.ReactNode;
}
/**
* Component that automatically adjusts the width and height of a single child.
* Child component should not be declared as a child but should rather be specified by a `ChildComponent` property.
* All other properties will be passed through to the child component.
*/
declare const ContainerDimensions: React.ComponentType<ContainerDimensionsProps>;
export default ContainerDimensions;