import type { ClientType, DistributionType, EnvironmentType, ServiceResponse } from "../remote-feature-flag-controller-types.cjs"; export declare const DEFAULT_DEGRADED_THRESHOLD = 5000; /** * This service is responsible for fetching feature flags from the ClientConfig API. */ export declare class ClientConfigApiService { #private; /** * Constructs a new ClientConfigApiService object. * * @param args - The arguments. * @param args.fetch - A function that can be used to make an HTTP request. * @param args.retries - Number of retry attempts for each fetch request. * @param args.maximumConsecutiveFailures - The maximum number of consecutive failures * allowed before breaking the circuit and pausing further fetch attempts. * @param args.circuitBreakDuration - The duration for which the circuit remains open after * too many consecutive failures. * @param args.onBreak - Callback invoked when the circuit breaks. * @param args.onDegraded - Callback invoked when the service is degraded (requests resolving too slowly). * @param args.config - The configuration object, includes client, distribution, and environment. * @param args.config.client - The client type (e.g., 'extension', 'mobile'). * @param args.config.distribution - The distribution type (e.g., 'main', 'flask'). * @param args.config.environment - The environment type (e.g., 'prod', 'rc', 'dev'). */ constructor({ fetch: fetchFunction, retries, maximumConsecutiveFailures, circuitBreakDuration, onBreak, onDegraded, config, }: { fetch: typeof fetch; retries?: number; maximumConsecutiveFailures?: number; circuitBreakDuration?: number; onBreak?: () => void; onDegraded?: () => void; config: { client: ClientType; distribution: DistributionType; environment: EnvironmentType; }; }); /** * Fetches feature flags from the API with specific client, distribution, and environment parameters. * Provides structured error handling, including fallback to cached data if available. * @returns An object of feature flags and their boolean values or a structured error object. */ fetchRemoteFeatureFlags(): Promise; /** * Flattens an array of feature flag objects into a single feature flags object. * @param responseData - Array of objects containing feature flag key-value pairs * @returns A single object containing all feature flags merged together * @example * // Input: [{ flag1: true }, { flag2: [] }] * // Output: { flag1: true, flag2: [] } */ private flattenFeatureFlags; } //# sourceMappingURL=client-config-api-service.d.cts.map