configcat-common
Version:
ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.
69 lines • 4.42 kB
TypeScript
import type { IConfigCatClient, IConfigCatKernel } from "./ConfigCatClient";
import type { IAutoPollOptions, ILazyLoadingOptions, IManualPollOptions, OptionsForPollingMode } from "./ConfigCatClientOptions";
import { PollingMode } from "./ConfigCatClientOptions";
import type { IConfigCatLogger } from "./ConfigCatLogger";
import { LogLevel } from "./ConfigCatLogger";
import { FlagOverrides, OverrideBehaviour } from "./FlagOverrides";
import type { SettingValue } from "./ProjectConfig";
/**
* Returns an instance of `ConfigCatClient` for the specified SDK Key.
* @remarks This method returns a single, shared instance per each distinct SDK Key.
* That is, a new client object is created only when there is none available for the specified SDK Key.
* Otherwise, the already created instance is returned (in which case the `pollingMode`, `options` and `configCatKernel` arguments are ignored).
* So, please keep in mind that when you make multiple calls to this method using the same SDK Key, you may end up with multiple references to the same client object.
* @param sdkKey SDK Key to access the ConfigCat config.
* @param pollingMode The polling mode to use.
* @param options Options for the specified polling mode.
*/
export declare function getClient<TMode extends PollingMode>(sdkKey: string, pollingMode: TMode, options: OptionsForPollingMode<TMode> | undefined | null, configCatKernel: IConfigCatKernel): IConfigCatClient;
/**
* Disposes all existing `ConfigCatClient` instances.
*/
export declare function disposeAllClients(): void;
/**
* Creates an instance of `ConfigCatConsoleLogger`.
* @param logLevel Log level (the minimum level to use for filtering log events).
* @param eol The character sequence to use for line breaks in log messages. Defaults to "\n".
*/
export declare function createConsoleLogger(logLevel: LogLevel, eol?: string): IConfigCatLogger;
/**
* Creates an instance of `FlagOverrides` that uses a map data source.
* @param map The map that contains the overrides.
* @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 input map will be tracked for changes.
*/
export declare function createFlagOverridesFromMap(map: {
[name: string]: NonNullable<SettingValue>;
}, behaviour: OverrideBehaviour, watchChanges?: boolean): FlagOverrides;
export type { IConfigCatKernel };
export type { IConfigFetcher, IFetchResponse, FetchErrorCauses } from "./ConfigFetcher";
export { FetchStatus, FetchResult, FetchError } from "./ConfigFetcher";
export type { OptionsBase } from "./ConfigCatClientOptions";
export type { IConfigCache } from "./ConfigCatCache";
export { InMemoryConfigCache, ExternalConfigCache } from "./ConfigCatCache";
export type { IEventProvider, IEventEmitter } from "./EventEmitter";
export { PollingMode };
export type { IOptions } from "./ConfigCatClientOptions";
export type { IAutoPollOptions, IManualPollOptions, ILazyLoadingOptions };
export { DataGovernance } from "./ConfigCatClientOptions";
export type { IConfigCatLogger };
export type { LogEventId, LogMessage } from "./ConfigCatLogger";
export { LogLevel };
export { FormattableLogMessage } from "./ConfigCatLogger";
export type { IConfigCatCache } from "./ConfigCatCache";
export type { IConfig, ISegment, SettingTypeMap, SettingValue, VariationIdValue, ISettingValueContainer, ISettingUnion, ISetting, ITargetingRule, IPercentageOption, ConditionTypeMap, IConditionUnion, ICondition, UserConditionComparisonValueTypeMap, IUserConditionUnion, IUserCondition, IPrerequisiteFlagCondition, ISegmentCondition } from "./ProjectConfig";
export { SettingType, UserComparator, PrerequisiteFlagComparator, SegmentComparator } from "./ConfigJson";
export type { IConfigCatClient };
export type { IConfigCatClientSnapshot } from "./ConfigCatClient";
export { SettingKeyValue } from "./ConfigCatClient";
export type { IEvaluationDetails, SettingTypeOf } from "./RolloutEvaluator";
export type { UserAttributeValue } from "./User";
export { User } from "./User";
export type { FlagOverrides };
export { OverrideBehaviour };
export { ClientCacheState, RefreshResult } from "./ConfigServiceBase";
export type { IProvidesHooks, HookEvents } from "./Hooks";
//# sourceMappingURL=index.d.ts.map