import * as React from 'react'; /** * Options for {@link useAutoResizeTextarea}. */ export interface UseAutoResizeTextareaOptions { /** Whether auto-resize is active. When false, the hook is a no-op. */ autoResize: boolean; /** * Ref to the textarea to measure and resize. May point to a textarea * rendered by a component the caller does not own. */ textareaRef: React.RefObject; /** The textarea's current controlled value, if any. */ value?: React.ComponentProps<'textarea'>['value']; /** The textarea's uncontrolled default value, if any. */ defaultValue?: React.ComponentProps<'textarea'>['defaultValue']; } /** * Return value of {@link useAutoResizeTextarea}. */ export interface UseAutoResizeTextareaResult { /** True when the content's height exceeds the element's `max-height`. */ hasOverflow: boolean; /** * Schedules a re-measure and height update on the next animation frame — * the element's height is not yet updated when this returns. */ resizeToFitContent: () => void; } /** * Keeps a textarea's height synchronized with its content and container * width. * * Reads and writes only through the DOM node reached via `textareaRef`, so * auto-grow can be layered onto a text input rendered by any component, * including one that does not implement it itself. * * The resize path is triggered from several sources (input, value changes, * width changes) and deduped per frame. * * @param options - See {@link UseAutoResizeTextareaOptions}. * @returns See {@link UseAutoResizeTextareaResult}. */ export declare function useAutoResizeTextarea({ autoResize, textareaRef, value, defaultValue, }: UseAutoResizeTextareaOptions): UseAutoResizeTextareaResult; //# sourceMappingURL=useAutoResizeTextarea.d.ts.map