import type { TelemetrySender } from 'vscode';
import { IDisposable } from '../../../util/vs/base/common/lifecycle';
import { ICopilotTokenStore } from '../../authentication/common/copilotTokenStore';
import type { TelemetryData } from './telemetryData';
export interface TelemetryEventMeasurements {
    readonly [key: string]: number | undefined;
}
export interface TelemetryEventProperties {
    readonly [key: string]: string | import('vscode').TelemetryTrustedValue<string> | undefined;
}
/**
 * Telemetry for the experimentation service.
 */
export interface IExperimentationTelemetry {
    /**
     * Set shared property for all events.
     * @param name The name of the shared property.
     * @param value The value of the shared property.
     */
    setSharedProperty(name: string, value: string): void;
    /**
     * Posts an event into the telemetry implementation.
     */
    postEvent(eventName: string, props: Map<string, string>): void;
}
export declare const ITelemetryUserConfig: import("../../../util/common/services").ServiceIdentifier<ITelemetryUserConfig>;
export interface ITelemetryUserConfig {
    readonly _serviceBrand: undefined;
    trackingId: string | undefined;
    organizationsList: string | undefined;
    enterpriseList: string | undefined;
    optedIn: boolean;
}
export declare class TelemetryUserConfigImpl implements ITelemetryUserConfig {
    private readonly _tokenStore;
    readonly _serviceBrand: undefined;
    trackingId: string | undefined;
    organizationsList: string | undefined;
    enterpriseList: string | undefined;
    optedIn: boolean;
    constructor(trackingId: string | undefined, optedIn: boolean | undefined, _tokenStore: ICopilotTokenStore);
    private updateFromToken;
}
export type TelemetryProperties = {
    [key: string]: string;
};
export type AdditionalTelemetryProperties = {
    [key: string]: string;
};
/**
 * Creates a getter that returns the tracking ID from the token store.
 * The cache is:
 * - initialized from the current token (if available) when the getter is created
 * - updated whenever the token store changes
 * - returned even when the token is temporarily unavailable
 */
export declare function createTrackingIdGetter(tokenStore: ICopilotTokenStore): () => string | undefined;
export type TelemetryDestination = {
    github: boolean | {
        eventNamePrefix: string;
    };
    microsoft: boolean;
};
export interface ITelemetryService extends IExperimentationTelemetry, IDisposable {
    readonly _serviceBrand: undefined;
    /**
     * Send a Microsoft internal telemetry event.
     *
     * @remark This is a no-op if the user is not part of an allowed organization.
     * @remark This event does not require GDPR comments due to being classified in a special manner for internal use only.

     */
    sendInternalMSFTTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendMSFTTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendMSFTTelemetryErrorEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendGHTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendGHTelemetryErrorEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendGHTelemetryException(maybeError: unknown, origin: string): void;
    sendEnhancedGHTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendEnhancedGHTelemetryErrorEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendTelemetryEvent(eventName: string, destination: TelemetryDestination, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendTelemetryEvent<TTelemetryEvent extends ITelemetryEvent>(eventName: TTelemetryEvent['eventName'], destination: TelemetryDestination, properties?: TTelemetryEvent['properties'], measurements?: TTelemetryEvent['measurements']): void;
    sendTelemetryErrorEvent(eventName: string, destination: TelemetryDestination, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    setAdditionalExpAssignments(expAssignments: string[]): void;
}
export interface ITelemetryEvent {
    eventName: string;
    properties?: object;
    measurements?: object;
}
/**
 * The "sub services" which power the telemetry service and send telemetry to the appropriate endpoints.
 */
export interface ITelemetrySender extends IDisposable {
    sendTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
    sendTelemetryErrorEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
}
export declare const ITelemetryService: import("../../../util/common/services").ServiceIdentifier<ITelemetryService>;
export interface IMSFTTelemetrySender extends ITelemetrySender {
    /**
     * Send a Microsoft internal telemetry event.
     *
     * @remark This is a no-op if the user is not part of an allowed organization.
     * @remark This event does not require GDPR comments due to be classified in a special manner for internal use only.
     */
    sendInternalTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
}
export interface IGHTelemetryService {
    readonly _serviceBrand: undefined;
    setSecureReporter(reporter: TelemetrySender | undefined): void;
    setReporter(reporter: TelemetrySender | undefined): void;
    /**
     * Standard telemetry events can be disabled with VS Code's telemetry settings.
     */
    sendTelemetry(name: string, telemetryData?: TelemetryData): Promise<void>;
    /**
     * Standard telemetry events can be disabled with VS Code's telemetry settings.
     */
    sendErrorTelemetry(name: string, telemetryData?: TelemetryData): Promise<void>;
    /**
     * Enhanced telemetry events contain additional data such as user prompts and suggestions. Like standard telemetry events, it can disabled with VS Code's telemetry settings or the Copilot settings page.
     *
     * You can manage this setting on the Copilot settings page https://github.com/settings/copilot/features
     * Learn about configuring this telemetry at https://docs.github.com/en/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-your-copilot-plan/managing-copilot-policies-as-an-individual-subscriber#enabling-or-disabling-prompt-and-suggestion-collection
     * Learn more about the data collected at https://github.com/features/copilot/#faq
     */
    sendEnhancedTelemetry(name: string, telemetryData?: TelemetryData): Promise<void>;
    /**
     * Enhanced telemetry events contain additional data such as user prompts and suggestions. Like standard telemetry events, it can disabled with VS Code's telemetry settings or the Copilot settings page.
     *
     * You can manage this setting on the Copilot settings page https://github.com/settings/copilot/features
     * Learn about configuring this telemetry at https://docs.github.com/en/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-your-copilot-plan/managing-copilot-policies-as-an-individual-subscriber#enabling-or-disabling-prompt-and-suggestion-collection
     * Learn more about the data collected at https://github.com/features/copilot/#faq
     */
    sendEnhancedErrorTelemetry(name: string, telemetryData?: TelemetryData): Promise<void>;
    sendExpProblemTelemetry(telemetryProperties: {
        reason: string;
    }): Promise<void>;
    sendExceptionTelemetry(maybeError: unknown, origin: string): Promise<void>;
    deactivate(): Promise<void>;
}
/**
 * Borrowed from https://github.com/microsoft/vscode/blob/9e560ad042bbc97e98f241f58cd08ddde0458a30/src/vs/platform/telemetry/common/telemetryUtils.ts#L21-L25
 * Used as an API type in the vscode.d.ts as well to indicate properties that are exempt from cleaning.
 */
export declare class TelemetryTrustedValue<T> {
    readonly value: T;
    readonly isTrustedTelemetryValue = true;
    constructor(value: T);
}
export declare function multiplexProperties(properties: {
    [key: string]: string | undefined;
}): {
    [key: string]: string | undefined;
};
//# sourceMappingURL=telemetry.d.ts.map