/** * LicenseManager - Singleton for managing React Buoy Pro licenses * * Simple license validation + device registration for visibility. * No limits enforced - we trust our customers. * Keygen tracks validation calls for usage analytics. */ import type { LicenseState, LicenseListener } from "./types"; /** Info passed to device registration callback */ export interface DeviceRegistrationInfo { fingerprint: string; defaultName: string; } /** Callback type for device registration events */ export type DeviceRegistrationCallback = (info: DeviceRegistrationInfo) => void; declare class LicenseManagerImpl { private state; private listeners; private revalidationTimer; private cachedLicense; private initPromise; private deviceRegistrationCallback; private pendingRegistration; /** * Initialize the license manager and load cached license */ initialize(): Promise; /** * Internal initialization logic */ private _doInitialize; /** * Set and validate a license key. * * Simple validation - just checks if the key is valid. * No device registration or limits - we trust our customers. * Keygen tracks validation calls for usage analytics. */ setLicenseKey(licenseKey: string): Promise; /** * Check if an error is a network error (not an API validation error) */ private isNetworkError; /** * Clear the current license */ clearLicense(): Promise; /** * Check if the user has Pro features */ isPro(): boolean; /** * Check if a specific entitlement is available */ hasEntitlement(code: string): boolean; /** * Get current license state */ getState(): Readonly; /** * Subscribe to license events */ subscribe(listener: LicenseListener): () => void; /** * Subscribe to device registration events * When a new device needs to be registered, the callback is invoked * with the fingerprint and default name suggestion. * Call completeDeviceRegistration() to finish registration with user's chosen name. */ onDeviceRegistrationNeeded(callback: DeviceRegistrationCallback): () => void; /** * Complete device registration with user-provided name * Call this after onDeviceRegistrationNeeded callback to finish registration */ completeDeviceRegistration(deviceName: string): Promise; private emit; private isCacheValid; private loadCachedLicense; private clearCachedLicense; /** * Register device in background for visibility (non-blocking) * Failures don't affect Pro status - this is just for analytics */ private registerDeviceAsync; private validateInBackground; private startRevalidationTimer; /** * Stop the revalidation timer */ stopRevalidationTimer(): void; /** * Force re-registration by clearing cached fingerprint * (For debugging/testing - forces device to re-register on next validation) */ forceReregister(): Promise; } export declare const LicenseManager: LicenseManagerImpl; export {}; //# sourceMappingURL=LicenseManager.d.ts.map