@open-tender/utils
Version:
A library of utils for use with Open Tender applications that utilize our cloud-based Order API.
14 lines (13 loc) • 883 B
TypeScript
/// <reference types="react" />
import { LoginData, RequestError, RequestStatus } from '@open-tender/types';
export declare const useLoginForm: (loading: RequestStatus, error: RequestError, login: (email: string, password?: string, recaptcha_token?: string) => void, includeRecaptcha: boolean | undefined, callback?: () => void, showPassword?: boolean, requiredEmail?: string) => {
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
recaptchaRef: import("react").MutableRefObject<any>;
fields: import("@open-tender/types").FormFieldType[];
data: LoginData;
errors: Record<string, string>;
submitting: boolean;
handleChange: (name: string, value: string | number | boolean) => void;
handleSubmit: (evt?: React.FormEvent<HTMLFormElement>) => Promise<void>;
};