UNPKG

react-ocean-forms

Version:
16 lines (15 loc) 839 B
/** * Copyright (c) 2018-present, Umweltbundesamt GmbH * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import { PropsOf, Subtract } from '../../utils'; import { IValidatedComponentProps, IValidationProps } from './withValidation.types'; declare type WrappedValidatedComponentProps<TComp> = Subtract<JSX.LibraryManagedAttributes<TComp, PropsOf<TComp>>, IValidationProps> & IValidatedComponentProps; /** * Higher order component for validation */ export declare const withValidation: <TComp extends React.ComponentType<TProps>, TProps extends IValidationProps<import("../withField").TBasicFieldValue> = PropsOf<TComp>>(component: TComp) => React.ComponentType<WrappedValidatedComponentProps<TComp>>; export {};