/** @packageDocumentation * @module Base */ import * as React from "react"; import { Rectangle, RectangleProps } from "@bentley/ui-core"; /** Properties of [[withContainIn]] HOC. * @alpha */ export interface WithContainInProps { /** Function called to determine the actual bounds of wrapped component. See: [[contain]], [[containHorizontally]], [containVertically]. */ containFn?: (componentBounds: RectangleProps, containerBounds: RectangleProps) => RectangleProps; /** Container in which the wrapped component is contained. By default contains component in viewport. */ container?: HTMLElement | null; } /** Contains the component bounds both vertically and horizontally. This is default containment method for [[withContainIn]]. * @alpha */ export declare const contain: (componentBounds: RectangleProps, containerBounds: RectangleProps) => RectangleProps; /** Contains the component bounds horizontally. * @alpha */ export declare const containHorizontally: (componentBounds: RectangleProps, containerBounds: RectangleProps) => RectangleProps; /** Contains the component bounds vertically. * @alpha */ export declare const containVertically: (componentBounds: RectangleProps, containerBounds: RectangleProps) => RectangleProps; /** HOC which will ensure, that wrapped component bounds are contained in specified container bounds. * @alpha Transfer to ui-core or remove if used with popups only. */ export declare const withContainIn: (Component: React.ComponentType) => { new (props: Readonly): { ref: React.RefObject; readonly containFn: (componentBounds: RectangleProps, containerBounds: RectangleProps) => RectangleProps; /** @internal */ getContainerBounds(): Rectangle; /** @internal */ getComponentBounds(root: HTMLElement): Rectangle; componentDidMount(): void; render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; 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: ComponentProps & WithContainInProps, context?: any): { ref: React.RefObject; readonly containFn: (componentBounds: RectangleProps, containerBounds: RectangleProps) => RectangleProps; /** @internal */ getContainerBounds(): Rectangle; /** @internal */ getComponentBounds(root: HTMLElement): Rectangle; componentDidMount(): void; render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; 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; }; contextType?: React.Context | undefined; }; //# sourceMappingURL=WithContainIn.d.ts.map