@microsoft/applicationinsights-core-js 2.8.0-beta.2202-07 → 2.8.0-beta.2203-03

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +1137 -484
  3. package/browser/applicationinsights-core-js.js.map +1 -1
  4. package/browser/applicationinsights-core-js.min.js +2 -2
  5. package/browser/applicationinsights-core-js.min.js.map +1 -1
  6. package/dist/applicationinsights-core-js.api.json +6529 -2784
  7. package/dist/applicationinsights-core-js.api.md +290 -30
  8. package/dist/applicationinsights-core-js.d.ts +481 -89
  9. package/dist/applicationinsights-core-js.js +1137 -484
  10. package/dist/applicationinsights-core-js.js.map +1 -1
  11. package/dist/applicationinsights-core-js.min.js +2 -2
  12. package/dist/applicationinsights-core-js.min.js.map +1 -1
  13. package/dist/applicationinsights-core-js.rollup.d.ts +481 -89
  14. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  15. package/dist-esm/JavaScriptSDK/BaseCore.js +248 -32
  16. package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
  17. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +50 -5
  18. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
  19. package/dist-esm/JavaScriptSDK/ChannelController.js +105 -73
  20. package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
  21. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  22. package/dist-esm/JavaScriptSDK/CookieMgr.js +3 -4
  23. package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
  24. package/dist-esm/JavaScriptSDK/CoreUtils.js +6 -122
  25. package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
  26. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +93 -0
  27. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -0
  28. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  29. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +12 -12
  30. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
  31. package/dist-esm/JavaScriptSDK/EnvUtils.js +8 -7
  32. package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
  33. package/dist-esm/JavaScriptSDK/EventHelpers.js +472 -0
  34. package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -0
  35. package/dist-esm/JavaScriptSDK/HelperFuncs.js +32 -59
  36. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  37. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  38. package/dist-esm/JavaScriptSDK/InternalConstants.js +28 -0
  39. package/dist-esm/JavaScriptSDK/InternalConstants.js.map +1 -0
  40. package/dist-esm/JavaScriptSDK/NotificationManager.js +8 -11
  41. package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
  42. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  43. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +195 -107
  44. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
  45. package/dist-esm/JavaScriptSDK/RandomHelper.js +3 -2
  46. package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
  47. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +32 -13
  48. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
  49. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +4 -6
  50. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -1
  51. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +32 -0
  52. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +1 -0
  53. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +90 -96
  55. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
  56. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +8 -0
  58. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js.map +1 -0
  59. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -2
  75. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js.map +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +8 -0
  77. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js.map +1 -0
  78. package/dist-esm/applicationinsights-core-js.js +9 -4
  79. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  80. package/package.json +1 -1
  81. package/src/JavaScriptSDK/BaseCore.ts +312 -33
  82. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +90 -5
  83. package/src/JavaScriptSDK/ChannelController.ts +107 -61
  84. package/src/JavaScriptSDK/CookieMgr.ts +4 -4
  85. package/src/JavaScriptSDK/CoreUtils.ts +6 -143
  86. package/src/JavaScriptSDK/DataCacheHelper.ts +106 -0
  87. package/src/JavaScriptSDK/DiagnosticLogger.ts +12 -11
  88. package/src/JavaScriptSDK/EnvUtils.ts +7 -6
  89. package/src/JavaScriptSDK/EventHelpers.ts +542 -0
  90. package/src/JavaScriptSDK/HelperFuncs.ts +35 -54
  91. package/src/JavaScriptSDK/InternalConstants.ts +26 -0
  92. package/src/JavaScriptSDK/NotificationManager.ts +7 -11
  93. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +248 -121
  94. package/src/JavaScriptSDK/RandomHelper.ts +2 -1
  95. package/src/JavaScriptSDK/TelemetryHelpers.ts +47 -15
  96. package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +5 -15
  97. package/src/JavaScriptSDK/UnloadHandlerContainer.ts +44 -0
  98. package/src/JavaScriptSDK.Enums/LoggingEnums.ts +184 -87
  99. package/src/JavaScriptSDK.Enums/SendRequestReason.ts +5 -0
  100. package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +27 -0
  101. package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +49 -2
  102. package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +9 -2
  103. package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +55 -16
  104. package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +16 -9
  105. package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +9 -11
  106. package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +10 -0
  107. package/types/JavaScriptSDK/BaseCore.d.ts +21 -1
  108. package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +26 -1
  109. package/types/JavaScriptSDK/ChannelController.d.ts +4 -0
  110. package/types/JavaScriptSDK/CoreUtils.d.ts +1 -42
  111. package/types/JavaScriptSDK/DataCacheHelper.d.ts +13 -0
  112. package/types/JavaScriptSDK/EventHelpers.d.ts +152 -0
  113. package/types/JavaScriptSDK/HelperFuncs.d.ts +8 -17
  114. package/types/JavaScriptSDK/InternalConstants.d.ts +20 -0
  115. package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +12 -3
  116. package/types/JavaScriptSDK/TelemetryHelpers.d.ts +8 -0
  117. package/types/JavaScriptSDK/TelemetryInitializerPlugin.d.ts +0 -7
  118. package/types/JavaScriptSDK/UnloadHandlerContainer.d.ts +11 -0
  119. package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +91 -2
  120. package/types/JavaScriptSDK.Enums/SendRequestReason.d.ts +4 -0
  121. package/types/JavaScriptSDK.Enums/TelemetryUnloadReason.d.ts +21 -0
  122. package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +41 -1
  123. package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +9 -2
  124. package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +49 -14
  125. package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +15 -8
  126. package/types/JavaScriptSDK.Interfaces/ITelemetryPluginChain.d.ts +9 -10
  127. package/types/JavaScriptSDK.Interfaces/ITelemetryUnloadState.d.ts +6 -0
  128. package/types/applicationinsights-core-js.d.ts +7 -3
@@ -12,19 +12,22 @@ import { strShimPrototype as strPrototype } from '@microsoft/applicationinsights
12
12
  import { strShimUndefined as strUndefined } from '@microsoft/applicationinsights-shims';
13
13
 
14
14
  // @public
15
- export function addEventHandler(eventName: string, callback: any): boolean;
15
+ export function __getRegisteredEvents(target: any, evtName?: string): _IRegisteredEvents[];
16
16
 
17
17
  // @public
18
- export function addEventListeners(events: string[], listener: any, excludeEvents?: string[]): boolean;
18
+ export function addEventHandler(eventName: string, callback: any, evtNamespace?: string | string[]): boolean;
19
19
 
20
20
  // @public
21
- export function addPageHideEventListener(listener: any, excludeEvents?: string[]): boolean;
21
+ export function addEventListeners(events: string[], listener: any, excludeEvents?: string[], evtNamespace?: string | string[]): boolean;
22
22
 
23
23
  // @public
24
- export function addPageShowEventListener(listener: any, excludeEvents?: string[]): boolean;
24
+ export function addPageHideEventListener(listener: any, excludeEvents: string[], evtNamespace?: string | string[]): boolean;
25
25
 
26
26
  // @public
27
- export function addPageUnloadEventListener(listener: any, excludeEvents?: string[]): boolean;
27
+ export function addPageShowEventListener(listener: any, excludeEvents: string[], evtNamespace?: string | string[]): boolean;
28
+
29
+ // @public
30
+ export function addPageUnloadEventListener(listener: any, excludeEvents: string[], evtNamespace?: string | string[]): boolean;
28
31
 
29
32
  // @public (undocumented)
30
33
  export class AppInsightsCore extends BaseCore implements IAppInsightsCore {
@@ -57,13 +60,17 @@ export function attachEvent(obj: any, eventNameWithoutOn: string, handlerRef: an
57
60
  export class BaseCore implements IAppInsightsCore {
58
61
  constructor();
59
62
  addNotificationListener(listener: INotificationListener): void;
63
+ // (undocumented)
64
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
60
65
  addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
66
+ addUnloadCb(handler: UnloadHandler): void;
61
67
  // (undocumented)
62
68
  config: IConfiguration;
63
69
  // (undocumented)
64
70
  static defaultConfig: IConfiguration;
65
71
  // (undocumented)
66
72
  eventCnt(): number;
73
+ evtNamespace(): string;
67
74
  // (undocumented)
68
75
  _extensions: IPlugin[];
69
76
  getCookieMgr(): ICookieMgr;
@@ -95,14 +102,18 @@ export class BaseCore implements IAppInsightsCore {
95
102
  stopPollingInternalLogs(): void;
96
103
  // (undocumented)
97
104
  track(telemetryItem: ITelemetryItem): void;
105
+ unload(isAsync?: boolean, unloadComplete?: () => void): void;
98
106
  }
99
107
 
100
108
  // @public
101
109
  export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
102
110
  constructor();
103
111
  protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void;
112
+ protected _addUnloadCb(handler: UnloadHandler): void;
104
113
  core: IAppInsightsCore;
105
114
  diagLog: (itemCtx?: IProcessTelemetryContext) => IDiagnosticLogger;
115
+ // Warning: (ae-forgotten-export) The symbol "IProcessTelemetryUnloadContext" needs to be exported by the entry point applicationinsights-core-js.d.ts
116
+ protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
106
117
  protected _getTelCtx: (currentCtx?: IProcessTelemetryContext) => IProcessTelemetryContext;
107
118
  // (undocumented)
108
119
  identifier: string;
@@ -116,6 +127,7 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
116
127
  abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
117
128
  protected setInitialized: (isInitialized: boolean) => void;
118
129
  setNextPlugin: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
130
+ teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
119
131
  // (undocumented)
120
132
  version?: string;
121
133
  }
@@ -132,9 +144,21 @@ export function createClassFromInterface<T>(defaults?: T): new () => T;
132
144
  // @public (undocumented)
133
145
  export function createCookieMgr(rootConfig?: IConfiguration, logger?: IDiagnosticLogger): ICookieMgr;
134
146
 
147
+ // @public
148
+ export function createEnumStyle<T>(values: T): T;
149
+
135
150
  // @public
136
151
  export function createProcessTelemetryContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryContext;
137
152
 
153
+ // @public (undocumented)
154
+ export function createUniqueNamespace(name: string, includeVersion?: boolean): string;
155
+
156
+ // @public (undocumented)
157
+ export function createUnloadHandlerContainer(): {
158
+ add: (handler: UnloadHandler) => void;
159
+ run: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
160
+ };
161
+
138
162
  // @public
139
163
  export function dateNow(): number;
140
164
 
@@ -170,9 +194,189 @@ export function doPerf<T>(mgrSource: IPerfManagerProvider | IPerfManager, getSou
170
194
  // @public
171
195
  export function dumpObj(object: any): string;
172
196
 
197
+ // @public (undocumented)
198
+ export const enum _eInternalMessageId {
199
+ // (undocumented)
200
+ BrowserCannotReadLocalStorage = 1,
201
+ // (undocumented)
202
+ BrowserCannotReadSessionStorage = 2,
203
+ // (undocumented)
204
+ BrowserCannotWriteLocalStorage = 3,
205
+ // (undocumented)
206
+ BrowserCannotWriteSessionStorage = 4,
207
+ // (undocumented)
208
+ BrowserDoesNotSupportLocalStorage = 0,
209
+ // (undocumented)
210
+ BrowserFailedRemovalFromLocalStorage = 5,
211
+ // (undocumented)
212
+ BrowserFailedRemovalFromSessionStorage = 6,
213
+ // (undocumented)
214
+ CannotAccessCookie = 68,
215
+ // (undocumented)
216
+ CannotParseAiBlobValue = 101,
217
+ // (undocumented)
218
+ CannotSendEmptyTelemetry = 7,
219
+ // (undocumented)
220
+ CannotSerializeObject = 48,
221
+ // (undocumented)
222
+ CannotSerializeObjectNonSerializable = 49,
223
+ // (undocumented)
224
+ CircularReferenceDetected = 50,
225
+ // (undocumented)
226
+ ClearAuthContextFailed = 51,
227
+ // (undocumented)
228
+ ClientPerformanceMathError = 8,
229
+ // (undocumented)
230
+ CreateEnvelopeError = 47,
231
+ // (undocumented)
232
+ ErrorParsingAISessionCookie = 9,
233
+ // (undocumented)
234
+ ErrorPVCalc = 10,
235
+ // (undocumented)
236
+ ExceptionTruncated = 52,
237
+ // (undocumented)
238
+ ExceptionWhileLoggingError = 11,
239
+ // (undocumented)
240
+ FailedAddingCustomDefinedRequestContext = 104,
241
+ // (undocumented)
242
+ FailedAddingTelemetryToBuffer = 12,
243
+ // (undocumented)
244
+ FailedMonitorAjaxAbort = 13,
245
+ // (undocumented)
246
+ FailedMonitorAjaxDur = 14,
247
+ // (undocumented)
248
+ FailedMonitorAjaxGetCorrelationHeader = 18,
249
+ // (undocumented)
250
+ FailedMonitorAjaxOpen = 15,
251
+ // (undocumented)
252
+ FailedMonitorAjaxRSC = 16,
253
+ // (undocumented)
254
+ FailedMonitorAjaxSend = 17,
255
+ // (undocumented)
256
+ FailedMonitorAjaxSetRequestHeader = 71,
257
+ // (undocumented)
258
+ FailedToAddHandlerForOnBeforeUnload = 19,
259
+ // (undocumented)
260
+ FailedToFixDepricatedValues = 44,
261
+ // (undocumented)
262
+ FailedToReportDataLoss = 21,
263
+ // (undocumented)
264
+ FailedToRestoreStorageBuffer = 42,
265
+ // (undocumented)
266
+ FailedToSendQueuedTelemetry = 20,
267
+ // (undocumented)
268
+ FailedToSetStorageBuffer = 41,
269
+ // (undocumented)
270
+ FlushFailed = 22,
271
+ // (undocumented)
272
+ IdTooLong = 69,
273
+ // (undocumented)
274
+ IllegalCharsInName = 53,
275
+ // (undocumented)
276
+ InMemoryStorageBufferFull = 105,
277
+ // (undocumented)
278
+ InvalidBackendResponse = 43,
279
+ // (undocumented)
280
+ InvalidContentBlob = 102,
281
+ // (undocumented)
282
+ InvalidDurationValue = 45,
283
+ // (undocumented)
284
+ InvalidEvent = 70,
285
+ // (undocumented)
286
+ InvalidInstrumentationKey = 100,
287
+ // (undocumented)
288
+ ItemNotInArray = 54,
289
+ // (undocumented)
290
+ MaxAjaxPerPVExceeded = 55,
291
+ // (undocumented)
292
+ MessageLimitPerPVExceeded = 23,
293
+ // (undocumented)
294
+ MessageTruncated = 56,
295
+ // (undocumented)
296
+ MissingRequiredFieldSpecification = 24,
297
+ // (undocumented)
298
+ NameTooLong = 57,
299
+ // (undocumented)
300
+ NavigationTimingNotSupported = 25,
301
+ // (undocumented)
302
+ NotificationException = 74,
303
+ // (undocumented)
304
+ OnError = 26,
305
+ // (undocumented)
306
+ PluginException = 73,
307
+ // (undocumented)
308
+ SampleRateOutOfRange = 58,
309
+ // (undocumented)
310
+ SendBrowserInfoOnUserInit = 72,
311
+ // (undocumented)
312
+ SenderNotInitialized = 28,
313
+ // (undocumented)
314
+ SessionRenewalDateIsZero = 27,
315
+ // (undocumented)
316
+ SessionStorageBufferFull = 67,
317
+ // (undocumented)
318
+ SetAuthContextFailed = 59,
319
+ // (undocumented)
320
+ SetAuthContextFailedAccountName = 60,
321
+ // (undocumented)
322
+ SnippetScriptLoadFailure = 99,
323
+ // (undocumented)
324
+ StartCalledMoreThanOnce = 62,
325
+ // (undocumented)
326
+ StartTrackEventFailed = 29,
327
+ // (undocumented)
328
+ StartTrackFailed = 31,
329
+ // (undocumented)
330
+ StopCalledWithoutStart = 63,
331
+ // (undocumented)
332
+ StopTrackEventFailed = 30,
333
+ // (undocumented)
334
+ StopTrackFailed = 32,
335
+ // (undocumented)
336
+ StringValueTooLong = 61,
337
+ // (undocumented)
338
+ TelemetryEnvelopeInvalid = 46,
339
+ // (undocumented)
340
+ TelemetryInitializerFailed = 64,
341
+ // (undocumented)
342
+ TelemetrySampledAndNotSent = 33,
343
+ // (undocumented)
344
+ TrackArgumentsNotSpecified = 65,
345
+ // (undocumented)
346
+ TrackEventFailed = 34,
347
+ // (undocumented)
348
+ TrackExceptionFailed = 35,
349
+ // (undocumented)
350
+ TrackMetricFailed = 36,
351
+ // (undocumented)
352
+ TrackPageActionEventFailed = 103,
353
+ // (undocumented)
354
+ TrackPVFailed = 37,
355
+ // (undocumented)
356
+ TrackPVFailedCalc = 38,
357
+ // (undocumented)
358
+ TrackTraceFailed = 39,
359
+ // (undocumented)
360
+ TransmissionFailed = 40,
361
+ // (undocumented)
362
+ UrlTooLong = 66
363
+ }
364
+
365
+ // @public (undocumented)
366
+ export const enum eLoggingSeverity {
367
+ CRITICAL = 1,
368
+ WARNING = 2
369
+ }
370
+
173
371
  // @public (undocumented)
174
372
  export const EventHelper: IEventHelper;
175
373
 
374
+ // @public
375
+ export function eventOff<T>(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[], useCapture?: boolean): void;
376
+
377
+ // @public
378
+ export function eventOn<T>(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[], useCapture?: boolean): boolean;
379
+
176
380
  // @public
177
381
  export const EventsDiscardedReason: {
178
382
  Unknown: number;
@@ -273,9 +477,12 @@ export function hasWindow(): boolean;
273
477
  // @public (undocumented)
274
478
  export interface IAppInsightsCore extends IPerfManagerProvider {
275
479
  addNotificationListener?(listener: INotificationListener): void;
480
+ addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
276
481
  addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
482
+ addUnloadCb(handler: UnloadHandler): void;
277
483
  // (undocumented)
278
484
  config: IConfiguration;
485
+ evtNamespace(): string;
279
486
  getCookieMgr(): ICookieMgr;
280
487
  getNotifyMgr(): INotificationManager;
281
488
  getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
@@ -295,6 +502,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
295
502
  stopPollingInternalLogs?(): void;
296
503
  // (undocumented)
297
504
  track(telemetryItem: ITelemetryItem): void;
505
+ unload(isAsync?: boolean, unloadComplete?: () => void): void;
298
506
  }
299
507
 
300
508
  // @public
@@ -302,7 +510,7 @@ export interface IChannelControls extends ITelemetryPlugin {
302
510
  flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
303
511
  pause(): void;
304
512
  resume(): void;
305
- teardown(): void;
513
+ teardown: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
306
514
  }
307
515
 
308
516
  // @public
@@ -356,7 +564,7 @@ export interface ICookieMgrConfig {
356
564
 
357
565
  // @public @deprecated
358
566
  export interface ICoreUtils {
359
- addEventHandler: (eventName: string, callback: any) => boolean;
567
+ addEventHandler: (eventName: string, callback: any, evtNamespace?: string | string[]) => boolean;
360
568
  arrForEach: <T>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => void | number, thisArg?: any) => void;
361
569
  arrIndexOf: <T>(arr: T[], searchElement: T, fromIndex?: number) => number;
362
570
  arrMap: <T, R>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => R, thisArg?: any) => R[];
@@ -623,7 +831,7 @@ export const _InternalMessageId: {
623
831
  };
624
832
 
625
833
  // @public (undocumented)
626
- export type _InternalMessageId = number | typeof _InternalMessageId;
834
+ export type _InternalMessageId = number | _eInternalMessageId;
627
835
 
628
836
  // @public
629
837
  export interface IPerfEvent {
@@ -660,24 +868,24 @@ export interface IPlugin {
660
868
  readonly identifier: string;
661
869
  initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => void;
662
870
  isInitialized?: () => boolean;
663
- teardown?: () => void;
871
+ teardown?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
664
872
  readonly version?: string;
665
873
  }
666
874
 
875
+ // Warning: (ae-forgotten-export) The symbol "IBaseProcessingContext" needs to be exported by the entry point applicationinsights-core-js.d.ts
876
+ //
667
877
  // @public
668
- export interface IProcessTelemetryContext {
669
- core: () => IAppInsightsCore;
878
+ export interface IProcessTelemetryContext extends IBaseProcessingContext {
670
879
  createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext;
671
- diagLog: () => IDiagnosticLogger;
672
- getCfg: () => IConfiguration;
673
- getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
674
- getExtCfg: <T>(identifier: string, defaultValue?: T | any, mergeDefault?: GetExtCfgMergeType) => T;
675
- getNext: () => ITelemetryPluginChain;
676
- hasNext: () => boolean;
677
- iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
678
- onComplete: (onComplete: () => void) => void;
679
- processNext: (env: ITelemetryItem) => void;
680
- setNext: (nextCtx: ITelemetryPluginChain) => void;
880
+ processNext: (env: ITelemetryItem) => boolean | void;
881
+ }
882
+
883
+ // @public (undocumented)
884
+ export interface _IRegisteredEvents {
885
+ // (undocumented)
886
+ handler: any;
887
+ // (undocumented)
888
+ name: string;
681
889
  }
682
890
 
683
891
  // @public
@@ -774,28 +982,55 @@ export interface ITelemetryItem {
774
982
  ver?: string;
775
983
  }
776
984
 
985
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryProcessor" needs to be exported by the entry point applicationinsights-core-js.d.ts
986
+ //
777
987
  // @public
778
- export interface ITelemetryPlugin extends IPlugin {
988
+ export interface ITelemetryPlugin extends ITelemetryProcessor, IPlugin {
779
989
  readonly priority: number;
780
- processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
781
990
  setNextPlugin?: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
782
991
  }
783
992
 
784
993
  // @public
785
- export interface ITelemetryPluginChain {
994
+ export interface ITelemetryPluginChain extends ITelemetryProcessor {
786
995
  getNext: () => ITelemetryPluginChain;
787
996
  getPlugin: () => ITelemetryPlugin;
788
- processTelemetry: (env: ITelemetryItem, itemCtx: IProcessTelemetryContext) => void;
997
+ unload?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
998
+ }
999
+
1000
+ // @public (undocumented)
1001
+ export interface ITelemetryUnloadState {
1002
+ // (undocumented)
1003
+ flushComplete?: boolean;
1004
+ // (undocumented)
1005
+ isAsync: boolean;
1006
+ // Warning: (ae-forgotten-export) The symbol "TelemetryUnloadReason" needs to be exported by the entry point applicationinsights-core-js.d.ts
1007
+ //
1008
+ // (undocumented)
1009
+ reason: TelemetryUnloadReason;
1010
+ }
1011
+
1012
+ // @public (undocumented)
1013
+ export interface IUnloadHandlerContainer {
1014
+ // (undocumented)
1015
+ add: (handler: UnloadHandler) => void;
1016
+ // (undocumented)
1017
+ run: (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
789
1018
  }
790
1019
 
791
1020
  // @public
792
1021
  export function _legacyCookieMgr(config?: IConfiguration, logger?: IDiagnosticLogger): ICookieMgr;
793
1022
 
794
1023
  // @public (undocumented)
795
- export enum LoggingSeverity {
796
- CRITICAL = 1,
797
- WARNING = 2
798
- }
1024
+ export const LoggingSeverity: {
1025
+ CRITICAL: number;
1026
+ WARNING: number;
1027
+ };
1028
+
1029
+ // @public (undocumented)
1030
+ export type LoggingSeverity = number | eLoggingSeverity;
1031
+
1032
+ // @public (undocumented)
1033
+ export function mergeEvtNamespace(theNamespace: string, namespaces: string | string[]): string | string[];
799
1034
 
800
1035
  // @public (undocumented)
801
1036
  export const MinChannelPriorty: number;
@@ -833,6 +1068,9 @@ export { objCreate }
833
1068
  // @public
834
1069
  export function objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean;
835
1070
 
1071
+ // @public
1072
+ export function objExtend<T1, T2, T3, T4, T5, T6>(obj?: boolean | T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T1 & T2 & T3 & T4 & T5 & T6;
1073
+
836
1074
  // @public
837
1075
  export function objForEachKey<T = any>(target: T, callbackfn: (name: string, value: T[keyof T]) => void): void;
838
1076
 
@@ -897,19 +1135,37 @@ export class ProcessTelemetryContext implements IProcessTelemetryContext {
897
1135
  hasNext: () => boolean;
898
1136
  iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
899
1137
  onComplete: (onComplete: () => void) => void;
900
- processNext: (env: ITelemetryItem) => void;
1138
+ processNext: (env: ITelemetryItem) => boolean | void;
901
1139
  setNext: (nextCtx: ITelemetryPluginChain) => void;
902
1140
  }
903
1141
 
904
1142
  // @public
905
1143
  export function proxyAssign<T, S>(target: T, source: S, chkSet?: (name: string, isFunc?: boolean, source?: S, target?: T) => boolean): T;
906
1144
 
1145
+ // @public (undocumented)
1146
+ export function proxyFunctionAs<T, S>(target: T, name: string, source: S | (() => S), theFunc: (keyof S), overwriteTarget?: boolean): void;
1147
+
1148
+ // @public
1149
+ export function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget?: boolean): T;
1150
+
907
1151
  // @public
908
1152
  export function random32(signed?: boolean): number;
909
1153
 
910
1154
  // @public
911
1155
  export function randomValue(maxValue: number): number;
912
1156
 
1157
+ // @public
1158
+ export function removeEventHandler(eventName: string, callback: any, evtNamespace?: string | string[]): void;
1159
+
1160
+ // @public
1161
+ export function removeEventListeners(events: string[], listener: any, evtNamespace?: string | string[]): void;
1162
+
1163
+ // @public
1164
+ export function removePageHideEventListener(listener: any, evtNamespace?: string | string[]): void;
1165
+
1166
+ // @public
1167
+ export function removePageUnloadEventListener(listener: any, evtNamespace?: string | string[]): void;
1168
+
913
1169
  // @public
914
1170
  export function safeGetCookieMgr(core: IAppInsightsCore, config?: IConfiguration): ICookieMgr;
915
1171
 
@@ -924,6 +1180,7 @@ export const enum SendRequestReason {
924
1180
  NormalSchedule = 1,
925
1181
  Resumed = 4,
926
1182
  Retry = 5,
1183
+ SdkUnload = 6,
927
1184
  SyncEvent = 3,
928
1185
  Undefined = 0,
929
1186
  Unload = 2
@@ -991,6 +1248,9 @@ export function uaDisallowsSameSiteNone(userAgent: string): boolean;
991
1248
  // @public (undocumented)
992
1249
  export const Undefined = "undefined";
993
1250
 
1251
+ // @public (undocumented)
1252
+ export type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
1253
+
994
1254
  // @public (undocumented)
995
1255
  export function useXDomainRequest(): boolean | undefined;
996
1256