/**
 * @file useTruncation.ts
 * @input Uses React hooks, sharedResizeObserver
 * @output Exports useTruncation hook for detecting text overflow
 * @position Hook; consumed by Text.tsx, Heading.tsx
 *
 * SYNC: When modified, update:
 * - /packages/core/src/Text/Text.doc.mjs
 */
import { type RefCallback } from 'react';
export interface UseTruncationOptions {
    /**
     * Maximum number of lines before truncation.
     * 0 = no truncation, hook returns isTruncated: false
     */
    maxLines: number;
}
export interface UseTruncationReturn {
    /**
     * Ref callback to attach to the text element
     */
    ref: RefCallback<HTMLElement>;
    /**
     * Whether the text is currently truncated (overflowing)
     */
    isTruncated: boolean;
    /**
     * Full text content for tooltip display
     */
    fullText: string;
}
/**
 * Hook for detecting text overflow/truncation.
 *
 * Uses a shared ResizeObserver singleton (via observeResize/unobserveResize)
 * for efficient detection when content or container changes. A single
 * ResizeObserver instance is shared across all mounted useTruncation hooks,
 * so even hundreds of table cells only create one observer.
 *
 * - Single-line: compares scrollWidth > offsetWidth
 * - Multi-line: uses Range.getBoundingClientRect() to measure actual content
 *   height, bypassing -webkit-line-clamp's clamped scrollHeight
 *
 * @example
 * ```
 * const truncation = useTruncation({ maxLines: 2 });
 *
 * <div ref={truncation.ref} style={{ WebkitLineClamp: 2 }}>
 *   {text}
 * </div>
 *
 * {truncation.isTruncated && <Tooltip>{truncation.fullText}</Tooltip>}
 * ```
 */
export declare function useTruncation(options: UseTruncationOptions): UseTruncationReturn;
//# sourceMappingURL=useTruncation.d.ts.map