import type { XOR } from "ts-xor";
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
import type { FocusEvents, HTMLInputBaseProps, KeyboardEvents, MouseEvents, RebuiltInputCommonProps } from "../sharedHelpers/types";
export interface RowRange {
    min: number;
    max: number;
}
/**
 * Character length constraint for inputs.
 * Only extend this for text-based inputs where character limits make sense.
 */
interface InputLengthConstraint {
    /**
     * The maximum number of characters supported by the input.
     * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength}
     */
    readonly maxLength?: number;
}
export type InputTextVersion = 1 | 2 | undefined;
/**
 * Experimental version 2 of the InputText component.
 * Do not use unless you have talked with Atlantis first.
 */
export interface InputTextRebuiltProps extends HTMLInputBaseProps, MouseEvents<HTMLInputElement | HTMLTextAreaElement>, FocusEvents<HTMLInputElement | HTMLTextAreaElement>, KeyboardEvents<HTMLInputElement | HTMLTextAreaElement>, RebuiltInputCommonProps, InputLengthConstraint {
    /**
     * When false, the placeholder text only serves as a standard placeholder and
     * disappears when the user types, instead of floating above the value as a
     * mini label.
     * @default true
     */
    readonly showMiniLabel?: boolean;
    /**
     * Use this when you're expecting a long answer.
     */
    readonly multiline?: boolean;
    /**
     * Specifies the visible height of a long answer form field. Can be in the
     * form of a single number to set a static height, or an object with a min
     * and max keys indicating the minimum number of visible rows, and the
     * maximum number of visible rows.
     */
    readonly rows?: number | RowRange;
    /**
     * Toolbar to render content below the input.
     */
    readonly toolbar?: FormFieldProps["toolbar"];
    /**
     * Determines the visibility of the toolbar.
     */
    readonly toolbarVisibility?: FormFieldProps["toolbarVisibility"];
    /**
     * The current value of the input.
     */
    readonly value: string;
    /**
     * Custom onChange handler that provides the new value as the first argument.
     */
    readonly onChange?: (newValue: string, event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
    /**
     * @deprecated Use `onKeyDown` or `onKeyUp` instead.
     */
    readonly onEnter?: FormFieldProps["onEnter"];
}
interface BaseProps extends CommonFormFieldProps, Pick<FormFieldProps, "autofocus" | "maxLength" | "readonly" | "autocomplete" | "keyboard" | "onEnter" | "onFocus" | "onBlur" | "onChange" | "inputRef" | "validations" | "defaultValue" | "prefix" | "suffix" | "toolbar" | "toolbarVisibility" | "version"> {
    multiline?: boolean;
}
export interface InputTextRef {
    insert(text: string): void;
    blur(): void;
    focus(): void;
    scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
}
interface MultilineProps extends BaseProps {
    /**
     * Use this when you're expecting a long answer.
     */
    readonly multiline: true;
    /**
     * Specifies the visible height of a long answer form field. Can be in the
     * form of a single number to set a static height, or an object with a min
     * and max keys indicating the minimum number of visible rows, and the
     * maximum number of visible rows.
     */
    readonly rows?: number | RowRange;
}
/**
 * @deprecated Use the v2 InputText component instead (version={2}).
 */
export type InputTextLegacyProps = XOR<BaseProps, MultilineProps>;
export {};
