/**
 * Copyright 2022-2023, Optimizely
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { LogHandler } from '../../modules/logging';
import { ODP_USER_KEY } from '../../utils/enums';
import { ICache } from '../../utils/lru_cache';
import { IOdpSegmentApiManager } from './odp_segment_api_manager';
import { OdpConfig } from './odp_config';
import { OptimizelySegmentOption } from './optimizely_segment_option';
export interface IOdpSegmentManager {
    fetchQualifiedSegments(userKey: ODP_USER_KEY, userValue: string, options: Array<OptimizelySegmentOption>): Promise<string[] | null>;
    reset(): void;
    makeCacheKey(userKey: string, userValue: string): string;
    updateSettings(config: OdpConfig): void;
}
/**
 * Schedules connections to ODP for audience segmentation and caches the results.
 */
export declare class OdpSegmentManager implements IOdpSegmentManager {
    /**
     * ODP configuration settings in used
     * @private
     */
    private odpConfig;
    /**
     * Holds cached audience segments
     * @private
     */
    private _segmentsCache;
    /**
     * Getter for private segments cache
     * @public
     */
    get segmentsCache(): ICache<string, string[]>;
    /**
     * GraphQL API Manager used to fetch segments
     * @private
     */
    private odpSegmentApiManager;
    /**
     * Handler for recording execution logs
     * @private
     */
    private readonly logger;
    constructor(odpConfig: OdpConfig, segmentsCache: ICache<string, string[]>, odpSegmentApiManager: IOdpSegmentApiManager, logger?: LogHandler);
    /**
     * Attempts to fetch and return a list of a user's qualified segments from the local segments cache.
     * If no cached data exists for the target user, this fetches and caches data from the ODP server instead.
     * @param userKey Key used for identifying the id type.
     * @param userValue The id value itself.
     * @param options An array of OptimizelySegmentOption used to ignore and/or reset the cache.
     * @returns Qualified segments for the user from the cache or the ODP server if the cache is empty.
     */
    fetchQualifiedSegments(userKey: ODP_USER_KEY, userValue: string, options: Array<OptimizelySegmentOption>): Promise<string[] | null>;
    /**
     * Clears the segments cache
     */
    reset(): void;
    /**
     * Creates a key used to identify which user fetchQualifiedSegments should lookup and save to in the segments cache
     * @param userKey User type based on ODP_USER_KEY, such as "vuid" or "fs_user_id"
     * @param userValue Arbitrary string, such as "test-user"
     * @returns Concatenates inputs and returns the string "{userKey}-$-{userValue}"
     */
    makeCacheKey(userKey: string, userValue: string): string;
    /**
     * Updates the ODP Config settings of ODP Segment Manager
     * @param config New ODP Config that will overwrite the existing config
     */
    updateSettings(config: OdpConfig): void;
}
