import { type ForwardRefExoticComponent, type RefAttributes, type FocusEventHandler } from 'react'; import { isEmpty } from '@commercetools-uikit/rich-text-utils'; type TBaseEvent = { target: { id?: string; name?: string; }; }; export type TChangeEvent = { target: TBaseEvent['target'] & { value: string; }; }; export type TRichTextInputProps = { /** * Focus the control when it is mounted */ isAutofocussed?: boolean; /** * Expands multiline text input initially */ defaultExpandMultilineText?: boolean; /** * Indicates the input field has an error */ hasError?: boolean; /** * Indicates the input field has warning */ hasWarning?: boolean; /** * Used as the HTML `id` attribute. */ id?: string; /** * Used as the HTML `name` attribute. */ name?: string; /** * Placeholder value to show in the input field */ placeholder: string; /** * Disables the rich text input */ isDisabled?: boolean; /** * Indicates that the rich text input is displaying read-only content */ isReadOnly?: boolean; /** * Horizontal size limit of the input fields */ horizontalConstraint?: 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 'scale' | 'auto'; /** * Called with an event containing the new value. Required when input is not read only. Parent should pass it back as value. */ onChange?: (event: TChangeEvent) => void; /** * Called when input is focused */ onFocus?: FocusEventHandler; /** * Called when input is blurred */ onBlur?: FocusEventHandler; /** * Value of the input component. */ value?: string; /** * Indicates whether the expand icon should be visible */ showExpandIcon: boolean; /** * Called when the `expand` button is clicked */ onClickExpand?: () => boolean; }; type StaticProps = { isEmpty: typeof isEmpty; isTouched: typeof isTouched; }; declare const isTouched: (touched: boolean | unknown[]) => boolean; declare const RichTextInputWithRef: ForwardRefExoticComponent> & Partial; export default RichTextInputWithRef;