/** * Zooms child to fit with tap-to-zoom behavior. */ import * as React from "react"; type Bounds = { width: number; height: number; }; type Props = { children: React.ReactNode; animateHeight: boolean; disableEntranceAnimation: boolean; /** * Optional function that allows customizations in zooming. * * Defaults to just using the bounding client rect of the first DOM * element of this component. */ computeChildBounds: (parentNode: HTMLElement, parentBounds: Bounds) => Bounds; /** * Optional boolean specifying whether the component is ready to measure * or not. Defaults to true for synchronous components like tables. */ readyToMeasure: boolean; }; type DefaultProps = { animateHeight: Props["animateHeight"]; computeChildBounds: Props["computeChildBounds"]; readyToMeasure: Props["readyToMeasure"]; disableEntranceAnimation: Props["disableEntranceAnimation"]; }; type State = { visible: boolean; marginBottomPx: number; compactHeight?: number | null | undefined; expandedHeight?: number | null | undefined; scale?: number | null | undefined; zoomed: boolean; }; declare class Zoomable extends React.Component { _isMounted: boolean; _observer: MutationObserver; _measuringInitialized: boolean; _originalWidth: number | null | undefined; _node: HTMLElement; static defaultProps: DefaultProps; state: State; componentDidMount(): void; componentDidUpdate(): void; componentWillUnmount(): void; reset: () => void; /** * Calls measureAndScaleChildToFit and sets up a MutationObserver * to call measureAndScaleChildToFit if Zoomable's children change. * * If the readyToMeasure prop isn't true or if measuring has already * been initialized this method does nothing. */ maybeInitializeMeasuring(): void; stopPropagationIfZoomed: (e: React.TouchEvent) => void; measureAndScaleChildToFit(zoomed: boolean): void; handleClickIfZoomed: (e: React.MouseEvent) => void; handleClick: () => void; render(): React.ReactNode; } export default Zoomable;