From 0a28d8adca5a351f5813bcedd1d21c86c1f484a4 Mon Sep 17 00:00:00 2001 From: Mikosko Date: Thu, 11 May 2017 10:24:59 +0200 Subject: [PATCH] Add OnSubmit and OnError callback to index.d.ts --- index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 34ee483..4990651 100644 --- a/index.d.ts +++ b/index.d.ts @@ -53,11 +53,14 @@ export interface FieldProps { export class Field extends React.Component { } +export type OnSubmitCallback = (s: {name: string, values: {[key: string]: any}}) => void; +export type OnErrorCallback = (e: {name: string, errors: {[key: string]: any}}) => void; + export interface FormProps { method?: "POST" | "GET" | "PUT" | "DELETE"; name: String | string; - onError?: (e: {name: string, errors: {[key: string]: any}}) => void; - onSubmit?: (s: {name: string, values: {[key: string]: any}}) => void; + onError?: OnErrorCallback; + onSubmit?: OnSubmitCallback; validations?: {[key: string]: Validation[]}; }