Skip to content

Commit

Permalink
update type name
Browse files Browse the repository at this point in the history
  • Loading branch information
raju-opti committed Dec 28, 2023
1 parent e2e6025 commit e6b2e7c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/core/project_config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
VariableType,
VariationVariable,
Integration,
OptimizelyVariableValue,
FeatureVariableValue,
} from '../../shared_types';

interface TryCreatingProjectConfigConfig {
Expand Down Expand Up @@ -693,8 +693,8 @@ export const getTypeCastValue = function(
variableValue: string,
variableType: VariableType,
logger: LogHandler
): OptimizelyVariableValue {
let castValue : OptimizelyVariableValue;
): FeatureVariableValue {
let castValue : FeatureVariableValue;

switch (variableType) {
case FEATURE_VARIABLE_TYPES.BOOLEAN:
Expand Down
2 changes: 1 addition & 1 deletion lib/export_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export {
UserAttributeValue,
UserAttributes,
OptimizelyConfig,
OptimizelyVariableValue,
FeatureVariableValue as OptimizelyVariableValue,
OptimizelyVariable,
OptimizelyVariation,
OptimizelyExperiment,
Expand Down
8 changes: 4 additions & 4 deletions lib/optimizely/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
FeatureVariable,
OptimizelyOptions,
OptimizelyDecideOption,
OptimizelyVariableValue,
FeatureVariableValue,
OptimizelyDecision,
Client,
} from '../shared_types';
Expand Down Expand Up @@ -778,7 +778,7 @@ export default class Optimizely implements Client {
* type, or null if the feature key is invalid or
* the variable key is invalid
*/
getFeatureVariable(featureKey: string, variableKey: string, userId: string, attributes?: UserAttributes): OptimizelyVariableValue {
getFeatureVariable(featureKey: string, variableKey: string, userId: string, attributes?: UserAttributes): FeatureVariableValue {
try {
if (!this.isValidInstance()) {
this.logger.log(LOG_LEVEL.ERROR, LOG_MESSAGES.INVALID_OBJECT, MODULE_NAME, 'getFeatureVariable');
Expand Down Expand Up @@ -820,7 +820,7 @@ export default class Optimizely implements Client {
variableType: string | null,
userId: string,
attributes?: UserAttributes
): OptimizelyVariableValue {
): FeatureVariableValue {
if (!this.validateInputs({ feature_key: featureKey, variable_key: variableKey, user_id: userId }, attributes)) {
return null;
}
Expand Down Expand Up @@ -912,7 +912,7 @@ export default class Optimizely implements Client {
variation: Variation | null,
variable: FeatureVariable,
userId: string
): OptimizelyVariableValue {
): FeatureVariableValue {
const configObj = this.projectConfigManager.getConfig();
if (!configObj) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions lib/shared_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export interface OptimizelyExperiment {
};
}

export type OptimizelyVariableValue = number | string | boolean | object | null;
export type FeatureVariableValue = number | string | boolean | object | null;

export interface OptimizelyVariable {
id: string;
Expand All @@ -332,7 +332,7 @@ export interface Client {
getForcedVariation(experimentKey: string, userId: string): string | null;
isFeatureEnabled(featureKey: string, userId: string, attributes?: UserAttributes): boolean;
getEnabledFeatures(userId: string, attributes?: UserAttributes): string[];
getFeatureVariable(featureKey: string, variableKey: string, userId: string, attributes?: UserAttributes): OptimizelyVariableValue;
getFeatureVariable(featureKey: string, variableKey: string, userId: string, attributes?: UserAttributes): FeatureVariableValue;
getFeatureVariableBoolean(
featureKey: string,
variableKey: string,
Expand Down

0 comments on commit e6b2e7c

Please sign in to comment.