import { type ChangeEvent, type ChangeEventHandler, type ComponentPropsWithoutRef, type FormEventHandler } from 'react'; /** * Options for the useInputHasValue hook. */ export type UseInputHasValueOptions = { /** * The initial value of the input. * This is used to determine the initial hasValue state. * If both initialValue and value are provided, value takes precedence. */ initialValue?: ComponentPropsWithoutRef<'input'>['value']; /** * The controlled value of the input. * When this changes, the hasValue state will be updated accordingly. * Takes precedence over initialValue. */ value?: ComponentPropsWithoutRef<'input'>['value']; /** * Callback fired when the input's value changes. * This is triggered by the onChange event of the input element. * * @param event - The change event from the input element */ onChange?: ChangeEventHandler; /** * Callback fired when the input event occurs. * This is triggered by the onInput event of the input element. * * @param event - The input event from the input element */ onInput?: FormEventHandler; }; /** * A hook to check if the input has value or not. * Provides handlers for input and change events, and tracks the value state. * * @param options - Configuration options for the hook * * @returns Object containing: * - hasValue: Whether the input currently has a value * - handleInput: Handler for the input event * - handleChange: Handler for the change event * * @example * ```tsx * const { hasValue, handleChange, handleInput } = useInputHasValue({ * initialValue: defaultValue, * value: controlledValue, * onChange: (e) => console.log(e.target.value), * }); * ``` */ export declare const useInputHasValue: (options: UseInputHasValueOptions) => { hasValue: boolean; handleInput: (event: ChangeEvent) => void; handleChange: (event: ChangeEvent) => void; };