import { FocusEventHandler, KeyboardEventHandler } from "react"; import { DateOrTimeInputType, NvDateInputOnChangeHandler, NvDateInputValue } from "./types"; interface DateInputControllerProps { onChange: NvDateInputOnChangeHandler; onBlur?: FocusEventHandler; /** Format string (date-fns) for the date input, no need for time input */ inputFormat: string; /** Value of input as date object for date input, or string in 'HH:mm' format for time input, or null */ value: NvDateInputValue; /** Represent character instead of missing digits */ digitPlaceholder: string; /** Type of input ("date", "time"). */ inputType: DateOrTimeInputType; /** Optional input element reference */ input?: HTMLInputElement; } /** * Custom hook for handling date input functionality. * Initializes input value based on the provided value and input type. * Handles formatting and updating the input value with digit placeholders. * Manages input events like keydown, blur, and caret position. * Provides methods to initialize and remove input events, and access input value and format placeholder. * * @param {DateInputControllerProps} onChange - Function to call when input value changes. * @param {string} inputFormat - Format string for the date input. * @param {string | Date} value - Value of the input. * @param {string} digitPlaceholder - Character to represent missing digits. * @param {DateOrTimeInputType} inputType - Type of input ("date" or "time"). * @param {HTMLInputElement} input - Optional input element reference. * @returns {Object} Object containing methods to manage input events and access input value. */ export declare const useDateInput: ({ onChange, onBlur, inputFormat, value, digitPlaceholder, inputType, }: DateInputControllerProps) => { inputRef: import("react").RefObject; handlerKeyDown: KeyboardEventHandler; handlerBlur: FocusEventHandler; }; export {};