import { type ComponentPropsWithoutRef, type ReactNode } from "react";
import { type TextareaCommand } from "../../hooks/useTextareaCommands";
import { type TextareaTool } from "../../hooks/useTextareaTools";
export type TextareaSize = "sm" | "md" | "lg";
/** User-resize handle direction. Mirrors the native CSS `resize`
 *  property. Pass `false` (legacy) and we map it to `"none"`. */
export type TextareaResize = "vertical" | "horizontal" | "both" | "none" | boolean;
type TextareaPropsBase = Omit<ComponentPropsWithoutRef<"textarea">, "size" | "prefix">;
export interface TextareaProps extends TextareaPropsBase {
    /** Visible label — accepts rich content. */
    label?: ReactNode;
    /** Boolean error flag — pairs with `errorMessage`. (Back-compat with v1.) */
    error?: boolean;
    /** Error message. When set with `error={true}` renders below the input
     *  with `role="alert"` and tints the border. */
    errorMessage?: ReactNode;
    /** Helper text rendered below the field when no error is set. */
    helperText?: ReactNode;
    /** User-drag resize handle direction. Default `"vertical"`.
     *
     *  - `"vertical"` — only the bottom edge is draggable (most common).
     *  - `"horizontal"` — only the right edge.
     *  - `"both"` — corner handle, both axes.
     *  - `"none"` — no user resize (auto-grow still works if enabled).
     *  - Legacy `boolean` — `true` ≡ `"vertical"`, `false` ≡ `"none"`.
     */
    resize?: TextareaResize;
    /** Auto-grow the textarea as the user types, capped at `maxRows`.
     *  Default `false`. When enabled the user-drag `resize` handle is
     *  typically set to `"none"` so the two systems don't fight. */
    autoResize?: boolean;
    /** Minimum visible rows (only when `autoResize` is on). Default `rows`. */
    minRows?: number;
    /** Maximum visible rows before the textarea scrolls (only when
     *  `autoResize` is on). Default `Infinity`. */
    maxRows?: number;
    /** Hard pixel ceiling on the textarea's height — applied as inline
     *  `max-height`. Pair with `autoResize` to cap the auto-grow OR use
     *  alone to limit how tall the user can drag the resize handle. */
    maxHeight?: number | string;
    /** Hard pixel ceiling on the textarea's width — applied as inline
     *  `max-width`. Useful when `resize="horizontal"` or `"both"`. */
    maxWidth?: number | string;
    /** Minimum pixel floor for the textarea's height. */
    minHeight?: number | string;
    /** Minimum pixel floor for the textarea's width. */
    minWidth?: number | string;
    maxLength?: number;
    size?: TextareaSize;
    rows?: number;
    commands?: TextareaCommand[];
    /** Trigger character for the command palette. Default `"/"`. */
    commandTrigger?: string;
    /** Show a floating Copy / Cut toolbar over a non-empty selection.
     *  Default `false`. */
    selectionToolbar?: boolean;
    /** Custom actions appended to the selection toolbar's built-in
     *  Copy / Cut. Each action receives the live selected text and the
     *  selection helpers from `useTextareaSelection`. */
    selectionActions?: TextareaSelectionAction[];
    /** Always-visible toolbar of tools that act on the textarea content.
     *  Compose from the `textareaTools` factory (bold, italic, code,
     *  heading, link, undo, …) and / or pass custom `TextareaTool`
     *  objects. The toolbar uses `useTextareaTools` under the hood —
     *  consumers can also call the hook directly to roll their own UI. */
    tools?: TextareaTool[];
    /** Where the tools toolbar sits relative to the field. Default
     *  `"top"`. */
    toolbarPosition?: "top" | "bottom";
}
export interface TextareaSelectionAction {
    id: string;
    label: ReactNode;
    icon?: ReactNode;
    /** Called when the user clicks the action. Receives the live
     *  selection text and the helpers from `useTextareaSelection`. */
    onAction: (selection: string, helpers: {
        replace: (s: string) => void;
        wrap: (open: string, close?: string) => void;
        copy: () => Promise<boolean>;
        cut: () => Promise<boolean>;
    }) => void;
}
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
export {};
//# sourceMappingURL=Textarea.d.ts.map