UNPKG

@coursebuilder/commerce-next

Version:

Commerce Functionality for Course Builder with Next.js

87 lines 3.62 kB
import * as React from 'react'; import { FieldErrors, useForm, type UseFormRegister, type UseFormWatch } from 'react-hook-form'; import { PurchaseUserTransfer } from '@coursebuilder/core/schemas'; type PurchaseTransferContextType = { purchaseUserTransfers: PurchaseUserTransfer[]; bulkCouponId?: string; cancelPurchaseTransfer: (input: { purchaseUserTransferId: string; }) => Promise<any>; initiatePurchaseTransfer: (input: { email: string; purchaseUserTransferId: string; }) => Promise<any>; onTransferInitiated: () => Promise<any>; }; export declare const PurchaseTransferProvider: React.FC<PurchaseTransferContextType & { children: React.ReactNode; }>; export declare const usePurchaseTransfer: () => PurchaseTransferContextType; type PurchaseTransferStatusContextType = { purchaseUserTransfer: PurchaseUserTransfer; }; export declare const PurchaseTransferStatusProvider: React.FC<PurchaseTransferStatusContextType & { children: React.ReactNode; }>; export declare const usePurchaseTransferStatus: () => PurchaseTransferStatusContextType; type RootProps = PurchaseTransferContextType & { className?: string; asChild?: boolean; }; declare const Root: React.FC<React.PropsWithChildren<RootProps>>; type PurchaseTransferFormContextType = { register: UseFormRegister<PurchaseTransferFormData>; handleSubmit: ReturnType<typeof useForm>['handleSubmit']; onSubmit: (data: PurchaseTransferFormData) => void; errors: FieldErrors<PurchaseTransferFormData>; watch: UseFormWatch<PurchaseTransferFormData>; }; export declare const PurchaseTransferFormProvider: React.FC<PurchaseTransferFormContextType & { children: React.ReactNode; }>; export declare const usePurchaseTransferForm: () => PurchaseTransferFormContextType; type PurchaseTransferFormData = { email: string; }; declare const Header: ({ children, className, }: { children?: React.ReactNode; className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const Form: ({ className, children, }: { className?: string; children?: React.ReactNode; }) => import("react/jsx-runtime").JSX.Element; declare const InputLabel: ({ children, className, }: { children?: React.ReactNode; className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const InputEmail: ({ className }: { className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const SubmitButton: ({ className, ...props }: { className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const Title: ({ children, asChild, className, }: { children?: React.ReactNode; asChild?: boolean; className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const Description: ({ children, className, }: { children?: React.ReactNode; className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const Cancel: ({ className }: { className?: string; }) => import("react/jsx-runtime").JSX.Element; declare const Available: ({ children, className, }: { children?: React.ReactNode; className?: string; }) => import("react/jsx-runtime").JSX.Element | null; declare const Initiated: ({ children }: { children?: React.ReactNode; }) => import("react/jsx-runtime").JSX.Element | null; declare const Completed: ({ children }: { children?: React.ReactNode; }) => import("react/jsx-runtime").JSX.Element | null; export { Root, Header, Form, Completed, Initiated, Available, Title, Description, Cancel, InputLabel, InputEmail, SubmitButton, }; //# sourceMappingURL=purchase-transfer.d.ts.map