@betterstore/react
Version:
25 lines (24 loc) • 1.54 kB
TypeScript
import { CheckoutFormData } from '../components/checkout-embed/checkout-schema';
export type CheckoutStep = "customer" | "shipping" | "payment";
export interface CheckoutFormStore {
formData: Partial<CheckoutFormData>;
setFormData: (formData: Partial<CheckoutFormData>) => void;
step: CheckoutStep;
setStep: (step: CheckoutStep) => void;
checkoutId: string;
setCheckoutId: (checkoutId: string) => void;
}
export declare const useCheckoutFormStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CheckoutFormStore>, "setState" | "persist"> & {
setState(partial: CheckoutFormStore | Partial<CheckoutFormStore> | ((state: CheckoutFormStore) => CheckoutFormStore | Partial<CheckoutFormStore>), replace?: false | undefined): unknown;
setState(state: CheckoutFormStore | ((state: CheckoutFormStore) => CheckoutFormStore), replace: true): unknown;
persist: {
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CheckoutFormStore, CheckoutFormStore, unknown>>) => void;
clearStorage: () => void;
rehydrate: () => Promise<void> | void;
hasHydrated: () => boolean;
onHydrate: (fn: (state: CheckoutFormStore) => void) => () => void;
onFinishHydration: (fn: (state: CheckoutFormStore) => void) => () => void;
getOptions: () => Partial<import('zustand/middleware').PersistOptions<CheckoutFormStore, CheckoutFormStore, unknown>>;
};
}>;
export declare const resetFormStore: (formData: Partial<CheckoutFormData>) => void;