/**
 * Copyright 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 { OdpConfig } from './odp_config';
import { IOdpEventManager } from './odp_event_manager';
import { IOdpSegmentManager } from './odp_segment_manager';
import { OptimizelySegmentOption } from './optimizely_segment_option';
import { OdpEvent } from './odp_event';
/**
 * Manager for handling internal all business logic related to
 * Optimizely Data Platform (ODP) / Advanced Audience Targeting (AAT)
 */
export interface IOdpManager {
    initPromise?: Promise<void>;
    enabled: boolean;
    segmentManager: IOdpSegmentManager | undefined;
    eventManager: IOdpEventManager | undefined;
    updateSettings({ apiKey, apiHost, pixelUrl, segmentsToCheck }: OdpConfig): boolean;
    close(): void;
    fetchQualifiedSegments(userId: string, options?: Array<OptimizelySegmentOption>): Promise<string[] | null>;
    identifyUser(userId?: string, vuid?: string): void;
    sendEvent({ type, action, identifiers, data }: OdpEvent): void;
    isVuidEnabled(): boolean;
    getVuid(): string | undefined;
}
/**
 * Orchestrates segments manager, event manager, and ODP configuration
 */
export declare abstract class OdpManager implements IOdpManager {
    /**
     * Promise that returns when the OdpManager is finished initializing
     */
    initPromise?: Promise<void>;
    /**
     * Switch to enable/disable ODP Manager functionality
     */
    enabled: boolean;
    /**
     * ODP Segment Manager which provides an interface to the remote ODP server (GraphQL API) for audience segments mapping.
     * It fetches all qualified segments for the given user context and manages the segments cache for all user contexts.
     */
    segmentManager: IOdpSegmentManager | undefined;
    /**
     * ODP Event Manager which provides an interface to the remote ODP server (REST API) for events.
     * It will queue all pending events (persistent) and send them (in batches of up to 10 events) to the ODP server when possible.
     */
    eventManager: IOdpEventManager | undefined;
    /**
     * Handler for recording execution logs
     * @protected
     */
    protected logger: LogHandler;
    /**
     * ODP configuration settings for identifying the target API and segments
     */
    odpConfig: OdpConfig;
    constructor();
    /**
     * Provides a method to update ODP Manager's ODP Config API Key, API Host, and Audience Segments
     */
    updateSettings({ apiKey, apiHost, pixelUrl, segmentsToCheck }: OdpConfig): boolean;
    /**
     * Attempts to stop the current instance of ODP Manager's event manager, if it exists and is running.
     */
    close(): void;
    /**
     * 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 {string}                          userId  - Unique identifier of a target user.
     * @param {Array<OptimizelySegmentOption>}  options - An array of OptimizelySegmentOption used to ignore and/or reset the cache.
     * @returns {Promise<string[] | null>}      A promise holding either a list of qualified segments or null.
     */
    fetchQualifiedSegments(userId: string, options?: Array<OptimizelySegmentOption>): Promise<string[] | null>;
    /**
     * Identifies a user via the ODP Event Manager
     * @param {string}  userId    (Optional) Custom unique identifier of a target user.
     * @param {string}  vuid      (Optional) Secondary unique identifier of a target user, primarily used by client SDKs.
     * @returns
     */
    identifyUser(userId?: string, vuid?: string): void;
    /**
     * Sends an event to the ODP Server via the ODP Events API
     * @param {OdpEvent}  > ODP Event to send to event manager
     */
    sendEvent({ type, action, identifiers, data }: OdpEvent): void;
    /**
     * Identifies if the VUID feature is enabled
     */
    abstract isVuidEnabled(): boolean;
    /**
     * Returns VUID value if it exists
     */
    abstract getVuid(): string | undefined;
}
