import React$1, { ChangeEvent, DetailedHTMLProps, HTMLAttributes, PropsWithChildren, RefObject } from "react";
import { JBInputEventType, JBInputWebComponent, SizeVariants, ValidationValue } from "jb-input";
import { EventTypeWithTarget } from "jb-core";
import { JBElementStandardProps } from "jb-core/react";
//#region modules/jb-input/react/lib/events-hook.d.ts
type JBInputEvents = {
onEnter?: (e: EventTypeWithTarget) => void;
onInput?: (e: EventTypeWithTarget) => void;
onBeforeInput?: (e: EventTypeWithTarget) => void;
onFocus?: (e: EventTypeWithTarget) => void;
onBlur?: (e: EventTypeWithTarget) => void;
onKeyUp?: (e: EventTypeWithTarget) => void;
onKeyDown?: (e: EventTypeWithTarget) => void;
/**
* React standard onChangeEvent
*/
onChange?: React.ChangeEventHandler;
/**
* native element change event (not react change event) may used by user in some scenario
*/
onChangeNative?: (e: EventTypeWithTarget) => void;
};
export declare function useJBInputEvents(element: RefObject, props: JBInputEvents): {
onChange: (e: ChangeEvent) => void;
};
//#endregion
//#region modules/jb-validation/dist/jb-validation.d.ts
type ValidatorFunction = (value: ValidationValue) => boolean | string | Promise;
type ValidationItem = {
/**
* @property key that will be used to identify validation item
*/
key?: any;
/**
* @property validation function or regex to match value with
* @description if you want to use async validation you can return promise from validator function
* @description if you leave it empty (undefined) it will always considered as invalid (used for manual error handler like server side validation or yup , zod,... validations)
*/
validator?: RegExp | ValidatorFunction;
/**
* @property error message that will be shown if validator return false or regex failed
*/
message: string;
/**
* @property type of error (category) its optional
*/
stateType?: keyof ValidityStateFlags;
/**
* @property defer validator execution until all non-deferred validation executed.(good for async validator)
*/
defer?: boolean;
};
//#endregion
//#region modules/jb-input/react/lib/attributes-hook.d.ts
type JBInputAttributes = {
validationList?: ValidationItem[];
disabled?: boolean;
required?: boolean | string;
};
export declare function useJBInputAttribute(element: RefObject, props: JBInputAttributes): void;
//#endregion
//#region modules/jb-input/react/lib/module-declaration.d.ts
type JBInputType = DetailedHTMLProps, JBInputWebComponent> & DirectProps;
declare module "react" {
namespace JSX {
interface IntrinsicElements {
'jb-input': JBInputType;
}
}
}
//#endregion
//#region modules/jb-input/react/lib/JBInput.d.ts
export type DirectProps = {
label?: string;
message?: string;
placeholder?: string;
size?: SizeVariants;
name?: string;
type?: string;
inputmode?: string;
error?: string;
autocomplete?: string;
value?: string | number | null;
initialValue?: string | number | null;
clearable?: boolean;
};
export declare const JBInput: React$1.ForwardRefExoticComponent & {
children?: React$1.ReactNode | undefined;
} & JBInputEvents & JBInputAttributes & DirectProps & React$1.RefAttributes>;
export type BaseProps = PropsWithChildren> & JBInputEvents & JBInputAttributes & DirectProps;
export type Props = BaseProps;
//#endregion
export type { JBInputAttributes, JBInputEventType, JBInputEvents };