File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+
3
+ export interface Dimensions {
4
+ top : number ;
5
+ right : number ;
6
+ bottom : number ;
7
+ left : number ;
8
+ width : number ;
9
+ height : number ;
10
+ }
11
+
12
+ export interface ContainerDimensionsProps {
13
+ /**
14
+ * Can either be a function that's responsible for rendering children.
15
+ * This function should implement the following signature:
16
+ * ({ height, width }) => PropTypes.element
17
+ * Or a React element, with width and height injected into its props.
18
+ */
19
+ children : ( ( props : Dimensions ) => React . ReactNode ) | React . ReactNode ;
20
+ }
21
+
22
+ /**
23
+ * Component that automatically adjusts the width and height of a single child.
24
+ * Child component should not be declared as a child but should rather be specified by a `ChildComponent` property.
25
+ * All other properties will be passed through to the child component.
26
+ */
27
+ declare const ContainerDimensions : React . ComponentType < ContainerDimensionsProps > ;
28
+ export default ContainerDimensions ;
You can’t perform that action at this time.
0 commit comments