react-web-native-sketch
Version:
[TODO: We need an overview of how this can be used via npm vs as a local package]
31 lines (30 loc) • 1.39 kB
TypeScript
import { FormHelpersState, GlobalState } from '../FormComponents/FormComponents.types';
export declare enum TypeKeys {
DISPLAY_ERRORS = "instacar/form/DISPLAY_ERRORS",
SEND_FORM_DATA = "instacar/form/SEND_FORM_DATA",
SEND_FORM_DATA_SUCCESS = "instacar/form/SEND_FORM_DATA_SUCCESS",
SEND_FORM_DATA_FAIL = "instacar/form/SEND_FORM_DATA_FAIL"
}
export interface DisplayErrorsAction {
type: TypeKeys.DISPLAY_ERRORS;
formName: string;
}
export interface SendFormDataAction {
type: TypeKeys.SEND_FORM_DATA;
formName: string;
}
export interface SendFormDataSuccessAction {
type: TypeKeys.SEND_FORM_DATA_SUCCESS;
formName: string;
response: any;
}
export interface SendFormDataFailAction {
type: TypeKeys.SEND_FORM_DATA_FAIL;
formName: string;
}
declare type ActionTypes = DisplayErrorsAction | SendFormDataAction | SendFormDataSuccessAction | SendFormDataFailAction;
export declare const formHelpers: (state: FormHelpersState | undefined, action: ActionTypes) => FormHelpersState;
export declare const displayErrors: (formName: string) => DisplayErrorsAction;
export declare const sendFormData: (formName: string, url: string, method: string, forceSend?: boolean, types?: [string, string, string] | undefined) => (dispatch: any, getState: () => GlobalState) => void;
export declare const formHasErrors: (formData: any) => boolean;
export {};