/** * useSubscription Hook * * Fetches subscription/billing info from the API for the account view * * @since v2.2.2 */ import type { Tier } from '../../core/types/auth.js'; export interface SubscriptionInfo { status: 'active' | 'past_due' | 'canceling' | 'none'; tier: Tier; currentPeriodEnd: string | null; cancelAtPeriodEnd: boolean; /** Pre-formatted display string from API (e.g., "$2.99/month"). Replaces priceAmount per NinSys API v2.20.2. */ priceFormatted: string | null; /** Billing cadence (NinSys API v2.20.2). Null for non-subscription tiers. */ billingPeriod: 'monthly' | 'annual' | null; /** ISO timestamp of automatic downgrade if cancelAtPeriodEnd. */ tierExpiresAt: string | null; /** Tier they'll fall back to if subscription is canceling. */ downgradeToTier: Tier | null; /** Top-level boolean from API (was nested isDiscounted, now hoisted in v2.20.2). */ hasPlusDiscount: boolean; } export interface UseSubscriptionReturn { subscription: SubscriptionInfo | null; loading: boolean; error: string | null; } export declare function useSubscription(): UseSubscriptionReturn; //# sourceMappingURL=useSubscription.d.ts.map