import type React from 'react'; import { type ChangeEvent } from 'react'; import { type TextBoxProps } from '../../../../TextBox'; type UseBasePickerValueControllerOptions = { /** * The value of the BasePicker component. */ value: Date | undefined; /** * The default value of the BasePicker component. */ defaultValue: Date | undefined; /** * The format of the BasePicker component, in ISO 8601 format. */ format: string; /** * Custom function to format a Date object to a string for display. * When provided, this function will be used instead of the default dayjs formatting. */ customFormatValue?: (date: Date) => string; /** * Callback when the value of the BasePicker component is changed. * * @param value - The new value. * * @param event - The event that triggered the change, if triggered from TextBox * * @default undefined */ onChange?: (value: Date | undefined, event: ChangeEvent | React.MouseEvent) => void; /** * Callback when the value of the popover component is changed. * * @param value - The new value. * * @default undefined */ onPickerPopoverChange?: (value: Date | undefined, event: React.MouseEvent) => void; /** * User's onBlur callback. * Note: This is no longer used in useBasePickerValueController as onBlur is now handled * by the Popover component to avoid duplicate calls. * * @param event - The blur event * * @default undefined */ onBlur?: TextBoxProps['onBlur']; /** * Whether the popover is currently open. * Note: This is no longer used in useBasePickerValueController. */ isPopoverOpen: boolean; /** * Ref to the trigger element (wrapper containing both input and calendar icon). * Note: This is no longer used in useBasePickerValueController. */ triggerRef: React.RefObject; }; /** * Controller for the value of the BasePicker component. * * @param options - The options for the controller. * * @returns The props for the input element and the picker popover. */ export declare function useBasePickerValueController({ value, defaultValue, format, customFormatValue, onChange, onPickerPopoverChange, }: UseBasePickerValueControllerOptions): { inputProps: { value: string; onChange: (event: React.ChangeEvent) => void; onBlur: (event: React.FocusEvent) => void; onClear: (event: React.MouseEvent) => void; }; pickerPopoverProps: { value: Date | undefined; onChange: (newValue: Date | undefined, event: React.MouseEvent) => void; }; }; export {};