UNPKG

@dndbuilder.com/react

Version:

Drag and drop builder for React

52 lines (51 loc) 1.61 kB
import { License, LicenseTier } from './types'; /** * Singleton class to manage the current license */ declare class LicenseService { private static instance; private currentLicense; private constructor(); /** * Get the singleton instance of the LicenseManager * @returns The LicenseManager instance */ static getInstance(): LicenseService; /** * Set the current license * @param license - The license to set */ setLicense(license: License): void; /** * Get the current license * @returns The current license */ getLicense(): License; /** * Check if a block is premium * @param blockType - The type of block to check * @returns Whether the block is premium */ isBlockPremium(blockType: string): boolean; /** * Get the required license tier for a block * @param blockType - The type of block to check * @returns The required license tier for the block */ getBlockRequiredTier(blockType: string): LicenseTier; /** * Check if a user can use a block based on their license * @param blockType - The type of block to check * @returns Whether the user can use the block */ canUseBlock(blockType: string): boolean; /** * Validate a license key * @param licenseKey - The license key to validate * @returns A promise that resolves to whether the license key is valid */ validateLicense(licenseKey: string): Promise<boolean>; } export declare const LicenseManager: LicenseService; export {}; //# sourceMappingURL=index.d.ts.map