/*
 * Microsoft Application Insights properties plugin, 3.4.3
 * Copyright (c) Microsoft and contributors. All rights reserved.
 *
 * Microsoft Application Insights Team
 * https://github.com/microsoft/ApplicationInsights-JS#readme
 *
 * ---------------------------------------------------------------------------
 * This is a single combined (rollup) declaration file for the package,
 * if you require a namespace wrapped version it is also available.
 * - Namespaced version: types/applicationinsights-properties-js.namespaced.d.ts
 * ---------------------------------------------------------------------------
 */

import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';
import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
import { IConfig } from '@microsoft/applicationinsights-core-js';
import { IConfiguration } from '@microsoft/applicationinsights-core-js';
import { IPlugin } from '@microsoft/applicationinsights-core-js';
import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
import { IPropertiesPlugin } from '@microsoft/applicationinsights-core-js';
import { ISession } from '@microsoft/applicationinsights-core-js';
import { ISessionManager } from '@microsoft/applicationinsights-core-js';
import { ITelemetryContext } from '@microsoft/applicationinsights-core-js';
import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js';
import { ITelemetryTrace } from '@microsoft/applicationinsights-core-js';
import { IUnloadHookContainer } from '@microsoft/applicationinsights-core-js';

export declare interface IPropTelemetryContext extends ITelemetryContext {
    readonly sessionManager: ISessionManager;
    applySessionContext(evt: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyOperatingSystemContxt(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyApplicationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyDeviceContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyInternalContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyLocationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyOperationContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyWebContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    applyUserContext(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
    cleanUp(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
}

export declare interface ISessionConfig {
    readonly sessionRenewalMs?: number;
    readonly sessionExpirationMs?: number;
    readonly namePrefix?: string;
    readonly sessionCookiePostfix?: string;
    readonly idLength?: number;
    readonly getNewId?: (idLength?: number) => string;
    /**
     * @deprecated Avoid using this value to override the cookie manager cookie domain.
     */
    cookieDomain?: string;
}

export { ITelemetryTrace }

export declare class PropertiesPlugin extends BaseTelemetryPlugin implements IPropertiesPlugin {
    context: IPropTelemetryContext;
    priority: number;
    identifier: string;
    constructor();
    initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
    /**
     * Add Part A fields to the event
     * @param event - The event that needs to be processed
     */
    processTelemetry(event: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
}

export declare class Session implements ISession {
    /**
     * The session ID.
     */
    id?: string;
    /**
     * The date at which this guid was generated.
     * Per the spec the ID will be regenerated if more than acquisitionSpan milliseconds elapsed from this time.
     */
    acquisitionDate?: number;
    /**
     * The date at which this session ID was last reported.
     * This value should be updated whenever telemetry is sent using this ID.
     * Per the spec the ID will be regenerated if more than renewalSpan milliseconds elapse from this time with no activity.
     */
    renewalDate?: number;
}

export declare class SessionManager implements ISessionManager {
    automaticSession: Session;
    constructor(config: ISessionConfig, core?: IAppInsightsCore, unloadHookContainer?: IUnloadHookContainer);
    update(): void;
    /**
     *  Record the current state of the automatic session and store it in our cookie string format
     *  into the browser's local storage. This is used to restore the session data when the cookie
     *  expires.
     */
    backup(): void;
}

export { }
