import { AnyObject, TextInputProps as TextInputProps$1, TextAreaProps as TextAreaProps$1, RadioGroupProps as RadioGroupProps$1, NumberInputProps as NumberInputProps$1, SelectProps as SelectProps$1, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, SwitchProps as SwitchProps$1 } from '@vtex/admin-ui'; export { Radio, RadioProps } from '@vtex/admin-ui'; import { UseFormReturn, RegisterOptions } from 'react-hook-form'; export { RegisterOptions, useFieldArray, useForm as useFormState } from 'react-hook-form'; import React, { ComponentPropsWithoutRef, ReactNode } from 'react'; export { yupResolver } from '@hookform/resolvers/yup'; type FormState = UseFormReturn; declare const Form: React.ForwardRefExoticComponent>; interface FormProps extends ComponentPropsWithoutRef<'form'> { state: FormState; onSubmit: (data: AnyObject) => void; } /** * React Hook for subscribe to input changes * @example * const form = useFormState() * const subscribedValue = useWatch({ * form, * name: "fieldName" * }) */ declare function useWatch(props: UseWatchProps): any; interface UseWatchProps { /** Target form */ form: FormState; /** Name of the field */ name: string; /** Default value for useWatch to return before the initial render */ defaultValue?: unknown; /** * Option to disable the subscription * @default false * */ disabled?: boolean; } type WatchState = ReturnType; /** * React Component for subscribe to input changes * @example * const form = useFormState() * * */ declare function Watch(props: WatchProps): React.JSX.Element; interface WatchProps extends UseWatchProps { children?: (props: WatchState) => ReactNode; } /** * Gets wether the field has an error * @param state form state * @param name field name */ declare function hasError(state: FormState, name: string): boolean; /** * Gets the error text of a field * @param state form state * @param name field name */ declare function getErrorText(state: FormState, name: string): string | undefined; /** * React hook that improves the field's developer experience * @example * function Field(props) { * useFieldDx(props) * // ... rest * } */ declare function useFieldDx(props: AnyObject): void; /** * Wether is dev mode */ declare function isDevMode(): boolean; /** * Displays a message to the developer with an appropriate tone * @param message dev message * @example * developerMessage({ * text: 'Text content', * tone: 'error' | 'warning' | 'neutral' * }) */ declare function developerMessage(message: DeveloperMessage): void; type DeveloperMessageTone = 'error' | 'warning' | 'neutral'; interface DeveloperMessage { /** text content */ text: string; /** message tone */ tone: DeveloperMessageTone; } interface FormFieldProps { /** * Input required state */ name: string; /** * Form state */ state: FormState; /** * Field validation */ validation?: RegisterOptions; } /** * Admin UI TextInput controlled by useFormState * @example * const form = useFormState() * * */ declare function TextInput(props: TextInputProps): React.JSX.Element; type InputHiddenProps$2 = 'name' | 'error' | 'errorText' | 'required' | 'onChange' | 'onBlur' | 'maxLength' | 'minLength' | 'max' | 'min' | 'pattern' | 'disabled' | 'value'; type InheritedProps$7 = Omit; type TextInputProps = InheritedProps$7 & FormFieldProps; /** * Admin UI TextArea controlled by useFormState * @example * const form = useFormState() * *