matrix-react-sdk
Version:
SDK for matrix.org using React
25 lines (24 loc) • 1.26 kB
TypeScript
/**
* The PhasedRolloutFeature class is used to manage the phased rollout of a new feature.
*
* It uses a hash of the user's identifier and the feature name to determine if a feature is enabled for a specific user.
* The rollout percentage determines the probability that a user will be enabled for the feature.
* The feature will be enabled for all users if the rollout percentage is 100, and for no users if the percentage is 0.
* If a user is enabled for a feature at x% rollout, it will also be for any greater than x percent.
*
* The process ensures a uniform distribution of enabled features across users.
*
* @property featureName - The name of the feature to be rolled out.
* @property rolloutPercentage - The int percentage (0..100) of users for whom the feature should be enabled.
*/
export declare class PhasedRolloutFeature {
readonly featureName: string;
private readonly rolloutPercentage;
private readonly seed;
constructor(featureName: string, rolloutPercentage: number);
/**
* Returns true if the feature should be enabled for the given user.
* @param userIdentifier - Some unique identifier for the user, e.g. their user ID or device ID.
*/
isFeatureEnabled(userIdentifier: string): boolean;
}