import { ReactNode } from 'react';
import { SubscriptionQuery, PlanType } from '../../../graphql.billing.autogenerated';
export type CurrentSubscription = SubscriptionQuery['subscription'] | null;
export interface SubscriptionContextValue {
    /** The current subscription data */
    subscription: CurrentSubscription;
    /** Whether the subscription is currently loading */
    loading: boolean;
    /** Any error that occurred while fetching the subscription */
    error: Error | null;
    /** The current plan type (e.g., 'free', 'basic', 'premium') */
    planType: PlanType | null;
    /** Refetch the subscription data */
    refetch: () => void;
}
declare const SubscriptionContext: import("react").Context<SubscriptionContextValue | undefined>;
export interface SubscriptionProviderProps {
    children: ReactNode;
    /** Optional workspace ID override. If not provided, uses auth.getContext() */
    workspaceId?: number;
}
/**
 * SubscriptionProvider - Provides the current workspace's subscription data
 *
 * This provider queries the billing service for the current subscription
 * when the workspace context changes. It exposes the subscription data,
 * plan type, and loading/error states to all child components.
 *
 * Usage:
 * ```tsx
 * // In your app layout
 * <SubscriptionProvider>
 *   <App />
 * </SubscriptionProvider>
 *
 * // In any child component
 * const { subscription, planType, loading } = useCurrentSubscription();
 * ```
 */
export declare function SubscriptionProvider({ children, workspaceId: propWorkspaceId, }: SubscriptionProviderProps): import("@emotion/react/jsx-runtime").JSX.Element;
/**
 * useCurrentSubscription - Hook to access the current subscription data
 *
 * Must be used within a SubscriptionProvider.
 *
 * @returns SubscriptionContextValue with subscription data, planType, loading, and error
 *
 * @example
 * ```tsx
 * const { subscription, planType, loading, error, refetch } = useCurrentSubscription();
 *
 * if (loading) return <Loading />;
 * if (error) return <Error message={error.message} />;
 *
 * // Use planType to determine features
 * if (planType === PlanType.FREE) {
 *   // Show upgrade prompt
 * }
 * ```
 */
export declare function useCurrentSubscription(): SubscriptionContextValue;
/**
 * useCurrentSubscriptionOptional - Safe hook for screens that may render
 * outside SubscriptionProvider (e.g. embedded surfaces).
 */
export declare function useCurrentSubscriptionOptional(): SubscriptionContextValue | undefined;
export default SubscriptionContext;
