/// import React from "react"; import { Provider, ProviderValue } from "./context"; import EventEmitter from "./EventEmitter"; export { EventEmitter, Provider, ProviderValue }; export declare type AllowedElements = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement; export declare type Validation = [string, (value: string) => boolean]; export declare type ValidationValue = [boolean, string]; export interface ValidationEvent { value: ValidationValue; preventDefault(message: string): void; } export declare type ValidationsProp = Validation[] | undefined; export declare type ElementValue = (Pick, "value">["value"] | Pick, "value">["value"] | Pick, "value">["value"]); export declare type ValidateFn = () => boolean; export declare type PristineItFn = () => void; export interface ValidityPublicProps { validations?: ValidationsProp; value?: ElementValue; } export interface ValidityInjectedProps extends Pick { validity: { eventEmitter: EventEmitter; message?: string; pristineIt: PristineItFn; valid?: boolean; validate: ValidateFn; }; } export declare type WrappedComponentProps = P & ValidityInjectedProps & ValidityPublicProps; export declare type WrappedComponentType = React.ComponentType>; export interface ValidityConfig { subscribe?: boolean | Array<"validate" | "pristine">; } export default function validityWithConsumer(config?: ValidityConfig): (WrappedComponent: React.ComponentType>) => React.ComponentClass>;
= P & ValidityInjectedProps & ValidityPublicProps; export declare type WrappedComponentType
= React.ComponentType>; export interface ValidityConfig { subscribe?: boolean | Array<"validate" | "pristine">; } export default function validityWithConsumer(config?: ValidityConfig): (WrappedComponent: React.ComponentType>) => React.ComponentClass>;
(WrappedComponent: React.ComponentType>) => React.ComponentClass>;