@types/rox-browser
Advanced tools
Comparing version 5.0.3 to 5.0.4
@@ -8,6 +8,4 @@ // Type definitions for rox-browser 5.0 | ||
/** | ||
* | ||
* Official documentation for rox-browser is available here: | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api | ||
* | ||
*/ | ||
@@ -19,267 +17,267 @@ | ||
declare namespace Rox { | ||
interface RoxContainer { | ||
[key: string]: Flag | RoxNumber | RoxString; | ||
} | ||
interface RoxContainer { | ||
[key: string]: Flag | RoxNumber | RoxString; | ||
} | ||
/** | ||
* The register function should be called before the call to Rox.setup() | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_register | ||
*/ | ||
function register(namespace: string, roxContainer: RoxContainer): void; | ||
/** | ||
* The register function should be called before the call to Rox.setup() | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_register | ||
*/ | ||
function register(namespace: string, roxContainer: RoxContainer): void; | ||
function register(roxContainer: RoxContainer): void; | ||
function register(roxContainer: RoxContainer): void; | ||
/** | ||
* Set Global Context. | ||
* You can think of Global Context as a default context | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-releases/custom-properties#_global_context | ||
*/ | ||
function setContext(globalContext: unknown): void; | ||
/** | ||
* Set Global Context. | ||
* You can think of Global Context as a default context | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-releases/custom-properties#_global_context | ||
*/ | ||
function setContext(globalContext: unknown): void; | ||
/** | ||
* Initiate connection with Rox servers for the application identified by the application key. | ||
* The registered containers will be synced and Rox entities will get the appropriate values. | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_setup | ||
*/ | ||
function setup(apiKey: string, options?: RoxSetupOptions): Promise<unknown>; | ||
interface RoxSetupOptions { | ||
version?: string | undefined; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_configurationfetchedhandler | ||
configurationFetchedHandler?(fetcherResult: RoxFetcherResult): void; | ||
debugLevel?: 'verbose' | undefined; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_using_the_impressionhandler_option | ||
impressionHandler?(reporting: RoxReporting, context: unknown): void; | ||
platform?: string | undefined; | ||
freeze?: RoxFlagFreezeLevel | undefined; | ||
disableNetworkFetch?: boolean | undefined; | ||
devModeSecret?: string | undefined; | ||
/** | ||
* Set Roxy's URL for automated tests or local development. | ||
* Initiate connection with Rox servers for the application identified by the application key. | ||
* The registered containers will be synced and Rox entities will get the appropriate values. | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/debugging/microservices-automated-testing-and-local-development | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_setup | ||
*/ | ||
roxy?: string | undefined; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_dynamicpropertyrulehandler | ||
dynamicPropertyRuleHandler?(propName: string, context: any): any; | ||
} | ||
function setup(apiKey: string, options?: RoxSetupOptions): Promise<unknown>; | ||
enum RoxFetcherStatus { | ||
AppliedFromEmbedded = 'APPLIED_FROM_EMBEDDED', | ||
AppliedFromCache = 'APPLIED_FROM_CACHE', | ||
AppliedFromNetwork = 'APPLIED_FROM_NETWORK', | ||
ErrorFetchFailed = 'ERROR_FETCH_FAILED' | ||
} | ||
interface RoxSetupOptions { | ||
version?: string | undefined; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_configurationfetchedhandler | ||
configurationFetchedHandler?(fetcherResult: RoxFetcherResult): void; | ||
debugLevel?: "verbose" | undefined; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_using_the_impressionhandler_option | ||
impressionHandler?(reporting: RoxReporting, context: unknown): void; | ||
platform?: string | undefined; | ||
freeze?: RoxFlagFreezeLevel | undefined; | ||
disableNetworkFetch?: boolean | undefined; | ||
devModeSecret?: string | undefined; | ||
/** | ||
* Set Roxy's URL for automated tests or local development. | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/debugging/microservices-automated-testing-and-local-development | ||
*/ | ||
roxy?: string | undefined; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_dynamicpropertyrulehandler | ||
dynamicPropertyRuleHandler?(propName: string, context: any): any; | ||
} | ||
enum RoxErrorTrigger { | ||
DYNAMIC_PROPERTIES_RULE = 'DYNAMIC_PROPERTIES_RULE', | ||
CONFIGURATION_FETCHED_HANDLER = 'CONFIGURATION_FETCHED_HANDLER', | ||
IMPRESSION_HANDLER = 'IMPRESSION_HANDLER', | ||
CUSTOM_PROPERTY_GENERATOR = 'CUSTOM_PROPERTY_GENERATOR' | ||
} | ||
enum RoxFetcherStatus { | ||
AppliedFromEmbedded = "APPLIED_FROM_EMBEDDED", | ||
AppliedFromCache = "APPLIED_FROM_CACHE", | ||
AppliedFromNetwork = "APPLIED_FROM_NETWORK", | ||
ErrorFetchFailed = "ERROR_FETCH_FAILED", | ||
} | ||
interface RoxFetcherResult { | ||
fetcherStatus: RoxFetcherStatus; | ||
creationDate: Date; | ||
hasChanges: boolean; | ||
errorDetails?: string | undefined; | ||
} | ||
enum RoxErrorTrigger { | ||
DYNAMIC_PROPERTIES_RULE = "DYNAMIC_PROPERTIES_RULE", | ||
CONFIGURATION_FETCHED_HANDLER = "CONFIGURATION_FETCHED_HANDLER", | ||
IMPRESSION_HANDLER = "IMPRESSION_HANDLER", | ||
CUSTOM_PROPERTY_GENERATOR = "CUSTOM_PROPERTY_GENERATOR", | ||
} | ||
interface RoxReporting { | ||
name: string; | ||
value: string; | ||
targeting: boolean; | ||
} | ||
interface RoxFetcherResult { | ||
fetcherStatus: RoxFetcherStatus; | ||
creationDate: Date; | ||
hasChanges: boolean; | ||
errorDetails?: string | undefined; | ||
} | ||
/** | ||
* Note that you might have to call unfreeze after setting custom properties such as email after login | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-releases/custom-properties | ||
*/ | ||
function setCustomNumberProperty(name: string, value: number | ((context?: unknown) => number)): void; | ||
function setCustomStringProperty(name: string, value: string | ((context?: unknown) => string)): void; | ||
function setCustomBooleanProperty(name: string, value: boolean | ((context?: unknown) => boolean)): void; | ||
interface RoxReporting { | ||
name: string; | ||
value: string; | ||
targeting: boolean; | ||
} | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_setuserspaceunhandlederrorhandler | ||
function setUserspaceUnhandledErrorHandler( | ||
handler: (errorTrigger: RoxErrorTrigger, error: Error) => void | ||
): void; | ||
/** | ||
* Note that you might have to call unfreeze after setting custom properties such as email after login | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-releases/custom-properties | ||
*/ | ||
function setCustomNumberProperty(name: string, value: number | ((context?: unknown) => number)): void; | ||
function setCustomStringProperty(name: string, value: string | ((context?: unknown) => string)): void; | ||
function setCustomBooleanProperty(name: string, value: boolean | ((context?: unknown) => boolean)): void; | ||
/** | ||
* Unfreeze the state of all flags in code | ||
* Calling this function will unfreeze all flags, and using a flag will return it’s most updated value | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-flags/flag-freeze#_flag_unfreeze | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_unfreeze_4 | ||
*/ | ||
function unfreeze(namespace?: string): void; | ||
// https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_setuserspaceunhandlederrorhandler | ||
function setUserspaceUnhandledErrorHandler( | ||
handler: (errorTrigger: RoxErrorTrigger, error: Error) => void, | ||
): void; | ||
/** | ||
* Pulls the latest configuration and flag values down from the Rollout servers | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_fetch | ||
*/ | ||
function fetch(): void; | ||
/** | ||
* Unfreeze the state of all flags in code | ||
* Calling this function will unfreeze all flags, and using a flag will return it’s most updated value | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-flags/flag-freeze#_flag_unfreeze | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_unfreeze_4 | ||
*/ | ||
function unfreeze(namespace?: string): void; | ||
/** | ||
* Opens the flag override view, providing a debug UI for the application's set of feature flags. | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_showoverrides | ||
*/ | ||
function showOverrides(position?: RoxOverridesPosition): void; | ||
/** | ||
* Pulls the latest configuration and flag values down from the Rollout servers | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_fetch | ||
*/ | ||
function fetch(): void; | ||
enum RoxOverridesPosition { | ||
TopLeft = 'top left', | ||
TopRight = 'top right', | ||
BottomLeft = 'bottom left', | ||
BottomRight = 'bottom right' | ||
} | ||
/** | ||
* Opens the flag override view, providing a debug UI for the application's set of feature flags. | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_showoverrides | ||
*/ | ||
function showOverrides(position?: RoxOverridesPosition): void; | ||
/** | ||
* Default is none | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-flags/flag-freeze | ||
*/ | ||
enum RoxFlagFreezeLevel { | ||
None = 'none', | ||
UntilForeground = 'untilForeground', | ||
UntilLaunch = 'untilLaunch' | ||
} | ||
enum RoxOverridesPosition { | ||
TopLeft = "top left", | ||
TopRight = "top right", | ||
BottomLeft = "bottom left", | ||
BottomRight = "bottom right", | ||
} | ||
interface RoxFlagOptions { | ||
freeze?: RoxFlagFreezeLevel | undefined; | ||
} | ||
/** | ||
* Default is none | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags/latest/feature-flags/flag-freeze | ||
*/ | ||
enum RoxFlagFreezeLevel { | ||
None = "none", | ||
UntilForeground = "untilForeground", | ||
UntilLaunch = "untilLaunch", | ||
} | ||
/** | ||
* Creates a new Flag | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_flag | ||
*/ | ||
class Flag { | ||
constructor(defaultValue?: boolean, options?: RoxFlagOptions); | ||
interface RoxFlagOptions { | ||
freeze?: RoxFlagFreezeLevel | undefined; | ||
} | ||
// The name of the Flag | ||
readonly name: string; | ||
/** | ||
* Creates a new Flag | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_flag | ||
*/ | ||
class Flag { | ||
constructor(defaultValue?: boolean, options?: RoxFlagOptions); | ||
// Default value of the Flag | ||
readonly defaultValue: boolean; | ||
// The name of the Flag | ||
readonly name: string; | ||
// Returns true when the flag is enabled | ||
isEnabled(context?: unknown): boolean; | ||
// Default value of the Flag | ||
readonly defaultValue: boolean; | ||
// Unlock the Flag value from changes from the last time it was freezed | ||
unfreeze(): void; | ||
} | ||
// Returns true when the flag is enabled | ||
isEnabled(context?: unknown): boolean; | ||
/** | ||
* Used to create and manage Rollout feature flags that determine different predefined string values | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_roxstring | ||
*/ | ||
class RoxString { | ||
constructor(defaultValue: string, options?: ReadonlyArray<string>); | ||
// Unlock the Flag value from changes from the last time it was freezed | ||
unfreeze(): void; | ||
} | ||
// The name of the RoxString | ||
readonly name: string; | ||
/** | ||
* Used to create and manage Rollout feature flags that determine different predefined string values | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_roxstring | ||
*/ | ||
class RoxString { | ||
constructor(defaultValue: string, options?: ReadonlyArray<string>); | ||
// Default value of the RoxString | ||
readonly defaultValue: string; | ||
// The name of the RoxString | ||
readonly name: string; | ||
// Returns the current value of the RoxString, accounting for value overrides | ||
getValue(context?: unknown): string; | ||
// Default value of the RoxString | ||
readonly defaultValue: string; | ||
// Unlock the RoxString value from changes from the last time it was freezed | ||
unfreeze(): void; | ||
} | ||
// Returns the current value of the RoxString, accounting for value overrides | ||
getValue(context?: unknown): string; | ||
/** | ||
* Used to create and manage Rollout feature flags that determine different predefined number values | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_roxnumber | ||
*/ | ||
class RoxNumber { | ||
constructor(defaultValue: number, options?: ReadonlyArray<number>); | ||
// Unlock the RoxString value from changes from the last time it was freezed | ||
unfreeze(): void; | ||
} | ||
// The name of the RoxNumber | ||
readonly name: string; | ||
/** | ||
* Used to create and manage Rollout feature flags that determine different predefined number values | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_roxnumber | ||
*/ | ||
class RoxNumber { | ||
constructor(defaultValue: number, options?: ReadonlyArray<number>); | ||
// Default value of the RoxNumber | ||
readonly defaultValue: number; | ||
// The name of the RoxNumber | ||
readonly name: string; | ||
// Returns the current value of the RoxNumber, accounting for value overrides | ||
getValue(context?: unknown): number; | ||
// Default value of the RoxNumber | ||
readonly defaultValue: number; | ||
// Unlock the RoxNumber value from changes from the last time it was freezed | ||
unfreeze(): void; | ||
} | ||
// Returns the current value of the RoxNumber, accounting for value overrides | ||
getValue(context?: unknown): number; | ||
/** | ||
* Override: Should only be used for development purposes (QA - Feature dev - e2e) | ||
* | ||
* When you override an existing flag value using the Rox.overrides.setOverride method, | ||
* the SDK will disregard existing configuration coming from the dashboard and will | ||
* serialize the override on disk this value will be loaded and override the flag | ||
* right after you call Rox.setup. To clear the override from the cache you need to | ||
* call the Rox.overrides.clearOverride method | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides | ||
*/ | ||
namespace overrides { | ||
// Unlock the RoxNumber value from changes from the last time it was freezed | ||
unfreeze(): void; | ||
} | ||
/** | ||
* Sets an override value on a specific flag, this function accepts two parameters flag name ( | ||
* full flag name including namespace) and desired value (from type String). | ||
* This function also saves the override value on the local device disk, | ||
* so it is "remembered" for the next the SDK is loaded to production. | ||
* Override: Should only be used for development purposes (QA - Feature dev - e2e) | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides_setoverride | ||
* When you override an existing flag value using the Rox.overrides.setOverride method, | ||
* the SDK will disregard existing configuration coming from the dashboard and will | ||
* serialize the override on disk this value will be loaded and override the flag | ||
* right after you call Rox.setup. To clear the override from the cache you need to | ||
* call the Rox.overrides.clearOverride method | ||
* | ||
* Note that for boolean flag we still give the value as a string. | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides | ||
*/ | ||
function setOverride(nameSpacedFlagName: string, value: string): void; | ||
namespace overrides { | ||
/** | ||
* Sets an override value on a specific flag, this function accepts two parameters flag name ( | ||
* full flag name including namespace) and desired value (from type String). | ||
* This function also saves the override value on the local device disk, | ||
* so it is "remembered" for the next the SDK is loaded to production. | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides_setoverride | ||
* | ||
* Note that for boolean flag we still give the value as a string. | ||
*/ | ||
function setOverride(nameSpacedFlagName: string, value: string): void; | ||
/** | ||
* Clears the override value from the flag (and the disk). | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides_clearoverride | ||
*/ | ||
function clearOverride(nameSpacedFlagName: string): void; | ||
/** | ||
* Clears the override value from the flag (and the disk). | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides_clearoverride | ||
*/ | ||
function clearOverride(nameSpacedFlagName: string): void; | ||
/** | ||
* Clears all override values | ||
*/ | ||
function clearAllOverrides(): void; | ||
/** | ||
* Clears all override values | ||
*/ | ||
function clearAllOverrides(): void; | ||
function getOriginalValue(nameSpacedFlagName: string): string; | ||
function getOriginalValue(nameSpacedFlagName: string): string; | ||
/** | ||
* full flag name including namespace | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides_hasoverride | ||
*/ | ||
function hasOverride(nameSpacedFlagName: string): boolean; | ||
} | ||
/** | ||
* full flag name including namespace | ||
* | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_overrides_hasoverride | ||
*/ | ||
function hasOverride(nameSpacedFlagName: string): boolean; | ||
} | ||
/** | ||
* Dynamic API is an alternative to Rollout static API for defining flags on the | ||
* different container objects and accessing them from that container object. | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_dynamicapi | ||
*/ | ||
namespace dynamicApi { | ||
/** | ||
* Getting boolean value of a flag | ||
* Dynamic API is an alternative to Rollout static API for defining flags on the | ||
* different container objects and accessing them from that container object. | ||
* https://docs.cloudbees.com/docs/cloudbees-feature-flags-api/latest/api-reference/javascript-browser-api#_rox_dynamicapi | ||
*/ | ||
function isEnabled(nameSpacedFlagName: string, defaultValue: boolean, context?: unknown): boolean; | ||
namespace dynamicApi { | ||
/** | ||
* Getting boolean value of a flag | ||
*/ | ||
function isEnabled(nameSpacedFlagName: string, defaultValue: boolean, context?: unknown): boolean; | ||
/** | ||
* Getting string value of a string flag | ||
*/ | ||
function value(nameSpacedFlagName: string, defaultValue: string, context?: unknown): string; | ||
/** | ||
* Getting string value of a string flag | ||
*/ | ||
function value(nameSpacedFlagName: string, defaultValue: string, context?: unknown): string; | ||
/** | ||
* Getting string value of a number flag | ||
*/ | ||
function getNumber(nameSpacedFlagName: string, defaultValue: number, context?: unknown): number; | ||
} | ||
/** | ||
* Getting string value of a number flag | ||
*/ | ||
function getNumber(nameSpacedFlagName: string, defaultValue: number, context?: unknown): number; | ||
} | ||
const flags: ReadonlyArray<Flag>; | ||
const flags: ReadonlyArray<Flag>; | ||
} |
{ | ||
"name": "@types/rox-browser", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"description": "TypeScript definitions for rox-browser", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rox-browser", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "c3a3344c6e247e502b79ec1969a9cb60398dc5aa240dc2e978c36602b4b7e7b2", | ||
"typeScriptVersion": "4.3" | ||
"typesPublisherContentHash": "ca3f88dfd4c54c4414b1504313597a3cb8bbd9b4e6e7a16d1276f16770e9cd05", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 15 Aug 2023 18:02:44 GMT | ||
* Last updated: Wed, 27 Sep 2023 07:12:04 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `Rox` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13709
237