react-ocean-forms
Version:
Forms components for react based on the context api.
17 lines (16 loc) • 862 B
TypeScript
/**
* 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 {};