configcat-react
Advanced tools
Comparing version 4.7.0 to 4.8.0
@@ -7,3 +7,3 @@ "use client"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RefreshResult = exports.ClientCacheState = exports.OverrideBehaviour = exports.User = exports.SettingKeyValue = exports.SegmentComparator = exports.PrerequisiteFlagComparator = exports.UserComparator = exports.SettingType = exports.FormattableLogMessage = exports.LogLevel = exports.DataGovernance = exports.PollingMode = exports.withConfigCatClient = exports.useConfigCatClient = exports.useFeatureFlag = exports.ConfigCatProvider = exports.createFlagOverridesFromMap = exports.createConsoleLogger = void 0; | ||
exports.RefreshResult = exports.ClientCacheState = exports.OverrideBehaviour = exports.User = exports.SettingKeyValue = exports.SegmentComparator = exports.PrerequisiteFlagComparator = exports.UserComparator = exports.SettingType = exports.FormattableLogMessage = exports.LogLevel = exports.DataGovernance = exports.PollingMode = exports.withConfigCatClient = exports.useConfigCatClient = exports.useFeatureFlag = exports.ConfigCatProvider = exports.createFlagOverridesFromQueryParams = exports.createFlagOverridesFromMap = exports.createConsoleLogger = void 0; | ||
var ConfigCatHOC_1 = __importDefault(require("./ConfigCatHOC")); | ||
@@ -16,5 +16,23 @@ exports.withConfigCatClient = ConfigCatHOC_1.default; | ||
exports.ConfigCatProvider = ConfigCatProvider_1.default; | ||
var FlagOverrides_1 = require("./FlagOverrides"); | ||
var configcat_common_1 = require("configcat-common"); | ||
Object.defineProperty(exports, "createConsoleLogger", { enumerable: true, get: function () { return configcat_common_1.createConsoleLogger; } }); | ||
Object.defineProperty(exports, "createFlagOverridesFromMap", { enumerable: true, get: function () { return configcat_common_1.createFlagOverridesFromMap; } }); | ||
/** | ||
* Creates an instance of `FlagOverrides` that uses query string parameters as data source. | ||
* @param behaviour The override behaviour. | ||
* Specifies whether the local values should override the remote values | ||
* or local values should only be used when a remote value doesn't exist | ||
* or the local values should be used only. | ||
* @param watchChanges If set to `true`, the query string will be tracked for changes. | ||
* @param paramPrefix The parameter name prefix used to indicate which query string parameters | ||
* specify feature flag override values. Parameters whose name doesn't start with the | ||
* prefix will be ignored. Defaults to `cc-`. | ||
* @param queryStringProvider The provider object used to obtain the query string. | ||
* Defaults to a provider that returns the value of `window.location.search`. | ||
*/ | ||
function createFlagOverridesFromQueryParams(behaviour, watchChanges, paramPrefix, queryStringProvider) { | ||
return new FlagOverrides_1.flagOverridesConstructor(new FlagOverrides_1.QueryParamsOverrideDataSource(watchChanges, paramPrefix, queryStringProvider), behaviour); | ||
} | ||
exports.createFlagOverridesFromQueryParams = createFlagOverridesFromQueryParams; | ||
/* Public types re-export from common-js */ | ||
@@ -21,0 +39,0 @@ // These exports should be kept in sync with the exports listed in the section "Public types for end users" of common-js/src/index.ts! |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "4.7.0"; | ||
exports.default = "4.8.0"; |
@@ -5,3 +5,20 @@ "use client"; | ||
import ConfigCatProvider from "./ConfigCatProvider"; | ||
import { QueryParamsOverrideDataSource, flagOverridesConstructor } from "./FlagOverrides"; | ||
export { createConsoleLogger, createFlagOverridesFromMap } from "configcat-common"; | ||
/** | ||
* Creates an instance of `FlagOverrides` that uses query string parameters as data source. | ||
* @param behaviour The override behaviour. | ||
* Specifies whether the local values should override the remote values | ||
* or local values should only be used when a remote value doesn't exist | ||
* or the local values should be used only. | ||
* @param watchChanges If set to `true`, the query string will be tracked for changes. | ||
* @param paramPrefix The parameter name prefix used to indicate which query string parameters | ||
* specify feature flag override values. Parameters whose name doesn't start with the | ||
* prefix will be ignored. Defaults to `cc-`. | ||
* @param queryStringProvider The provider object used to obtain the query string. | ||
* Defaults to a provider that returns the value of `window.location.search`. | ||
*/ | ||
export function createFlagOverridesFromQueryParams(behaviour, watchChanges, paramPrefix, queryStringProvider) { | ||
return new flagOverridesConstructor(new QueryParamsOverrideDataSource(watchChanges, paramPrefix, queryStringProvider), behaviour); | ||
} | ||
export { ConfigCatProvider, useFeatureFlag, useConfigCatClient, withConfigCatClient }; | ||
@@ -8,0 +25,0 @@ /* Public types re-export from common-js */ |
@@ -1,1 +0,1 @@ | ||
export default "4.7.0"; | ||
export default "4.8.0"; |
@@ -1,2 +0,2 @@ | ||
import type { IAutoPollOptions, IConfigCatLogger, ILazyLoadingOptions, IManualPollOptions } from "configcat-common"; | ||
import type { FlagOverrides, IAutoPollOptions, IConfigCatLogger, ILazyLoadingOptions, IManualPollOptions, OverrideBehaviour } from "configcat-common"; | ||
import type { GetValueType, WithConfigCatClientProps } from "./ConfigCatHOC"; | ||
@@ -6,3 +6,19 @@ import withConfigCatClient from "./ConfigCatHOC"; | ||
import ConfigCatProvider from "./ConfigCatProvider"; | ||
import type { IQueryStringProvider } from "./FlagOverrides"; | ||
export { createConsoleLogger, createFlagOverridesFromMap } from "configcat-common"; | ||
/** | ||
* Creates an instance of `FlagOverrides` that uses query string parameters as data source. | ||
* @param behaviour The override behaviour. | ||
* Specifies whether the local values should override the remote values | ||
* or local values should only be used when a remote value doesn't exist | ||
* or the local values should be used only. | ||
* @param watchChanges If set to `true`, the query string will be tracked for changes. | ||
* @param paramPrefix The parameter name prefix used to indicate which query string parameters | ||
* specify feature flag override values. Parameters whose name doesn't start with the | ||
* prefix will be ignored. Defaults to `cc-`. | ||
* @param queryStringProvider The provider object used to obtain the query string. | ||
* Defaults to a provider that returns the value of `window.location.search`. | ||
*/ | ||
export declare function createFlagOverridesFromQueryParams(behaviour: OverrideBehaviour, watchChanges?: boolean, paramPrefix?: string, queryStringProvider?: IQueryStringProvider): FlagOverrides; | ||
export type { IQueryStringProvider }; | ||
/** Options used to configure the ConfigCat SDK in the case of Auto Polling mode. */ | ||
@@ -9,0 +25,0 @@ export type IReactAutoPollOptions = IAutoPollOptions; |
{ | ||
"name": "configcat-react", | ||
"version": "4.7.0", | ||
"version": "4.8.0", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "npm run build:esm && npm run build:cjs", |
Sorry, the diff of this file is not supported yet
89638
41
1427