/// import { Injector } from '@angular/core'; import IAppInsights = Microsoft.ApplicationInsights.IAppInsights; export declare enum SeverityLevel { Verbose = 0, Information = 1, Warning = 2, Error = 3, Critical = 4 } export declare class AppInsightsConfig implements Microsoft.ApplicationInsights.IConfig { instrumentationKeySetLater?: boolean; instrumentationKeySetlater?: boolean; instrumentationKey?: string; endpointUrl?: string; emitLineDelimitedJson?: boolean; accountId?: string; sessionRenewalMs?: number; sessionExpirationMs?: number; maxBatchSizeInBytes?: number; maxBatchInterval?: number; enableDebug?: boolean; disableExceptionTracking?: boolean; disableTelemetry?: boolean; verboseLogging?: boolean; diagnosticLogInterval?: number; samplingPercentage?: number; autoTrackPageVisitTime?: boolean; disableAjaxTracking?: boolean; overridePageViewDuration?: boolean; maxAjaxCallsPerView?: number; disableDataLossAnalysis?: boolean; disableCorrelationHeaders?: boolean; correlationHeaderExcludedDomains?: string[]; disableFlushOnBeforeUnload?: boolean; enableSessionStorageBuffer?: boolean; isCookieUseDisabled?: boolean; cookieDomain?: string; isRetryDisabled?: boolean; url?: string; isStorageUseDisabled?: boolean; isBeaconApiDisabled?: boolean; sdkExtension?: string; isBrowserLinkTrackingEnabled?: boolean; appId?: string; enableCorsCorrelation?: boolean; namePrefix?: string; overrideTrackPageMetrics?: boolean; enableAutoRouteTracking?: boolean; enableRequestHeaderTracking?: boolean; enableResponseHeaderTracking?: boolean; enableAjaxErrorStatusText?: boolean; enableAjaxPerfTracking?: boolean; maxAjaxPerfLookupAttempts?: number; ajaxPerfLookupDelay?: number; distributedTracingMode?: boolean; enableUnhandledPromiseRejectionTracking?: boolean; disableInstrumentaionKeyValidation?: boolean; enablePerfMgr?: boolean; perfEvtsSendAll?: boolean; } export declare class AppInsightsService implements IAppInsights { private _injector; get context(): Microsoft.ApplicationInsights.ITelemetryContext; get queue(): Array<() => void>; config: AppInsightsConfig; constructor(_config: AppInsightsConfig, _injector: Injector); /** * Log a user action or other occurrence. * @param name A string to identify this event in the portal. * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ trackEvent(eventName: string, eventProperties?: { [name: string]: string; }, metricProperty?: { [name: string]: number; }): void; /** * Start timing an extended event. Call {@link stopTrackEvent} to log the event when it ends. * @param name A string that identifies this event uniquely within the document. */ startTrackEvent(name: string): any; /** * Log an extended event that you started timing with {@link startTrackEvent}. * @param name The string you used to identify this event in startTrackEvent. * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ stopTrackEvent(name: string, properties?: { [p: string]: string; }, measurements?: { [p: string]: number; }): any; /** * Logs that a page or other item was viewed. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. * @param duration number - the number of milliseconds it took to load the page. Defaults to undefined. If set to default value, page load time is calculated internally. */ trackPageView(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, duration?: number): void; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. * @param name A string that idenfities this item, unique within this HTML document. Defaults to the document title. */ startTrackPage(name?: string): void; /** * Logs how long a page or other item was visible, after {@link startTrackPage}. Call this when the page closes. * @param name The string you used as the name in startTrackPage. Defaults to the document title. * @param url String - a relative or absolute URL that identifies the page or other item. Defaults to the window location. * @param properties map[string, string] - additional data used to filter pages and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this page, displayed in Metrics Explorer on the portal. Defaults to empty. */ stopTrackPage(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }): void; /** * Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators. * To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the * telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals. * @param name A string that identifies the metric. * @param average Number representing either a single measurement, or the average of several measurements. * @param sampleCount The number of measurements represented by the average. Defaults to 1. * @param min The smallest measurement in the sample. Defaults to the average. * @param max The largest measurement in the sample. Defaults to the average. */ trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }): void; /** * Log an exception you have caught. * @param exception An Error from a catch clause, or the string error message. * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. * @param severityLevel SeverityLevel | AI.SeverityLevel - severity level */ trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: SeverityLevel | AI.SeverityLevel): void; /** * Log a diagnostic message. * @param message A message string * @param properties map[string, string] - additional data used to filter traces in the portal. Defaults to empty. */ trackTrace(message: string, properties?: { [name: string]: string; }, severityLevel?: SeverityLevel | AI.SeverityLevel): void; /** * Log a dependency call (for instance: ajax) * @param id unique id, this is used by the backend o correlate server requests. Use Util.newId() to generate a unique Id. * @param method represents request verb (GET, POST, etc.) * @param absoluteUrl absolute url used to make the dependency request * @param pathName the path part of the absolute url * @param totalTime total request time * @param success indicates if the request was sessessful * @param resultCode response code returned by the dependency request * @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty. * @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty. */ trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }): void; flush(): void; /** * Sets the authenticated user id and the account id. * User auth id and account id should be of type string. They should not contain commas, semi-colons, equal signs, spaces, or vertical-bars. * * By default the method will only set the authUserID and accountId for all events in this page view. To add them to all events within * the whole session, you should either call this method on every page view or set `storeInCookie = true`. * * @param authenticatedUserId {string} - The authenticated user id. A unique and persistent string that represents each authenticated user in the service. * @param accountId {string} - An optional string to represent the account associated with the authenticated user. * @param storeInCookie {boolean} - AuthenticateUserID will be stored in a cookie and added to all events within this session. */ setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie?: boolean): void; /** * Clears the authenticated user id and the account id from the user context. */ clearAuthenticatedUserContext(): void; _onerror(message: string): any; /** * Initialize Application Insights for Angular * Make sure your config{} has been set */ init(): void; private get router(); }