import React from "react";
export type ValueTransformer = (value?: any) => any;
export type TransformerTrigger = "blur" | "change" | "keyDown";
export type TransformerObject = {
    /**
     * The transformer function
     */
    transformer: ValueTransformer;
    options?: {
        /**
         * The event that triggers the transformer.
         * @default "blur"
         */
        trigger?: TransformerTrigger;
        /**
         * If true, the transformer will be applied.
         * @default true
         */
        if?: boolean;
    };
};
export type TransformerType = TransformerObject[] | ValueTransformer[];
interface ValueTransformerProps {
    transformers: TransformerType;
    children: React.ReactElement;
}
/**
 * Apply transformers to the value of the input element. A transformer is a function that
 * will be applied to the value of the input element modifying the value.
 *
 * @param transformers - An array of transformers. A transformer is an object with a
 * `transformer` property, which is a function that will be applied to the value of
 * the input element, and an optional `options` property. The `options` property can
 * have a `trigger` property, which is the event that triggers the transformer, and
 * an `if` property, which is a boolean that indicates if the transformer should be
 * applied.
 * @param children - The input element to apply the transformers to as children
 *
 * @example
 * <ValueTransformer transformers={[
 *   {
 *     transformer: (value) => value.toUpperCase(),
 *     options: {
 *       trigger: "change",
 *     },
 *   },
 * ]}>
 *   <Input />
 * </ValueTransformer>
 *
 * @example
 * <ValueTransformer transformers={[
 *   {
 *     // trim the value on blur
 *     transformer: (value) => (value as string).trim(),
 *   },
 * ]}>
 *   <Input />
 * </ValueTransformer>
 */
declare function ValueTransformer({ transformers, children }: ValueTransformerProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
export default ValueTransformer;
//# sourceMappingURL=value-transformer.d.ts.map