UNPKG

autumn-js

Version:
22 lines (19 loc) 1.03 kB
import { b as ClientCreateReferralCodeParams, s as CreateReferralCodeResponse, k as ClientRedeemReferralCodeParams, R as RedeemReferralCodeResponse } from '../params-B-1vi9za.js'; import { HookParams, HookResultWithMethods } from './types.js'; import '../plan-CUExbmy9.js'; import '@tanstack/react-query'; import '../client/AutumnClientError.js'; type UseReferralsParams = HookParams<ClientCreateReferralCodeParams, CreateReferralCodeResponse>; type UseReferralsResult = HookResultWithMethods<CreateReferralCodeResponse, { /** Redeems a referral code for the current customer. */ redeemCode: (params: ClientRedeemReferralCodeParams) => Promise<RedeemReferralCodeResponse>; }>; /** * Referral helper hook. * * - `data` is the latest create-code response. * - Access the code as `data?.code`. * - Call `refetch()` to create/fetch the code for `programId`. */ declare const useReferrals: (params: UseReferralsParams) => UseReferralsResult; export { type UseReferralsParams, type UseReferralsResult, useReferrals };