diff --git a/.gitignore b/.gitignore index 83482d5..3c9ac65 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules lib es +types coverage examples .vscode diff --git a/CHANGES.txt b/CHANGES.txt index a4b6980..9c8c840 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -1.11.0 (March 27, 2023) +1.11.0 (April 3, 2024) - Added `sideEffects: false` property in the package.json file to allow tree shaking. - Updated Redux-Thunk peer dependency range to include redux-thunk@3.x.x. - Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. diff --git a/tsconfig.json b/tsconfig.json index 47a496f..52a0e77 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,24 +3,22 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": false, /* Generates corresponding '.d.ts' file. */ + // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": false, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ + "sourceMap": false, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "es", /* Redirect output structure to the directory. */ + "outDir": "es", /* Redirect output structure to the directory. */ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ - - // @TODO uncomment the following when migrating to JS-commons and Rollup, to avoid duplicated helpers code in builds. - "importHelpers": true, /* Import emit helpers from 'tslib'. */ + "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ @@ -62,6 +60,10 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ }, - "include": ["src"], - "exclude": ["./src/__tests__"] + "include": [ + "src" + ], + "exclude": [ + "./src/__tests__" + ] } diff --git a/types/actions.d.ts b/types/actions.d.ts deleted file mode 100644 index 50a97c6..0000000 --- a/types/actions.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export declare function splitReady(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitReadyWithEvaluations(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - timestamp: number; - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; -export declare function splitReadyFromCache(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitReadyFromCacheWithEvaluations(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - timestamp: number; - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; -export declare function splitUpdate(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitUpdateWithEvaluations(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - timestamp: number; - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; -export declare function splitTimedout(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitDestroy(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function addTreatments(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; diff --git a/types/asyncActions.d.ts b/types/asyncActions.d.ts deleted file mode 100644 index 1498a97..0000000 --- a/types/asyncActions.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Dispatch, Action } from 'redux'; -import { IInitSplitSdkParams, IGetTreatmentsParams, IDestroySplitSdkParams, ISplitFactoryBuilder } from './types'; -/** - * Internal object SplitSdk. This object should not be accessed or - * modified by the user, since it is not considered part of the public API - * and may break without notice. It is used by the library for its operation. - */ -export interface ISplitSdk { - config: SplitIO.IBrowserSettings | SplitIO.INodeSettings; - splitio: ISplitFactoryBuilder; - factory: SplitIO.ISDK; - sharedClients: { - [stringKey: string]: SplitIO.IClient; - }; - isDetached: boolean; - dispatch: Dispatch; -} -export declare const splitSdk: ISplitSdk; -/** - * This action creator initializes the Split SDK. It dispatches a Thunk (async) action. - * - * @param {IInitSplitSdkParams} params - */ -export declare function initSplitSdk(params: IInitSplitSdkParams): (dispatch: Dispatch) => Promise; -/** - * This action creator performs a treatment evaluation, i.e., it invokes the actual `client.getTreatment*` methods. - * - * @param {IGetTreatmentsParams} params - */ -export declare function getTreatments(params: IGetTreatmentsParams): Action | (() => void); -/** - * Interface of SDK client for not detached execution (browser). - */ -interface IClientNotDetached extends SplitIO.IClient { - _trackingStatus?: boolean; - /** - * stored evaluations to execute on SDK update. It is an object because we might - * want to change the evaluation parameters (i.e. attributes) per each feature flag name or flag set. - */ - evalOnUpdate: { - [name: string]: IGetTreatmentsParams; - }; - /** - * stored evaluations to execute when the SDK is ready. It is an array, so if multiple evaluations - * are set with the same feature flag name, the result (i.e. treatment) of the last one is the stored one. - */ - evalOnReady: IGetTreatmentsParams[]; - /** - * Similar to evalOnReady: stored evaluations to execute when the SDK is ready from cache. - */ - evalOnReadyFromCache: IGetTreatmentsParams[]; -} -/** - * Used in not detached version (browser). It gets an SDK client and enhances it with `evalOnUpdate`, `evalOnReady` and `evalOnReadyFromCache` lists. - * These lists are used by `getTreatments` action creator to schedule evaluation of feature flags on SDK_UPDATE, SDK_READY and SDK_READY_FROM_CACHE events. - * It is exported for testing purposes only. - * - * @param splitSdk it contains the Split factory, the store dispatch function, and other internal properties - * @param key optional user key - * @returns SDK client with `evalOnUpdate`, `evalOnReady` and `evalOnReadyFromCache` action lists. - */ -export declare function getClient(splitSdk: ISplitSdk, key?: SplitIO.SplitKey): IClientNotDetached; -/** - * This action creator destroy the Split SDK. It dispatches a Thunk (async) action. - * Once the action is resolved, any subsequent dispatch of `getTreatments` - * will update your treatments at the store with the `control` value. - */ -export declare function destroySplitSdk(params?: IDestroySplitSdkParams): (dispatch: Dispatch) => Promise; -export {}; diff --git a/types/constants.d.ts b/types/constants.d.ts deleted file mode 100644 index 9817bac..0000000 --- a/types/constants.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export declare const DEFAULT_SPLIT_STATE_SLICE = "splitio"; -export declare const VERSION: string; -export declare const ON: SplitIO.Treatment; -export declare const OFF: SplitIO.Treatment; -export declare const CONTROL: SplitIO.Treatment; -export declare const CONTROL_WITH_CONFIG: SplitIO.TreatmentWithConfig; -export declare const getControlTreatmentsWithConfig: (featureFlagNames: string[]) => SplitIO.TreatmentsWithConfig; -export declare const SPLIT_READY = "SPLIT_READY"; -export declare const SPLIT_READY_WITH_EVALUATIONS = "SPLIT_READY_WITH_EVALUATIONS"; -export declare const SPLIT_READY_FROM_CACHE = "SPLIT_READY_FROM_CACHE"; -export declare const SPLIT_READY_FROM_CACHE_WITH_EVALUATIONS = "SPLIT_READY_FROM_CACHE_WITH_EVALUATIONS"; -export declare const SPLIT_UPDATE = "SPLIT_UPDATE"; -export declare const SPLIT_UPDATE_WITH_EVALUATIONS = "SPLIT_UPDATE_WITH_EVALUATIONS"; -export declare const SPLIT_TIMEDOUT = "SPLIT_TIMEDOUT"; -export declare const SPLIT_DESTROY = "SPLIT_DESTROY"; -export declare const ADD_TREATMENTS = "ADD_TREATMENTS"; -export declare const ERROR_GETT_NO_INITSPLITSDK = "[ERROR] To use \"getTreatments\" the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_DESTROY_NO_INITSPLITSDK = "[ERROR] To use \"destroySplitSdk\" the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_TRACK_NO_INITSPLITSDK = "[ERROR] To use \"track\" the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_MANAGER_NO_INITSPLITSDK = "[ERROR] To use the manager, the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_SELECTOR_NO_SPLITSTATE = "[ERROR] When using selectors, \"splitState\" value must be a proper splitio piece of state"; -export declare const ERROR_GETT_NO_PARAM_OBJECT = "[ERROR] \"getTreatments\" must be called with a param object containing a valid splitNames or flagSets properties"; -export declare const WARN_FEATUREFLAGS_AND_FLAGSETS = "[WARN] Both splitNames and flagSets properties were provided. flagSets will be ignored"; diff --git a/types/helpers.d.ts b/types/helpers.d.ts deleted file mode 100644 index 344c8da..0000000 --- a/types/helpers.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ITrackParams } from './types'; -/** - * This function track events, i.e., it invokes the actual `client.track*` methods. - * This function is not an action creator, but rather a simple access to `client.track()`. - * - * @param {ITrackParams} params - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#track} - */ -export declare function track(params: ITrackParams): boolean; -/** - * Get the array of feature flag names. - * - * @returns {string[]} The list of feature flag names. The list might be empty if the SDK was not initialized or if it's not ready yet. - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#manager} - */ -export declare function getSplitNames(): string[]; -/** - * Get the data of a split in SplitView format. - * - * @param {string} featureFlagName The name of the split we wan't to get info of. - * @returns {SplitView} The SplitIO.SplitView of the given split, or null if split does not exist or the SDK was not initialized or is not ready. - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#manager} - */ -export declare function getSplit(featureFlagName: string): SplitIO.SplitView; -/** - * Get the array of feature flags data in SplitView format. - * - * @returns {SplitViews} The list of SplitIO.SplitView. The list might be empty if the SDK was not initialized or if it's not ready yet - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#manager} - */ -export declare function getSplits(): SplitIO.SplitViews; diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 797a995..0000000 --- a/types/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { splitReducer } from './reducer'; -export { initSplitSdk, getTreatments, destroySplitSdk, splitSdk } from './asyncActions'; -export { track, getSplitNames, getSplit, getSplits } from './helpers'; -export { selectTreatmentValue, selectTreatmentWithConfig } from './selectors'; -export { connectSplit } from './react-redux/connectSplit'; -export { connectToggler, mapTreatmentToProps, mapIsFeatureOnToProps } from './react-redux/connectToggler'; -export { ISplitState } from './types'; diff --git a/types/react-redux/connectSplit.d.ts b/types/react-redux/connectSplit.d.ts deleted file mode 100644 index 12309f8..0000000 --- a/types/react-redux/connectSplit.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { getTreatments } from '../asyncActions'; -import { ISplitState, IGetSplitState } from '../types'; -/** - * This decorator connects your components with: - * - The Split state at Redux, under the prop key `split`. - * - The action creator `getTreatments`, binded to the `dispatch` of your store. - * - * @param {IGetSplitState} getSplitState optional function that takes the entire Redux state and returns - * the state slice which corresponds to where the Split reducer was mounted. This functionality is rarely - * needed, and defaults to assuming that the reducer is mounted under the `splitio` key. - */ -export declare function connectSplit(getSplitState?: IGetSplitState): import("react-redux").InferableComponentEnhancerWithProps<{ - splitio: ISplitState; -} & { - getTreatments: typeof getTreatments; -}, {}>; diff --git a/types/react-redux/connectToggler.d.ts b/types/react-redux/connectToggler.d.ts deleted file mode 100644 index 49e354e..0000000 --- a/types/react-redux/connectToggler.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// -import { IGetSplitState } from '../types'; -/** - * Looks on the features of the Split piece of state, and maps to isFeatureOn - * depending if this feature is ON or not - * - * @param {string} featureFlagName feature flag name - * @param {SplitIO.SplitKey} key user key - * @param {IGetSplitState} getSplitState function that extract the Split piece of state from the Redux state. - */ -export declare function mapIsFeatureOnToProps(featureFlagName: string, key?: SplitIO.SplitKey, getSplitState?: IGetSplitState): (state: any) => { - isFeatureOn: boolean; -}; -/** - * Looks on the features of the Split piece of state, and maps to feature - * the value of this feature - * - * @param {string} featureFlagName feature flag name - * @param {SplitIO.SplitKey} key user key - * @param {IGetSplitState} getSplitState function that extract the Split piece of state from the Redux state. - */ -export declare function mapTreatmentToProps(featureFlagName: string, key?: SplitIO.SplitKey, getSplitState?: IGetSplitState): (state: any) => { - feature: string; -}; -/** - * - * Returns a connected component that wraps the toggler - * The idea of this is to send the isFeatureOn prop to the toggler - * - * So connect send the global state and the toggler decide which to render - * - * @param {string} featureFlagtName feature flag name - * @param {SplitIO.SplitKey} key user key - * @param {IGetSplitState} getSplitState function that extract the Split piece of state from the Redux state. - */ -export declare function connectToggler(featureFlagName: string, key?: SplitIO.SplitKey, getSplitState?: IGetSplitState): (ComponentOn: React.ComponentType, ComponentDefault?: React.ComponentType) => import("react-redux").ConnectedComponent<({ isFeatureOn, ...props }: { - isFeatureOn: boolean; -}) => import("react").ReactElement<{}, string | import("react").JSXElementConstructor>, { - [x: string]: any; -}>; diff --git a/types/reducer.d.ts b/types/reducer.d.ts deleted file mode 100644 index 667ef80..0000000 --- a/types/reducer.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Reducer } from 'redux'; -import { ISplitState } from './types'; -/** - * Split reducer. - * It updates the Split's slice of state. - */ -export declare const splitReducer: Reducer; diff --git a/types/selectors.d.ts b/types/selectors.d.ts deleted file mode 100644 index 4984e59..0000000 --- a/types/selectors.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISplitState } from './types'; -export declare const getStateSlice: (sliceName: string) => (state: any) => any; -export declare const defaultGetSplitState: (state: any) => any; -/** - * Selector function to extract a treatment evaluation from the Split state. It returns the treatment string value. - * - * @param {ISplitState} splitState - * @param {string} featureFlagName - * @param {SplitIO.SplitKey} key - * @param {string} defaultValue - */ -export declare function selectTreatmentValue(splitState: ISplitState, featureFlagName: string, key?: SplitIO.SplitKey, defaultValue?: string): string; -/** - * Selector function to extract a treatment evaluation from the Split state. It returns a treatment object containing its value and configuration. - * - * @param {ISplitState} splitState - * @param {string} featureFlagName - * @param {SplitIO.SplitKey} key - * @param {TreatmentWithConfig} defaultValue - */ -export declare function selectTreatmentWithConfig(splitState: ISplitState, featureFlagName: string, key?: SplitIO.SplitKey, defaultValue?: SplitIO.TreatmentWithConfig): SplitIO.TreatmentWithConfig; diff --git a/types/types.d.ts b/types/types.d.ts deleted file mode 100644 index 56b5b79..0000000 --- a/types/types.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -/** Type for Split reducer's slice of state */ -export interface ISplitState { - /** - * isReady indicates if Split SDK is ready, i.e., if it has emitted an SDK_READY event. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - isReady: boolean; - /** - * isReadyFromCache indicates if Split SDK has emitted an SDK_READY_FROM_CACHE event, what means that the SDK is ready to - * evaluate using LocalStorage cached data (which might be stale). - * This flag only applies for the Browser if using LOCALSTORAGE as storage type. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - isReadyFromCache: boolean; - /** - * isTimedout indicates if the Split SDK has emitted an SDK_READY_TIMED_OUT event and is not ready. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - isTimedout: boolean; - /** - * hasTimedout indicates if the Split SDK has ever emitted an SDK_READY_TIMED_OUT event. - * It's meant to keep a reference that the SDK emitted a timeout at some point, not the current state. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - hasTimedout: boolean; - /** - * isDestroyed indicates if the Split SDK has been destroyed by dispatching a `destroySplitSdk` action. - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#shutdown} - */ - isDestroyed: boolean; - /** - * lastUpdate is the timestamp of the last Split SDK event (SDK_READY, SDK_READY_TIMED_OUT or SDK_UPDATE). - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#advanced-subscribe-to-events-and-changes} - */ - lastUpdate: number; - /** - * `treatments` is a nested object property that contains the evaluations of feature flags. - * Each evaluation (treatment) is associated with a feature flag name and a key (e.g., unique user identifier, such as a user id). - * Thus the property has 3 levels: feature flag name, key, and finally the treatment that was evaluated for that specific feature flag and key. - */ - treatments: { - [featureFlagName: string]: { - [key: string]: SplitIO.TreatmentWithConfig; - }; - }; -} -export declare type IGetSplitState = (state: any) => ISplitState; -/** - * Type of the param object passed to `initSplitSdk` action creator. - */ -export interface IInitSplitSdkParams { - /** - * Setting object used to initialize the Split factory. - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#configuration} - */ - config: SplitIO.IBrowserSettings | SplitIO.INodeSettings; - /** - * Optional param to provide a Split factory initializer to use instead of SplitFactory from '@splitsoftware/splitio'. - * It can be useful when the Split factory is imported from the UMD bundle in a HTML script. - */ - splitio?: ISplitFactoryBuilder; - /** - * optional callback to be invoked on SDK_READY event - */ - onReady?: () => any; - /** - * optional callback to be invoked on SDK_READY_FROM_CACHE event - */ - onReadyFromCache?: () => any; - /** - * optional callback to be invoked on SDK_READY_TIMED_OUT event - */ - onTimedout?: () => any; - /** - * optional callback to be invoked on SDK_UPDATE event - */ - onUpdate?: () => any; -} -/** - * Type of the param object passed to `getTreatments` action creator. - */ -export declare type IGetTreatmentsParams = { - /** - * user key used to evaluate. It is mandatory for node but optional for browser. If not provided in browser, - * it defaults to the key defined in the SDK config, i.e., the config object passed to `initSplitSdk`. - */ - key?: SplitIO.SplitKey; - /** - * optional map of attributes passed to the actual `client.getTreatment*` methods. - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#attribute-syntax} - */ - attributes?: SplitIO.Attributes; - /** - * This param indicates to re-evaluate the feature flags if the SDK is updated. For example, a `true` value might be - * the desired behaviour for permission toggles or operation toggles, such as a kill switch, that you want to - * inmediately reflect in your app. A `false` value might be useful for experiment or release toggles, where - * you want to keep the treatment unchanged during the sesion of the user. - * @default false - */ - evalOnUpdate?: boolean; - /** - * This param indicates to evaluate the feature flags if the SDK is ready from cache (i.e., it emits SDK_READY_FROM_CACHE event). - * This params is only relevant when using 'LOCALSTORAGE' as storage type, since otherwise the event is never emitted. - * @default false - */ - evalOnReadyFromCache?: boolean; -} & ({ - /** - * Feature flag name or array of feature flag names to evaluate. Either this or the `flagSets` property must be provided. If both are provided, the `flagSets` option is ignored. - */ - splitNames: string[] | string; - flagSets?: undefined; -} | { - /** - * Feature flag set or array of feature flag sets to evaluate. Either this or the `splitNames` property must be provided. If both are provided, the `flagSets` option is ignored. - */ - flagSets: string[] | string; - splitNames?: undefined; -}); -/** - * Type of the param object passed to `destroySplitSdk` action creator. - */ -export interface IDestroySplitSdkParams { - /** - * optional callback to be invoked once the SDK has gracefully shut down - */ - onDestroy?: () => any; -} -/** - * Type of the param object passed to `track` function helper. - */ -export interface ITrackParams { - /** - * user key used to track event. It is mandatory for node but optional for browser. If not provided in browser, - * it defaults to the key defined in the SDK config object. - */ - key?: SplitIO.SplitKey; - /** - * the traffic type of the key in the track call. If not provided, it defaults to the traffic type defined in the SDK - * config object. If not provided either in the SDK setting, the function logs an error message and returns false. - */ - trafficType?: string; - /** - * The event type that this event should correspond to. The expected data type is String. - */ - eventType: string; - /** - * Optional value to be used in creating the metric. - */ - value?: number; - /** - * Optional object of key-value pairs that can be used to filter your metrics. - */ - properties?: SplitIO.Properties; -} -export declare type ISplitFactoryBuilder = (settings: SplitIO.IBrowserSettings | SplitIO.INodeSettings) => SplitIO.ISDK; diff --git a/types/utils.d.ts b/types/utils.d.ts deleted file mode 100644 index f37d930..0000000 --- a/types/utils.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IGetTreatmentsParams } from './types'; -/** - * Validates if a value is an object. - */ -export declare function isObject(obj: unknown): boolean; -/** - * Verify type of key and return either its matchingKey or itself - */ -export declare function matching(key: SplitIO.SplitKey): string; -/** - * ClientWithContext interface. - */ -export interface IClientStatus { - isReady: boolean; - isReadyFromCache: boolean; - isOperational: boolean; - hasTimedout: boolean; - isDestroyed: boolean; -} -export declare function getStatus(client: SplitIO.IClient): IClientStatus; -/** - * Validates and sanitizes the parameters passed to the "getTreatments" action creator. - * The returned object is a copy of the passed one, with the "splitNames" and "flagSets" properties converted to an array of strings. - */ -export declare function validateGetTreatmentsParams(params: any): IGetTreatmentsParams | false;