import type { ReactNode } from 'react'; import type { FieldValues } from './fields'; import type { Control } from './form'; import type { FieldPath, FieldPathValue, FieldPathValues } from './path'; import type { DeepPartialSkipArrayKey } from './utils'; export type UseWatchProps = { defaultValue?: unknown; disabled?: boolean; name?: FieldPath | FieldPath[] | readonly FieldPath[]; control?: Control; exact?: boolean; compute?: (formValues: TFieldValues) => TFieldValues; }; export type WatchDefaultValue = TFieldName extends FieldPath ? FieldPathValue : DeepPartialSkipArrayKey; export type WatchName = FieldPath | FieldPath[] | readonly FieldPath[] | undefined; export type WatchValue = TFieldName extends FieldPath[] | readonly FieldPath[] ? FieldPathValues : TFieldName extends FieldPath ? FieldPathValue : TFieldValues; export type WatchRenderValue = TComputeValue extends undefined ? WatchValue : TComputeValue; export type WatchProps, TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues, TComputeValue = undefined> = { control?: Control; /** * @deprecated This prop will be renamed to `name` in the next major release. * Use `name` instead. */ names?: TFieldName; name?: TFieldName; disabled?: boolean; exact?: boolean; defaultValue?: WatchDefaultValue; compute?: (value: WatchValue) => TComputeValue; render: (value: WatchRenderValue) => ReactNode | ReactNode[]; }; //# sourceMappingURL=watch.d.ts.map