import { ChangeEventHandler, FocusEventHandler } from 'react' import type { NonUndefined } from 'react-hook-form' import { FormControl } from '../../../types/form' type OptionalActions = { onChange?: (value: any) => void | ChangeEventHandler onBlur?: (value?: any) => void | FocusEventHandler } export type DebouncedFunction = NonUndefined export type WithControllerProps = FormControl & T & OptionalActions & { /** * Per-instance override for the factory-time `shouldDebounce` flag. * `true` debounces the consumer-side onChange (RHF state still updates synchronously). * Leave undefined to fall back to the factory default. */ shouldDebounce?: boolean }