@dev-team-tool/feature-switches
Version:
Library to access feature-switches from dev-team-tools.com programatically
29 lines (26 loc) • 910 B
text/typescript
interface FeatureSwitchContext {
key: string;
value: string;
}
interface FeatureSwitchRequest {
userId?: string;
userName?: string;
context?: FeatureSwitchContext[];
}
interface FeatureSwitchValue {
value: boolean;
}
interface FeatureSwitchManager {
getSwitchValue: (key: string, userRequest?: FeatureSwitchRequest) => Promise<boolean>;
}
interface FeatureSwitch {
key: string;
value: boolean;
}
declare class FeatureSwitchManagerImpl implements FeatureSwitchManager {
#private;
constructor(token: string, environment: string);
getSwitchValue: (key: string, userRequest?: FeatureSwitchRequest) => Promise<boolean>;
getSwitches: (userRequest?: FeatureSwitchRequest) => Promise<FeatureSwitch[]>;
}
export { type FeatureSwitch, type FeatureSwitchContext, FeatureSwitchManagerImpl as FeatureSwitchManager, type FeatureSwitchRequest, type FeatureSwitchValue };