UNPKG

@open-tender/utils

Version:

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

13 lines (12 loc) 727 B
/// <reference types="react" /> import { Address, FormFields, RequestError, RequestStatus } from '@open-tender/types'; export declare const useAddressForm: (address: Address, loading: RequestStatus, error: RequestError, update: (addressId: number, updatedData: Address, callback: () => void) => void, callback: () => void) => { fields: FormFields; data: Address; errors: Record<string, string>; submitting: boolean; handleChange: (name: string, value: string | number | boolean) => void; handleSubmit: (evt?: React.FormEvent<HTMLFormElement>) => void; submitRef: import("react").MutableRefObject<HTMLButtonElement | null>; inputRef: import("react").MutableRefObject<HTMLInputElement | null>; };