UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

37 lines 1.85 kB
import { type FeatureStrategiesEvaluationResult } from './client.js'; import { type RepositoryInterface } from './repository/index.js'; import type { Context } from './context.js'; import { Strategy } from './strategy/index.js'; import type { ClientFeaturesResponse, FeatureInterface } from './feature.js'; import type { Variant } from './variant.js'; import { type FallbackFunction } from './helpers.js'; import { type BootstrapOptions } from './repository/bootstrap-provider.js'; import type { StorageProvider } from './repository/storage-provider.js'; export { Strategy }; export interface FeatureEvaluatorConfig { appName: string; environment?: string; strategies?: Strategy[]; repository?: RepositoryInterface; bootstrap?: BootstrapOptions; storageProvider?: StorageProvider<ClientFeaturesResponse>; } export interface StaticContext { appName: string; environment: string; } export declare class FeatureEvaluator { private repository; private client; private staticContext; constructor({ appName, environment, strategies, repository, bootstrap, storageProvider, }: FeatureEvaluatorConfig); start(): Promise<void>; destroy(): void; isEnabled(name: string, context?: Context, fallbackFunction?: FallbackFunction): FeatureStrategiesEvaluationResult; isEnabled(name: string, context?: Context, fallbackValue?: boolean): FeatureStrategiesEvaluationResult; getVariant(name: string, context?: Context, fallbackVariant?: Variant): Variant; forceGetVariant(name: string, forcedResults: Pick<FeatureStrategiesEvaluationResult, 'result' | 'variant'>, context?: Context, fallbackVariant?: Variant): Variant; getFeatureToggleDefinition(toggleName: string): FeatureInterface; getFeatureToggleDefinitions(): FeatureInterface[]; } //# sourceMappingURL=feature-evaluator.d.ts.map