/** * React hooks for license management * * Simplified model: Just validate license, no device/session management. * We trust our customers. */ import type { LicenseState } from "./types"; /** * Why the user currently has Pro access: * - "licensed" → a real, validated license key * - "weekend" → the free Weekend Pass (no license) * - null → no access */ export type ProAccessReason = "licensed" | "weekend" | null; /** * Hook to access the current license state * * @example * ```tsx * function MyComponent() { * const { isPro, isValidating, error } = useLicense(); * * if (isValidating) return ; * if (isPro) return ; * return ; * } * ``` */ export declare function useLicense(): LicenseState & { /** Validate and set a license key */ setLicenseKey: (key: string) => Promise; /** Clear the current license */ clearLicense: () => Promise; }; /** * Hook to check if a feature is available based on license */ export declare function useFeatureAccess(featureCode?: string): { hasAccess: boolean; isPro: boolean; isLoading: boolean; }; /** * Hook that returns true when the user has Pro access — either a validated * license OR the free Weekend Pass (Pro is free for everyone on weekends). */ export declare function useIsPro(): boolean; /** * Like {@link useIsPro} but also reports WHY access is granted, so badges can * show "PRO" for a real license vs the "Weekend Pass" badge for the free * weekend unlock. */ export declare function useProAccess(): { /** True if the user has Pro access for any reason. */ isPro: boolean; /** True only for a real, validated license. */ isLicensed: boolean; /** True only for the free Weekend Pass. */ isWeekendFree: boolean; reason: ProAccessReason; }; //# sourceMappingURL=hooks.d.ts.map