import React, { ReactHTML, DetailedHTMLProps, HTMLAttributes, ReactElement } from 'react';
declare type Options = {
mode?: "oneline" | "multiline" | "box" | "boxoneline" | undefined;
minFontSizePx?: number | undefined;
maxFontSizePx?: number | undefined;
fontSizePrecisionPx?: number | undefined;
};
/**
* Make text fit container, prevent overflow and underflow.
*
* Adjusts the font size of `innerEl` so that it precisely fills `containerEl`.
*/
declare function updateTextSize({ innerEl, containerEl, mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, }: Options & {
innerEl: HTMLElement;
containerEl: HTMLElement;
}): void;
declare type DisconnectableFunction = {
(): void;
disconnect: () => void;
};
/**
* Make text fit container, prevent overflow and underflow.
*
* Adjusts the font size of `innerEl` so that it precisely fills `containerEl`.
*
* Throttles all invocations to next animation frame (through
* `requestAnimationFrame`).
*
* Sets up a `ResizeObserver` to automatically run `autoTextSize` when
* `containerEl` resizes. Call `disconnect()` when done to disconnect the resize
* observer to prevent memory leaks.
*/
declare function autoTextSize({ innerEl, containerEl, mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, }: Options & {
innerEl: HTMLElement;
containerEl: HTMLElement;
}): DisconnectableFunction;
/**
* Make text fit container, prevent overflow and underflow.
*/
declare function AutoTextSize({ mode, minFontSizePx, maxFontSizePx, fontSizePrecisionPx, as: Comp, // TODO: The `...rest` props are not typed to reflect another `as`.
children, ...rest }: Options & {
as?: keyof ReactHTML | React.ComponentType;
} & DetailedHTMLProps, HTMLDivElement>): ReactElement;
export { AutoTextSize, autoTextSize, updateTextSize };