mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add exports to other non default interfaces for Field props (#20964)
This commit is contained in:
Vendored
+8
-5
@@ -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;
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
WrappedFieldProps,
|
||||
Fields,
|
||||
GenericFields,
|
||||
BaseFieldProps,
|
||||
WrappedFieldsProps,
|
||||
FieldArray,
|
||||
GenericFieldArray,
|
||||
|
||||
Reference in New Issue
Block a user