UNPKG

@open-tender/utils

Version:

A library of utils for use with Open Tender applications that utilize our cloud-based Order API.

29 lines (28 loc) 1.5 kB
/// <reference types="react" /> import { CardType, CreditCardData, CreditCardSaved, CreditCards, Customer, DonationPurchase, RequestError, RequestStatus } from '@open-tender/types'; export declare const useDonationsForm: (purchase: (data: DonationPurchase, callback?: () => void) => void, reset: () => void, setAlert: (data: { type: string; args?: unknown; }) => void, loading: RequestStatus, error: RequestError, success: boolean, customer?: Customer, creditCards?: CreditCards, includeRecaptcha?: boolean, cardData?: CreditCardData, cardType?: CardType, windowRef?: Window, kountSessionId?: string | null, requireCardholderName?: boolean) => { inputRef: import("react").MutableRefObject<HTMLInputElement | null>; submitRef: import("react").MutableRefObject<HTMLButtonElement | null>; recaptchaRef: import("react").MutableRefObject<any>; amount: string | null; handleAmount: (value: string) => void; email: string | null; handleEmail: (value: string) => void; errors: Record<string, string>; errMsg: string | null; newCardErrors: {}; submitting: boolean; isNewCard: boolean; creditCard: CreditCardSaved | null; creditCardOptions: { name: string; value: unknown; }[]; handleCreditCard: (value: string) => void; handleSubmit: (evt?: React.FormEvent<HTMLFormElement>) => void; handleReset: () => void; setErrors: import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>; };