UNPKG

react-ocean-forms

Version:
17 lines (16 loc) 862 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 } from '../withValidation'; import { IBaseFieldProps, IFieldComponentProps } from './Field'; declare type WrappedValidatedComponentProps<TComp> = Subtract<JSX.LibraryManagedAttributes<TComp, PropsOf<TComp>>, IFieldComponentProps> & IBaseFieldProps & IValidatedComponentProps; /** * Higher order component for validation */ export declare const withField: <TComp extends React.ComponentType<TProps>, TProps extends IFieldComponentProps = PropsOf<TComp>>(component: TComp) => React.ComponentType<WrappedValidatedComponentProps<TComp>>; export {};