///
import React from 'react';
import ResizeObserver from 'resize-observer-polyfill';
export declare type WithParentSizeProps = {
debounceTime?: number;
enableDebounceLeadingCall?: boolean;
};
declare type WithParentSizeState = {
parentWidth?: number;
parentHeight?: number;
};
export declare type WithParentSizeProvidedProps = WithParentSizeState;
export default function withParentSize(BaseComponent: React.ComponentType): {
new (props: Readonly): {
state: {
parentWidth: undefined;
parentHeight: undefined;
};
animationFrameID: number;
resizeObserver: ResizeObserver | undefined;
container: HTMLDivElement | null;
componentDidMount(): void;
componentWillUnmount(): void;
setRef: (ref: HTMLDivElement) => void;
resize: import("lodash").DebouncedFunc<({ width, height }: {
width: number;
height: number;
}) => void>;
render(): JSX.Element;
context: any;
setState(state: WithParentSizeState | ((prevState: Readonly, props: Readonly) => WithParentSizeState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & Readonly<{
children?: React.ReactNode;
}>;
refs: {
[key: string]: React.ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any;
componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
};
new (props: BaseComponentProps & WithParentSizeState, context?: any): {
state: {
parentWidth: undefined;
parentHeight: undefined;
};
animationFrameID: number;
resizeObserver: ResizeObserver | undefined;
container: HTMLDivElement | null;
componentDidMount(): void;
componentWillUnmount(): void;
setRef: (ref: HTMLDivElement) => void;
resize: import("lodash").DebouncedFunc<({ width, height }: {
width: number;
height: number;
}) => void>;
render(): JSX.Element;
context: any;
setState(state: WithParentSizeState | ((prevState: Readonly, props: Readonly) => WithParentSizeState | Pick | null) | Pick | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & Readonly<{
children?: React.ReactNode;
}>;
refs: {
[key: string]: React.ReactInstance;
};
shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any;
componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void;
};
defaultProps: {
debounceTime: number;
enableDebounceLeadingCall: boolean;
};
contextType?: React.Context | undefined;
};
export {};
//# sourceMappingURL=withParentSize.d.ts.map