export interface FieldState { name: string; initialValue: Value; value: Value; dirty: boolean; changed: boolean; error?: any; } export interface ValidationFunction { (value: Value, fields: FieldStates): any; } export interface FieldDescriptor extends FieldState { onChange(newValue: Value | ValueMapper): void; onBlur(): void; } export type FieldDescriptors = { [FieldPath in keyof Fields]: FieldDescriptor }; export interface ValueMapper { (value: Value): Value; } export type FieldStates = { [FieldPath in keyof Fields]: FieldState };