Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDKS-7567] Add type definitions #764

Merged
merged 5 commits into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion types/splitio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ declare namespace SplitIO {
/**
* Returns a TreatmentWithConfig value, which an object with both treatment and config string for the given feature.
* For usage on the Browser as we defined the key on the settings.
* @function getTreatment
* @function getTreatmentWithConfig
* @param {string} featureFlagName - The string that represents the feature flag we want to get the treatment.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {TreatmentWithConfig} The TreatmentWithConfig, the object containing the treatment string and the
Expand Down Expand Up @@ -1422,6 +1422,74 @@ declare namespace SplitIO {
* @returns {TreatmentsWithConfig} The map with all the TreatmentWithConfig objects
*/
getTreatmentsWithConfig(featureFlagNames: string[], attributes?: Attributes): TreatmentsWithConfig,
/**
* Returns a Treatments value, which is an object map with the treatments for the feature flags related to the given flag set.
* @function getTreatmentsByFlagSet
* @param {string} key - The string key representing the consumer.
* @param {string} flagSet - The flag set name we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsByFlagSet(key: SplitKey, flagSet: string, attributes?: Attributes): Treatments,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key: SplitKey ?

/**
* Returns a Treatments value, which is an object map with the treatments for the feature flags related to the given flag set.
* @function getTreatmentsByFlagSet
* @param {string} flagSet - The flag set name we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsByFlagSet(flagSet: string, attributes?: Attributes): Treatments,
/**
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
* @function getTreatmentsWithConfigByFlagSet
* @param {string} key - The string key representing the consumer.
* @param {string} flagSet - The flag set name we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsWithConfigByFlagSet(key: SplitKey, flagSet: string, attributes?: Attributes): TreatmentsWithConfig,
/**
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag set.
* @function getTreatmentsWithConfigByFlagSet
* @param {string} flagSet - The flag set name we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsWithConfigByFlagSet(flagSet: string, attributes?: Attributes): TreatmentsWithConfig,
/**
* Returns a Returns a Treatments value, which is an object with both treatment and config string for to the feature flags related to the given flag sets.
* @function getTreatmentsByFlagSets
* @param {string} key - The string key representing the consumer.
* @param {Array<string>} flagSets - An array of the flag set names we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsByFlagSets(key: SplitKey, flagSets: string[], attributes?: Attributes): Treatments,
/**
* Returns a Returns a Treatments value, which is an object with both treatment and config string for to the feature flags related to the given flag sets.
* @function getTreatmentsByFlagSets
* @param {Array<string>} flagSets - An array of the flag set names we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsByFlagSets(flagSets: string[], attributes?: Attributes): Treatments,
/**
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
* @function getTreatmentsWithConfigByFlagSets
* @param {string} key - The string key representing the consumer.
* @param {Array<string>} flagSets - An array of the flag set names we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsWithConfigByFlagSets(key: SplitKey, flagSets: string[], attributes?: Attributes): TreatmentsWithConfig,
/**
* Returns a TreatmentsWithConfig value, which is an object map with the TreatmentWithConfig (an object with both treatment and config string) for the feature flags related to the given flag sets.
* @function getTreatmentsWithConfigByFlagSets
* @param {Array<string>} flagSets - An array of the flag set names we want to get the treatments.
* @param {Attributes=} attributes - An object of type Attributes defining the attributes for the given key.
* @returns {Treatments} The map with all the TreatmentWithConfig objects
*/
getTreatmentsWithConfigByFlagSets(flagSets: string[], attributes?: Attributes): TreatmentsWithConfig,
/**
* Tracks an event to be fed to the results product on Split user interface.
* For usage on NodeJS as we don't have only one key.
Expand Down
Loading