Skip to content

Commit 25e81e2

Browse files
authored
[FSSDK-11101] cleanup OptiizelyOptions type (#997)
1 parent fd9c9ed commit 25e81e2

File tree

4 files changed

+23
-30
lines changed

4 files changed

+23
-30
lines changed

lib/export_types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export {
3333
Event,
3434
EventDispatcher,
3535
DatafileOptions,
36-
OptimizelyOptions,
3736
UserProfileService,
3837
UserProfile,
3938
ListenerPayload,

lib/index.browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import configValidator from './utils/config_validator';
1818
import defaultEventDispatcher from './event_processor/event_dispatcher/default_dispatcher.browser';
1919
import sendBeaconEventDispatcher from './event_processor/event_dispatcher/send_beacon_dispatcher.browser';
2020
import * as enums from './utils/enums';
21-
import { OptimizelyDecideOption, Client, Config, OptimizelyOptions } from './shared_types';
21+
import { OptimizelyDecideOption, Client, Config } from './shared_types';
2222
import Optimizely from './optimizely';
2323
import { UserAgentParser } from './odp/ua_parser/user_agent_parser';
2424
import { getUserAgentParser } from './odp/ua_parser/ua_parser.browser';
@@ -57,7 +57,7 @@ const createInstance = function(config: Config): Client | null {
5757
logger = config.logger ? extractLogger(config.logger) : undefined;
5858
const errorNotifier = config.errorNotifier ? extractErrorNotifier(config.errorNotifier) : undefined;
5959

60-
const optimizelyOptions: OptimizelyOptions = {
60+
const optimizelyOptions = {
6161
...config,
6262
clientEngine: clientEngine || enums.JAVASCRIPT_CLIENT_ENGINE,
6363
clientVersion: clientVersion || enums.CLIENT_VERSION,

lib/optimizely/index.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
Variation,
3232
FeatureFlag,
3333
FeatureVariable,
34-
OptimizelyOptions,
3534
OptimizelyDecideOption,
3635
FeatureVariableValue,
3736
OptimizelyDecision,
@@ -111,6 +110,27 @@ type StringInputs = Partial<Record<InputKey, unknown>>;
111110

112111
type DecisionReasons = (string | number)[];
113112

113+
/**
114+
* options required to create optimizely object
115+
*/
116+
export type OptimizelyOptions = {
117+
projectConfigManager: ProjectConfigManager;
118+
UNSTABLE_conditionEvaluators?: unknown;
119+
clientEngine: string;
120+
clientVersion?: string;
121+
errorNotifier?: ErrorNotifier;
122+
eventProcessor?: EventProcessor;
123+
jsonSchemaValidator?: {
124+
validate(jsonObject: unknown): boolean;
125+
};
126+
logger?: LoggerFacade;
127+
userProfileService?: UserProfileService | null;
128+
defaultDecideOptions?: OptimizelyDecideOption[];
129+
odpManager?: OdpManager;
130+
vuidManager?: VuidManager
131+
disposable?: boolean;
132+
}
133+
114134
export default class Optimizely implements Client {
115135
private disposeOnUpdate?: Fn;
116136
private readyPromise: Promise<unknown>;

lib/shared_types.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -248,32 +248,6 @@ export enum OptimizelyDecideOption {
248248
EXCLUDE_VARIABLES = 'EXCLUDE_VARIABLES',
249249
}
250250

251-
/**
252-
* options required to create optimizely object
253-
*/
254-
export interface OptimizelyOptions {
255-
projectConfigManager: ProjectConfigManager;
256-
UNSTABLE_conditionEvaluators?: unknown;
257-
clientEngine: string;
258-
clientVersion?: string;
259-
// TODO[OASIS-6649]: Don't use object type
260-
// eslint-disable-next-line @typescript-eslint/ban-types
261-
datafile?: string | object;
262-
datafileManager?: DatafileManager;
263-
errorNotifier?: ErrorNotifier;
264-
eventProcessor?: EventProcessor;
265-
jsonSchemaValidator?: {
266-
validate(jsonObject: unknown): boolean;
267-
};
268-
logger?: LoggerFacade;
269-
sdkKey?: string;
270-
userProfileService?: UserProfileService | null;
271-
defaultDecideOptions?: OptimizelyDecideOption[];
272-
odpManager?: OdpManager;
273-
vuidManager?: VuidManager
274-
disposable?: boolean;
275-
}
276-
277251
/**
278252
* Optimizely Config Entities
279253
*/

0 commit comments

Comments
 (0)