react-typed-date
Version:
  
27 lines (22 loc) • 992 B
TypeScript
import { default as default_2 } from 'react';
import { JSX } from 'react/jsx-runtime';
import { RefObject } from 'react';
export declare function TypedDateInput({ value, onChange, className, ...props }: Omit<default_2.ComponentProps<"input">, "value" | "onChange" | "onKeyDown" | "ref" | "type" | "onMouseUp" | "onBlur" | "onFocus"> & TypedDateProps): JSX.Element;
declare interface TypedDateProps {
value?: Date;
onChange?: (date?: Date) => void;
format?: string;
}
export declare function useTypedDate({ value, onChange, format, }: TypedDateProps): {
inputProps: {
ref: RefObject<HTMLInputElement | null>;
type: string;
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
onMouseUp: (e: React.MouseEvent<HTMLInputElement>) => void;
onBlur: () => void;
onFocus: () => void;
};
};
export { }