/** * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * @format */ import * as coreOneDS from '@microsoft/1ds-core-js'; import * as errorUtils from './utils/errorUtils'; import * as projectUtils from './utils/projectUtils'; export interface TelemetryOptions { setupString: string; preserveErrorMessages: boolean; populateNpmPackageVersions: boolean; } export interface CommandStartInfo { commandName: string; args: Record; options: Record; defaultOptions: Record; } export interface CommandEndInfo { resultCode: errorUtils.CodedErrorType; finalOptions?: Record; } interface CommandInfo { startTime?: number; endTime?: number; startInfo?: CommandStartInfo; endInfo?: CommandEndInfo; } export declare const CommandEventName = "RNWCLI.Command"; export declare const CodedErrorEventName = "RNWCLI.CodedError"; export declare const EventNamesWeTrack: string[]; export declare const NpmPackagesWeTrack: string[]; export declare const NuGetPackagesWeTrack: string[]; /** * The Telemetry class is responsible for reporting telemetry for RNW CLI. */ export declare class Telemetry { protected static appInsightsCore?: coreOneDS.AppInsightsCore; protected static options: TelemetryOptions; protected static isTestEnvironment: boolean; protected static commandInfo: CommandInfo; protected static versionsProp: Record; protected static projectProp?: projectUtils.AppProjectInfo | projectUtils.DependencyProjectInfo; protected static commonProperties: { [key: string]: string; }; protected static getDefaultSetupString(): string; protected static reset(): void; static isEnabled(): boolean; static getSessionId(): string; /** Sets up the Telemetry static to be used elsewhere. */ static setup(options?: Partial): Promise; private static basicTelemetryInitializer; /** Sets up Telemetry.appInsightsCore. */ private static setupClient; /** Sets up any base properties that all telemetry events require. */ private static setupBaseProperties; /** Tries to update the version of the named package/tool by calling getValue(). */ static tryUpdateVersionsProp(name: string, getValue: () => Promise, forceRefresh?: boolean): Promise; /** Populates the versions property of tools we care to track. */ static populateToolsVersions(refresh?: boolean): Promise; /** Populates the versions property of npm packages we care to track. */ static populateNpmPackageVersions(refresh?: boolean): Promise; /** Populates the versions property of nuget packages we care to track. */ static populateNuGetPackageVersions(projectFile: string, refresh?: boolean): Promise; static setProjectInfo(info: projectUtils.AppProjectInfo | projectUtils.DependencyProjectInfo): void; static startCommand(info: CommandStartInfo): void; static endCommand(info: CommandEndInfo, extraProps?: Record): void; private static trackEvent; private static trackCommandEvent; static trackException(error: Error, extraProps?: Record): void; static convertErrorIntoExceptionData(error: Error): Record; static sanitizeAny(data: any): any; } export {};