Add exports to other non default interfaces for Field props (#20964)

This commit is contained in:
Bel
2017-10-27 11:13:39 -07:00
committed by Sheetal Nandi
parent 02dddda489
commit 11f8e48772
2 changed files with 9 additions and 5 deletions
+8 -5
View File
@@ -16,15 +16,15 @@ export type Formatter = (value: any, name: string) => any;
export type Parser = (value: any, name: string) => any;
export type Validator = (value: any, allValues?: any, props?: any) => any;
interface EventHandler<Event> {
export interface EventHandler<Event> {
(event: Event): void;
}
interface EventOrValueHandler<Event> extends EventHandler<Event> {
export interface EventOrValueHandler<Event> extends EventHandler<Event> {
(value: any): void;
}
interface CommonFieldProps {
export interface CommonFieldProps {
name: string;
onBlur: EventOrValueHandler<FocusEvent<any>>;
onChange: EventOrValueHandler<ChangeEvent<any>>;
@@ -33,7 +33,7 @@ interface CommonFieldProps {
onFocus: EventHandler<FocusEvent<any>>;
}
interface BaseFieldProps<P = {}> extends Partial<CommonFieldProps> {
export interface BaseFieldProps<P = {}> extends Partial<CommonFieldProps> {
name: string;
component?: ComponentType<P> | "input" | "select" | "textarea",
format?: Formatter | null;
@@ -53,7 +53,10 @@ export interface GenericField<P> extends Component<BaseFieldProps<P> & P> {
getRenderedComponent(): Component<WrappedFieldProps & P>;
}
type GenericFieldHTMLAttributes = InputHTMLAttributes<HTMLInputElement> | SelectHTMLAttributes<HTMLSelectElement> | TextareaHTMLAttributes<HTMLTextAreaElement>;
export type GenericFieldHTMLAttributes =
InputHTMLAttributes<HTMLInputElement> |
SelectHTMLAttributes<HTMLSelectElement> |
TextareaHTMLAttributes<HTMLTextAreaElement>;
export class Field<P = GenericFieldHTMLAttributes> extends Component<BaseFieldProps<P> & P> implements GenericField<P> {
dirty: boolean;
+1
View File
@@ -14,6 +14,7 @@ import {
WrappedFieldProps,
Fields,
GenericFields,
BaseFieldProps,
WrappedFieldsProps,
FieldArray,
GenericFieldArray,