import { Observable } from 'rxjs'; import { SubtrakService } from './subtrak.service'; import { EntitlementValue } from '../models'; import { EntitlementChecker } from '../utils/entitlement-checker'; import * as i0 from "@angular/core"; /** * Service for checking customer entitlements * * Handles all entitlement types: BOOLEAN, NUMERIC, ENUM, METERED * * @example * ```typescript * constructor(private entitlements: EntitlementsService) {} * * // Check if customer has a feature * this.entitlements.hasFeature('cus_123', 'premium_analytics').subscribe(hasAccess => { * if (hasAccess) { * // Show premium features * } * }); * * // Get numeric limit * this.entitlements.getLimit('cus_123', 'max_projects').subscribe(limit => { * console.log('Project limit:', limit); * }); * ``` */ export declare class EntitlementsService { private subtrak; constructor(subtrak: SubtrakService); /** * Get all entitlements for a customer * * @param customerId - Customer ID * @returns Observable of entitlement values */ getEntitlements(customerId: string): Observable; /** * Check if customer has a BOOLEAN feature * * @param customerId - Customer ID * @param code - Entitlement code * @returns Observable of boolean indicating if feature is enabled */ hasFeature(customerId: string, code: string): Observable; /** * Get NUMERIC limit value * * @param customerId - Customer ID * @param code - Entitlement code * @returns Observable of the limit value (or null if not found) */ getLimit(customerId: string, code: string): Observable; /** * Get ENUM value * * @param customerId - Customer ID * @param code - Entitlement code * @returns Observable of the enum string value (or null if not found) */ getEnumValue(customerId: string, code: string): Observable; /** * Check access with multi-type support * * @param customerId - Customer ID * @param code - Entitlement code * @param requiredValue - Optional value to check against * @returns Observable of boolean indicating if access is granted */ checkAccess(customerId: string, code: string, requiredValue?: any): Observable; /** * Check if current usage is within a NUMERIC limit * * @param customerId - Customer ID * @param code - Entitlement code * @param currentUsage - Current usage value * @returns Observable of boolean indicating if within limit */ isWithinLimit(customerId: string, code: string, currentUsage: number): Observable; /** * Get remaining quota for a NUMERIC limit * * @param customerId - Customer ID * @param code - Entitlement code * @param used - Currently used amount * @returns Observable of remaining quota (or -1 for unlimited, null if not found) */ getRemainingQuota(customerId: string, code: string, used: number): Observable; /** * Get usage progress percentage (0-100) * * @param customerId - Customer ID * @param code - Entitlement code * @param used - Currently used amount * @returns Observable of progress percentage (or -1 for unlimited, null if not found) */ getProgress(customerId: string, code: string, used: number): Observable; /** * Check if approaching limit (default: 90% threshold) * * @param customerId - Customer ID * @param code - Entitlement code * @param used - Currently used amount * @param threshold - Warning threshold (0-1), default 0.9 * @returns Observable of boolean indicating if approaching limit */ isApproachingLimit(customerId: string, code: string, used: number, threshold?: number): Observable; /** * Get formatted display value for an entitlement * * @param customerId - Customer ID * @param code - Entitlement code * @returns Observable of formatted string for display */ getDisplayValue(customerId: string, code: string): Observable; /** * Get all active BOOLEAN features * * @param customerId - Customer ID * @returns Observable of array of feature codes */ getActiveFeatures(customerId: string): Observable; /** * Get all NUMERIC limits as a map * * @param customerId - Customer ID * @returns Observable of map of code to limit value */ getLimits(customerId: string): Observable>; /** * Create an EntitlementChecker instance from customer entitlements * * @param customerId - Customer ID * @returns Observable of EntitlementChecker instance */ getChecker(customerId: string): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }