import { n as ClientCheckParams, d as ClientGetOrCreateCustomerParams, a as ClientAttachParams, A as AttachResponse, h as ClientPreviewAttachParams, p as PreviewAttachResponse, m as ClientUpdateSubscriptionParams, B as BillingUpdateResponse, j as ClientPreviewUpdateSubscriptionParams, q as PreviewUpdateResponse, o as CheckResponse, f as ClientMultiAttachParams, M as MultiAttachResponse, i as ClientPreviewMultiAttachParams, r as PreviewMultiAttachResponse, l as ClientSetupPaymentParams, S as SetupPaymentResponse, g as ClientOpenCustomerPortalParams, O as OpenCustomerPortalResponse } from '../params-Bf18ATYi.mjs';
import { C as Customer } from '../customer-DM044m1a.mjs';
import { HookParams, HookResultWithMethods } from './types.mjs';
import '../plan-CUExbmy9.mjs';
import '@tanstack/react-query';
import '../client/AutumnClientError.mjs';

type UseCustomerParams = HookParams<ClientGetOrCreateCustomerParams, Customer | null>;
type UseCustomerCheckParams = ClientCheckParams;
type UseCustomerResult = HookResultWithMethods<Customer | null, {
    /** The customer object. */
    data?: Customer;
    /**
     * Attaches a plan to the customer. Handles new subscriptions, upgrades and downgrades.
     * Automatically redirects to checkout if payment is required.
     * @param params - Plan ID and optional configuration (free trial, custom pricing, discounts).
     * @returns Billing response with customer ID, invoice details, and payment URL if checkout required.
     */
    attach: (params: ClientAttachParams) => Promise<AttachResponse>;
    /**
     * Previews the billing changes that would occur when attaching a plan, without making any changes.
     * Use this to show customers what they will be charged before confirming a subscription change.
     * @param params - Plan ID and optional configuration to preview.
     * @returns Preview with line items, totals, and effective dates for the proposed changes.
     */
    previewAttach: (params: ClientPreviewAttachParams) => Promise<PreviewAttachResponse>;
    /**
     * Updates an existing subscription. Use to modify feature quantities, cancel, or change plan configuration.
     * Automatically redirects to checkout if payment is required.
     * @param params - Plan ID, feature quantities, and optional cancel action.
     * @returns Billing response with customer ID, invoice details, and payment URL if next action required.
     */
    updateSubscription: (params: ClientUpdateSubscriptionParams) => Promise<BillingUpdateResponse>;
    /**
     * Previews the billing changes that would occur when updating a subscription, without making any changes.
     * Use this to show customers prorated charges or refunds before confirming subscription modifications.
     * @param params - Plan ID, feature quantities, and optional cancel action to preview.
     * @returns Preview with line items showing prorated charges or credits for the proposed changes.
     */
    previewUpdateSubscription: (params: ClientPreviewUpdateSubscriptionParams) => Promise<PreviewUpdateResponse>;
    /**
     * Checks feature access and balance for the customer locally (no API call).
     * @param params - Feature ID to check access for.
     * @returns Check response with access status and remaining balance.
     */
    check: (params: UseCustomerCheckParams) => CheckResponse;
    /**
     * Attaches multiple plans to the customer in one operation.
     * Automatically redirects to checkout if payment is required.
     * @param params - List of plans with optional feature quantities, free trial, and discounts.
     * @returns Billing response with customer ID, invoice details, and payment URL if checkout required.
     */
    multiAttach: (params: ClientMultiAttachParams) => Promise<MultiAttachResponse>;
    /**
     * Previews the billing changes for attaching multiple plans, without making changes.
     * @param params - List of plans with optional feature quantities to preview.
     * @returns Preview with line items, totals, and effective dates for the proposed changes.
     */
    previewMultiAttach: (params: ClientPreviewMultiAttachParams) => Promise<PreviewMultiAttachResponse>;
    /**
     * Creates a payment setup session for the customer to add or update their payment method.
     * Automatically redirects to the Stripe setup page.
     * @param params - Optional success URL and plan to attach after setup.
     * @returns Setup response with URL to redirect the customer.
     */
    setupPayment: (params?: ClientSetupPaymentParams) => Promise<SetupPaymentResponse>;
    /**
     * Opens the Stripe customer billing portal for this customer.
     * @param params - Optional return URL and configuration.
     * @returns Portal session response with URL to redirect the customer.
     */
    openCustomerPortal: (params?: ClientOpenCustomerPortalParams) => Promise<OpenCustomerPortalResponse>;
}>;
/**
 * Fetches or creates an Autumn customer and provides billing actions.
 *
 * @returns Customer data along with billing methods: `attach`, `previewAttach`, `updateSubscription`, `previewUpdateSubscription`, `multiAttach`, `previewMultiAttach`, `check`, `setupPayment`, and `openCustomerPortal`.
 */
declare const useCustomer: (params?: UseCustomerParams) => UseCustomerResult;

export { type UseCustomerCheckParams, type UseCustomerParams, type UseCustomerResult, useCustomer };
