import { ICustomer } from '../../types/customer.types'; import { ZenskarError } from '../../types/elements'; import { PaymentElementFormResult } from '../../types/elements/add-payment-method.types'; /** * Main hook for interacting with Zenskar * Provides access to context data and methods for performing actions * * this is the primary way to interact with Zenskar * * @returns Object containing context data and action methods * * @example * ```tsx * const zenskar = useZenskar() * * // Access context data * console.log(zenskar.customerId, zenskar.businessEntityId) * * // Perform actions * const { data, error } = await zenskar.updateBillingInformation() * * // Fetch data using new service methods * const { data: customer } = await zenskar.customer.details() * const { data: paymentMethods } = await zenskar.customer.paymentMethods() * const { data: invoices } = await zenskar.customer.invoices() * const { data: customerDetails } = await zenskar.customer.details() * const { data: contract } = await zenskar.customer.contractById('contract-uuid-123') * const { data: contracts } = await zenskar.customer.contracts() * const { data: payments } = await zenskar.customer.payments() * ``` */ export declare const useZenskar: () => { /** Customer ID for the current user */ customerId: import('../../types/customer.types').CustomerType; /** Organization ID from Zenskar dashboard */ organisationId: string; /** Business entity ID - automatically fetched and guaranteed to exist */ businessEntityId: import('../../types/customer.types').BusinessEntityType; /** Full customer object with all details */ customerData: ICustomer | undefined; /** Update billing information using mounted billing element */ updateBillingInformation: () => Promise<{ data?: ICustomer; error?: ZenskarError; }>; /** Add payment method using mounted add payment method element */ addPaymentMethod: () => Promise<{ data?: PaymentElementFormResult["data"]; error?: ZenskarError; }>; /** Customer-related data fetching methods */ customer: { details: () => Promise<{ data: ICustomer; }>; updateCustomerDetails: (payload: ICustomer) => Promise<{ data: ICustomer; }>; addCustomer: (payload: ICustomer) => Promise<{ data: ICustomer; }>; paymentMethods: () => Promise<{ data: import('../../types/customer.types').ICustomerPaymentMethodsList; }>; setDefaultPaymentMethod: (paymentMethodId: string) => Promise<{ data: { message: string; }; }>; invoices: (params?: import('../..').ServiceParams) => Promise<{ data: import('../..').InvoicesList; }>; payments: (params?: import('../..').ServiceParams) => Promise<{ data: import('../..').PaymentsList; }>; contracts: (params?: import('../..').ServiceParams) => Promise<{ data: import('../..').ContractList; }>; contractById: (contractId: string) => Promise<{ data: import('../..').Contract; }>; transactions: (params?: import('../..').ServiceParams) => Promise<{ data: import('../..').PaymentsList; }>; }; } | null;