import type { ElementType, FormEvent, HTMLAttributes, MouseEvent, ReactElement, KeyboardEvent as RKeyboardEvent } from 'react'; import { DataAttributes } from 'src/types'; type ErrorInEditing = { hasError: true; description: string; } | { hasError?: boolean; description?: string; }; export type OnEditEvent = MouseEvent | KeyboardEvent | FormEvent | RKeyboardEvent; export type InlineEditingPrimitiveProps = { loading?: boolean; onCancel?: () => void; onToggle?: (isEditionMode: boolean) => void; label: string; required?: boolean; maxLength?: number; placeholder: string; ariaLabel?: string; renderValueAs?: ElementType | ReactElement; mode: 'single' | 'multi'; /** * (Optional) Initial value displayed in component. * To set to display initial value while use this component as uncontrolled one. */ defaultValue?: string; /** * (Optional) In uncontrolled way, listen value update. * @param event change event * @param newValue new value set in */ onEdit?: (event: OnEditEvent, newValue: string) => void; /** * (Optional) Value displayed in component. * To set to use component as controlled one. */ value?: string; /** * (Optional) In controlled way, handle value update. * It must be set to use this component as controlled component. * @param newValue new value filled */ onChangeValue?: (newValue: string) => void; /** * (Optional) Default value to set edition mode. */ isEditMode?: boolean; /** * (Optional) In controlled way, value to set edition mode. */ isEditing?: boolean; /** * (Optional) In controlled way, handler to update edition mode. */ onChangeEditing?: (isEditing: boolean) => void; } & ErrorInEditing & Omit, 'className' | 'style'> & Partial; declare const InlineEditingPrimitive: import("react").ForwardRefExoticComponent>; export default InlineEditingPrimitive;