import { default as default_2 } from 'react'; import { RefObject } from 'react'; /** * Fit a display headline element to an exact target width by binary-searching * the wdth variable font axis and/or letter-spacing. * * Does NOT wrap content in spans or rewrite innerHTML — only modifies * el.style.fontVariationSettings and el.style.letterSpacing directly. * * Calling applyFitWidth multiple times is idempotent: original styles are saved * on the first call and restored internally before each re-fit. * * @param el - Single-line display element (headline, pull-quote, masthead) * @param options - FitWidthOptions (merged with defaults) */ export declare function applyFitWidth(el: HTMLElement, options?: FitWidthOptions): void; /** Options controlling the fitWidth effect */ export declare interface FitWidthOptions { /** * Target width to fill. Default: 'container' * * - **'container'** — fill the parent element's getBoundingClientRect().width (sub-pixel float, transform-aware) * - **number** — exact pixel target * - **HTMLElement** — match the rendered width of another element */ target?: 'container' | number | HTMLElement; /** * Which strategy to use. Default: 'auto' * * - **'auto'** — try the wdth axis first (if available), fall back to letter-spacing * - **'axis'** — wdth axis only (letter-spacing is set to 0 first) * - **'tracking'** — letter-spacing only (font-variation-settings left unchanged) */ prefer?: 'auto' | 'axis' | 'tracking'; /** * Variable font axis tag to adjust when prefer is 'auto' or 'axis'. Default: 'wdth' */ axis?: string; /** Minimum axis value for the binary search. Default: 75 */ axisMin?: number; /** Maximum axis value for the binary search. Default: 125 */ axisMax?: number; /** Maximum absolute letter-spacing in em (clamped to ±this value). Default: 0.3 */ maxTracking?: number; /** Convergence tolerance in pixels — search stops when gap is within this value. Default: 0.5 */ tolerance?: number; /** * When true, checks window.matchMedia('(prefers-reduced-motion: reduce)') before fitting. * If the user has requested reduced motion, applyFitWidth returns early without modifying * letter-spacing or font-variation-settings. Default: false. */ respectReducedMotion?: boolean; } /** * Drop-in component that binary-searches the wdth axis and/or letter-spacing * to make the headline fill a target width. Forwards the ref to the root element * and passes all standard HTML/ARIA attributes through to the rendered element. */ export declare const FitWidthText: default_2.ForwardRefExoticComponent>; /** * Props for FitWidthText. * Extends FitWidthOptions for algorithm configuration plus standard HTML attributes * so consumers can pass id, aria-*, role, event handlers, etc. * Note: `as` is a component-level prop and is not part of FitWidthOptions. */ declare interface FitWidthTextProps extends FitWidthOptions, default_2.HTMLAttributes { /** Content to render inside the element */ children: default_2.ReactNode; /** Additional CSS class names */ className?: string; /** Inline style overrides */ style?: default_2.CSSProperties; /** HTML element to render. Default: 'h1' */ as?: default_2.ElementType; } /** * Remove fitWidth styles and restore the element to its original inline styles. * No-op if applyFitWidth was never called on this element. * * @param el - The element previously adjusted by applyFitWidth */ export declare function removeFitWidth(el: HTMLElement): void; /** * React hook that binary-searches the wdth axis and/or letter-spacing to make * the ref'd element fill a target width. Re-runs on container resize and after * fonts finish loading. Cleans up on unmount. * * @param options - FitWidthOptions (merged with defaults inside applyFitWidth) * @returns A MutableRefObject to attach to the target headline element */ export declare function useFitWidth(options?: FitWidthOptions): RefObject; export { }