UNPKG

@itwin/core-react

Version:

A react component library of iTwin.js UI general purpose components

43 lines 2.37 kB
/** @packageDocumentation * @module Utilities */ import * as React from "react"; /** Uses ResizeObserver API to notify about element bound changes. * @internal */ export declare function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void): (instance: Element | null) => void; /** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly * handles observing element in pop-out/child windows. * @internal */ export declare function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void): (number | undefined)[]; /** Prop the ElementResizeObserver sends to the render function. * @public * @deprecated in 4.16.0. Interface used in a deprecated component {@link ElementResizeObserver}. */ export interface RenderPropsArgs { width?: number; height?: number; } /** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles * observing element in pop-out/child windows. * @public * @deprecated in 4.15.0. Used internally. */ export declare function ElementResizeObserver({ watchedElement, render, }: { watchedElement: HTMLElement | null; render: (props: RenderPropsArgs) => React.ReactElement; }): React.ReactElement<any, string | React.JSXElementConstructor<any>>; /** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report * size changes from its parent container. * @public * @deprecated in 4.15.0. Please use third party packages. */ export declare function ResizableContainerObserver({ onResize, children, }: { onResize: (width: number, height: number) => void; children?: React.ReactNode; }): React.JSX.Element; //# sourceMappingURL=useResizeObserver.d.ts.map