1 | import { PureComponent, Validator, Requireable } from 'react';
|
2 | import * as PropTypes from 'prop-types';
|
3 |
|
4 | export type Size = {
|
5 | height: number;
|
6 | width: number;
|
7 | };
|
8 | export type Dimensions = Size;
|
9 |
|
10 | export type AutoSizerProps = {
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 | children: (props: Size) => React.ReactNode;
|
17 | |
18 |
|
19 |
|
20 |
|
21 | className?: string | undefined;
|
22 | |
23 |
|
24 |
|
25 |
|
26 | defaultHeight?: number | undefined;
|
27 | |
28 |
|
29 |
|
30 |
|
31 | defaultWidth?: number | undefined;
|
32 |
|
33 | disableHeight?: boolean | undefined;
|
34 |
|
35 | disableWidth?: boolean | undefined;
|
36 |
|
37 | nonce?: string | undefined;
|
38 |
|
39 | onResize?: ((info: Size) => any) | undefined;
|
40 | /**
|
41 | * Optional custom inline style to attach to root AutoSizer element.
|
42 | * This is an advanced property and is not typically necessary.
|
43 | */
|
44 | style?: React.CSSProperties | undefined;
|
45 | /**
|
46 | * PLEASE NOTE
|
47 | * The [key: string]: any; line is here on purpose
|
48 | * This is due to the need of force re-render of PureComponent
|
49 | * Check the following link if you want to know more
|
50 | * https://github.com/bvaughn/react-virtualized#pass-thru-props
|
51 | */
|
52 | [key: string]: any;
|
53 | };
|
54 | /**
|
55 | * Decorator component that automatically adjusts the width and height of a single child.
|
56 | * Child component should not be declared as a child but should rather be specified by a `ChildComponent` property.
|
57 | * All other properties will be passed through to the child component.
|
58 | */
|
59 | export class AutoSizer extends PureComponent<AutoSizerProps, Size> {
|
60 | static defaultProps: {
|
61 | onResize: () => void;
|
62 | disableHeight: false;
|
63 | disableWidth: false;
|
64 | style: {};
|
65 | };
|
66 |
|
67 | constructor(props: AutoSizerProps);
|
68 |
|
69 | componentDidMount(): void;
|
70 |
|
71 | componentWillUnmount(): void;
|
72 |
|
73 | render(): JSX.Element;
|
74 | }
|
75 |
|
76 | export default AutoSizer;
|