@unleash/proxy
Version:
The Unleash Proxy (Open-Source)
21 lines (20 loc) • 1.19 kB
TypeScript
import { type Context, Unleash, type Variant } from 'unleash-client';
import type { FeatureInterface } from 'unleash-client/lib/feature';
import type { FallbackFunction } from 'unleash-client/lib/helpers';
import type { UnleashConfig } from 'unleash-client/lib/unleash';
import type { VariantWithFeatureStatus } from 'unleash-client/lib/variant';
declare class FakeUnleash extends Unleash {
toggleDefinitions: FeatureInterface[];
contexts: Context[];
unleashConfig: UnleashConfig;
constructor(unleashConfig: UnleashConfig);
isEnabled(name: string, context?: Context, fallbackFunction?: FallbackFunction): boolean;
isEnabled(name: string, context?: Context, fallbackValue?: boolean): boolean;
getVariant(_name: string, _context?: Context, _fallbackVariant?: Variant): VariantWithFeatureStatus;
forceGetVariant(_name: string, _context?: Context, _fallbackVariant?: Variant): Variant;
getFeatureToggleDefinition(toggleName: string): FeatureInterface;
getFeatureToggleDefinitions(): FeatureInterface[];
count(_toggleName: string, _enabled: boolean): void;
countVariant(_toggleName: string, _variantName: string): void;
}
export default FakeUnleash;