/** * A light weight implementation of feature flags to conditionally enable * experimental and legacy features. * * @template FlagsList - Type definition for the feature flags object * * @example * const flags = new FeatureFlags({ newUI: true, betaFeature: false }) * if (flags.enabled('newUI')) { * // Enable new UI * } * * @example * const dynamicFlags = new FeatureFlags(() => getConfigFlags()) * flags.when('betaFeature', * () => console.log('Beta enabled'), * () => console.log('Beta disabled') * ) */ export declare class FeatureFlags> { #private; /** * Creates a new FeatureFlags instance * * @param flags - Either a static flags object or a factory function */ constructor(flags: FlagsList | (() => FlagsList)); /** * Checks if a feature is enabled * * @param feature - The feature name to check * @returns boolean - True if the feature is enabled */ enabled(feature: Feature): boolean; /** * Checks if a feature is disabled * * @param feature - The feature name to check * @returns boolean - True if the feature is disabled */ disabled(feature: Feature): boolean; /** * Checks if a feature exists in the flags * * @param feature - The feature name to check * @returns boolean - True if the feature exists */ has(feature: Feature): boolean; /** * Conditionally executes callbacks based on feature flag state * * @param feature - The feature name to check * @param enabledCallback - Callback to execute when feature is enabled * @param disabledCallback - Optional callback to execute when feature is disabled * @returns The result of the executed callback */ when(feature: Feature, enabledCallback: () => EnabledResult, disabledCallback?: () => DisabledResult): [never] extends DisabledResult ? EnabledResult | undefined : EnabledResult | DisabledResult; }