import { AttributeEditorProps, NonCancelableCustomEvent } from '@cloudscape-design/components'; import { Control, FieldArray, FieldArrayPath, FieldValues, UseFieldArrayAppend, UseFieldArrayRemove } from 'react-hook-form'; /** * A field definition for one row in the named field array. * * `key` is the actual row property name used to locate validation errors. * Prefer it to `label`, which is presentation text and may be localized. */ export interface Definition extends Omit, "errorText"> { label: string; key?: keyof TRow & string; errorName?: (item: TRow, index: number) => string; } export interface CAttributeEditorProps = FieldArrayPath> extends Omit>, "items" | "onRemoveButtonClick" | "onAddButtonClick"> { name: TName; control: Control; definition: Definition>[]; defaultValue?: FieldArray; handleState?: boolean; onRemoveButtonClick?: (event: NonCancelableCustomEvent, remove: UseFieldArrayRemove) => void; onAddButtonClick?: (event: NonCancelableCustomEvent, append: UseFieldArrayAppend) => void; } declare const CAttributeEditor: = FieldArrayPath>({ name, control, definition, defaultValue, handleState, onAddButtonClick, onRemoveButtonClick, ...props }: CAttributeEditorProps) => import('react').JSX.Element; export default CAttributeEditor;