import React$1 from "react"; import { JBSwitchEventType, JBSwitchWebComponent, ValidationValue } from "jb-switch"; import { JBElementStandardProps } from "jb-core/react"; //#region modules/jb-switch/react/lib/events-hook.d.ts type EventProps = { /** * when component loaded, in most cases component is already loaded before react mount so you dont need this but if you load web-component dynamically with lazy load it will be called after react mount */ onLoad?: (e: JBSwitchEventType) => void; /** * when all property set and ready to use, in most cases component is already loaded before react mount so you dont need this but if you load web-component dynamically with lazy load it will be called after react mount */ onInit?: (e: JBSwitchEventType) => void; onChange?: (e: JBSwitchEventType) => void; onBeforeChange?: (e: JBSwitchEventType) => 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-switch/react/lib/attributes-hook.d.ts type JBSwitchAttributes = { validationList?: ValidationItem[] | null; isLoading?: boolean | null; disabled?: boolean | null; required?: boolean | null; trueTitle?: string | null; falseTitle?: string | null; }; //#endregion //#region modules/jb-switch/react/lib/module-declaration.d.ts declare module "react" { namespace JSX { interface IntrinsicElements { 'jb-switch': JBSwitchType; } interface JBSwitchType extends React.DetailedHTMLProps, JBSwitchWebComponent> { class?: string; name?: string; "true-title"?: string; "false-title"?: string; value?: boolean; initialValue?: boolean; } } } //#endregion //#region modules/jb-switch/react/lib/JBSwitch.d.ts type SwitchProps = EventProps & JBSwitchAttributes & { name?: string; value?: boolean | null; initialValue?: boolean | null; }; type Props = SwitchProps & JBElementStandardProps; declare const JBSwitch: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; //#endregion export { JBSwitch, Props };