jb-input
Version:
input web component with built in validation
15 lines (14 loc) • 943 B
TypeScript
import { type EventTypeWithTarget } from "jb-core";
import { RefObject } from "react";
import { type JBInputWebComponent } from "jb-input";
export type JBInputEvents<TElement extends JBInputWebComponent> = {
onEnter?: (e: EventTypeWithTarget<CustomEvent, TElement>) => void;
onInput?: (e: EventTypeWithTarget<InputEvent, TElement>) => void;
onBeforeinput?: (e: EventTypeWithTarget<InputEvent, TElement>) => void;
onFocus?: (e: EventTypeWithTarget<FocusEvent, TElement>) => void;
onBlur?: (e: EventTypeWithTarget<FocusEvent, TElement>) => void;
onKeyup?: (e: EventTypeWithTarget<KeyboardEvent, TElement>) => void;
onKeydown?: (e: EventTypeWithTarget<KeyboardEvent, TElement>) => void;
onChange?: (e: EventTypeWithTarget<Event, TElement>) => void;
};
export declare function useJBInputEvents<TElement extends JBInputWebComponent>(element: RefObject<TElement>, props: JBInputEvents<TElement>): void;