UNPKG

@featurevisor/sdk

Version:

Featurevisor SDK for Node.js and the browser

27 lines (26 loc) 2 kB
import type { Context, StickyFeatures, FeatureKey, VariationValue, VariableValue, EvaluatedFeatures } from "@featurevisor/types"; import { EventName, EventCallback } from "./emitter"; import type { OverrideOptions } from "./instance"; export declare class FeaturevisorChildInstance { private parent; private context; private sticky; private emitter; constructor(options: any); on(eventName: EventName, callback: EventCallback): () => void; close(): void; setContext(context: Context, replace?: boolean): void; getContext(context?: Context): Context; setSticky(sticky: StickyFeatures, replace?: boolean): void; isEnabled(featureKey: FeatureKey, context?: Context, options?: OverrideOptions): boolean; getVariation(featureKey: FeatureKey, context?: Context, options?: OverrideOptions): VariationValue | null; getVariable(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): VariableValue | null; getVariableBoolean(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): boolean | null; getVariableString(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): string | null; getVariableInteger(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): number | null; getVariableDouble(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): number | null; getVariableArray(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): string[] | null; getVariableObject<T>(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): T | null; getVariableJSON<T>(featureKey: FeatureKey, variableKey: string, context?: Context, options?: OverrideOptions): T | null; getAllEvaluations(context?: Context, featureKeys?: string[], options?: OverrideOptions): EvaluatedFeatures; }