@microsoft/applicationinsights-web 2.7.4-nightly.2202-07 → 2.8.0-beta.2202-06

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 (49) hide show
  1. package/browser/{ai.2.7.4-nightly.2202-07.cjs.js → ai.2.8.0-beta.2202-06.cjs.js} +924 -524
  2. package/browser/ai.2.8.0-beta.2202-06.cjs.js.map +1 -0
  3. package/browser/ai.2.8.0-beta.2202-06.cjs.min.js +6 -0
  4. package/browser/ai.2.8.0-beta.2202-06.cjs.min.js.map +1 -0
  5. package/browser/{ai.2.7.4-nightly.2202-07.gbl.js → ai.2.8.0-beta.2202-06.gbl.js} +924 -524
  6. package/browser/ai.2.8.0-beta.2202-06.gbl.js.map +1 -0
  7. package/browser/ai.2.8.0-beta.2202-06.gbl.min.js +6 -0
  8. package/browser/ai.2.8.0-beta.2202-06.gbl.min.js.map +1 -0
  9. package/browser/ai.2.8.0-beta.2202-06.integrity.json +66 -0
  10. package/browser/{ai.2.7.4-nightly.2202-07.js → ai.2.8.0-beta.2202-06.js} +924 -524
  11. package/browser/ai.2.8.0-beta.2202-06.js.map +1 -0
  12. package/browser/ai.2.8.0-beta.2202-06.min.js +6 -0
  13. package/browser/ai.2.8.0-beta.2202-06.min.js.map +1 -0
  14. package/browser/ai.2.cjs.js +923 -523
  15. package/browser/ai.2.cjs.js.map +1 -1
  16. package/browser/ai.2.cjs.min.js +2 -2
  17. package/browser/ai.2.cjs.min.js.map +1 -1
  18. package/browser/ai.2.gbl.js +923 -523
  19. package/browser/ai.2.gbl.js.map +1 -1
  20. package/browser/ai.2.gbl.min.js +2 -2
  21. package/browser/ai.2.gbl.min.js.map +1 -1
  22. package/browser/ai.2.js +923 -523
  23. package/browser/ai.2.js.map +1 -1
  24. package/browser/ai.2.min.js +2 -2
  25. package/browser/ai.2.min.js.map +1 -1
  26. package/dist/applicationinsights-web.api.json +653 -213
  27. package/dist/applicationinsights-web.api.md +20 -6
  28. package/dist/applicationinsights-web.d.ts +158 -37
  29. package/dist/applicationinsights-web.js +923 -523
  30. package/dist/applicationinsights-web.js.map +1 -1
  31. package/dist/applicationinsights-web.min.js +2 -2
  32. package/dist/applicationinsights-web.min.js.map +1 -1
  33. package/dist/applicationinsights-web.rollup.d.ts +158 -37
  34. package/dist-esm/ApplicationInsightsContainer.js +1 -1
  35. package/dist-esm/ApplicationInsightsDeprecated.js +1 -1
  36. package/dist-esm/Init.js +1 -1
  37. package/dist-esm/Initialization.js +1 -1
  38. package/dist-esm/applicationinsights-web.js +1 -1
  39. package/package.json +8 -8
  40. package/browser/ai.2.7.4-nightly.2202-07.cjs.js.map +0 -1
  41. package/browser/ai.2.7.4-nightly.2202-07.cjs.min.js +0 -6
  42. package/browser/ai.2.7.4-nightly.2202-07.cjs.min.js.map +0 -1
  43. package/browser/ai.2.7.4-nightly.2202-07.gbl.js.map +0 -1
  44. package/browser/ai.2.7.4-nightly.2202-07.gbl.min.js +0 -6
  45. package/browser/ai.2.7.4-nightly.2202-07.gbl.min.js.map +0 -1
  46. package/browser/ai.2.7.4-nightly.2202-07.integrity.json +0 -66
  47. package/browser/ai.2.7.4-nightly.2202-07.js.map +0 -1
  48. package/browser/ai.2.7.4-nightly.2202-07.min.js +0 -6
  49. package/browser/ai.2.7.4-nightly.2202-07.min.js.map +0 -1
@@ -7,12 +7,8 @@
7
7
  // @public (undocumented)
8
8
  export class AppInsightsCore extends BaseCore implements IAppInsightsCore {
9
9
  constructor();
10
- addNotificationListener(listener: INotificationListener): void;
11
10
  // (undocumented)
12
11
  initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
13
- pollInternalLogs(eventName?: string): number;
14
- removeNotificationListener(listener: INotificationListener): void;
15
- stopPollingInternalLogs(): void;
16
12
  // (undocumented)
17
13
  track(telemetryItem: ITelemetryItem): void;
18
14
  }
@@ -160,6 +156,10 @@ export class ApplicationInsightsContainer {
160
156
  // @public (undocumented)
161
157
  export class BaseCore implements IAppInsightsCore {
162
158
  constructor();
159
+ addNotificationListener(listener: INotificationListener): void;
160
+ // Warning: (ae-forgotten-export) The symbol "TelemetryInitializerFunction" needs to be exported by the entry point applicationinsights-web.d.ts
161
+ // Warning: (ae-forgotten-export) The symbol "ITelemetryInitializerHandler" needs to be exported by the entry point applicationinsights-web.d.ts
162
+ addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
163
163
  // (undocumented)
164
164
  config: IConfiguration;
165
165
  // (undocumented)
@@ -173,6 +173,10 @@ export class BaseCore implements IAppInsightsCore {
173
173
  getNotifyMgr(): INotificationManager;
174
174
  // (undocumented)
175
175
  getPerfMgr(): IPerfManager;
176
+ // Warning: (ae-forgotten-export) The symbol "ILoadedPlugin" needs to be exported by the entry point applicationinsights-web.d.ts
177
+ //
178
+ // (undocumented)
179
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
176
180
  // (undocumented)
177
181
  getProcessTelContext(): IProcessTelemetryContext;
178
182
  // Warning: (ae-forgotten-export) The symbol "IChannelControls" needs to be exported by the entry point applicationinsights-web.d.ts
@@ -185,11 +189,14 @@ export class BaseCore implements IAppInsightsCore {
185
189
  isInitialized: () => boolean;
186
190
  // (undocumented)
187
191
  logger: IDiagnosticLogger;
192
+ pollInternalLogs(eventName?: string): number;
188
193
  // (undocumented)
189
194
  protected releaseQueue(): void;
195
+ removeNotificationListener(listener: INotificationListener): void;
190
196
  setCookieMgr(cookieMgr: ICookieMgr): void;
191
197
  // (undocumented)
192
198
  setPerfMgr(perfMgr: IPerfManager): void;
199
+ stopPollingInternalLogs(): void;
193
200
  // (undocumented)
194
201
  track(telemetryItem: ITelemetryItem): void;
195
202
  }
@@ -197,6 +204,8 @@ export class BaseCore implements IAppInsightsCore {
197
204
  // @public
198
205
  export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
199
206
  constructor();
207
+ // Warning: (ae-forgotten-export) The symbol "IInstrumentHook" needs to be exported by the entry point applicationinsights-web.d.ts
208
+ protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void;
200
209
  core: IAppInsightsCore;
201
210
  diagLog: (itemCtx?: IProcessTelemetryContext) => IDiagnosticLogger;
202
211
  protected _getTelCtx: (currentCtx?: IProcessTelemetryContext) => IProcessTelemetryContext;
@@ -374,10 +383,12 @@ export interface IAppInsights {
374
383
  // @public (undocumented)
375
384
  export interface IAppInsightsCore extends IPerfManagerProvider {
376
385
  addNotificationListener?(listener: INotificationListener): void;
386
+ addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
377
387
  // (undocumented)
378
388
  config: IConfiguration;
379
389
  getCookieMgr(): ICookieMgr;
380
390
  getNotifyMgr(): INotificationManager;
391
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
381
392
  getProcessTelContext(): IProcessTelemetryContext;
382
393
  // (undocumented)
383
394
  getTransmissionControls(): IChannelControls[][];
@@ -911,10 +922,13 @@ export interface IProcessTelemetryContext {
911
922
  createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext;
912
923
  diagLog: () => IDiagnosticLogger;
913
924
  getCfg: () => IConfiguration;
914
- getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean) => number | string | boolean;
915
- getExtCfg: <T>(identifier: string, defaultValue?: T | any) => T;
925
+ getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
926
+ // Warning: (ae-forgotten-export) The symbol "GetExtCfgMergeType" needs to be exported by the entry point applicationinsights-web.d.ts
927
+ getExtCfg: <T>(identifier: string, defaultValue?: T | any, mergeDefault?: GetExtCfgMergeType) => T;
916
928
  getNext: () => ITelemetryPluginChain;
917
929
  hasNext: () => boolean;
930
+ iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
931
+ onComplete: (onComplete: () => void) => void;
918
932
  processNext: (env: ITelemetryItem) => void;
919
933
  setNext: (nextCtx: ITelemetryPluginChain) => void;
920
934
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft.ApplicationInsights, 2.7.4-nightly.2202-07
2
+ * Microsoft.ApplicationInsights, 2.8.0-beta.2202-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -44,26 +44,6 @@ declare namespace ApplicationInsights {
44
44
  constructor();
45
45
  initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
46
46
  track(telemetryItem: ITelemetryItem): void;
47
- /**
48
- * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
49
- * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
50
- * called.
51
- * @param {INotificationListener} listener - An INotificationListener object.
52
- */
53
- addNotificationListener(listener: INotificationListener): void;
54
- /**
55
- * Removes all instances of the listener.
56
- * @param {INotificationListener} listener - INotificationListener to remove.
57
- */
58
- removeNotificationListener(listener: INotificationListener): void;
59
- /**
60
- * Periodically check logger.queue for
61
- */
62
- pollInternalLogs(eventName?: string): number;
63
- /**
64
- * Periodically check logger.queue for
65
- */
66
- stopPollingInternalLogs(): void;
67
47
  }
68
48
 
69
49
  class ApplicationAnalytics extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal {
@@ -399,6 +379,18 @@ declare namespace ApplicationInsights {
399
379
  track(telemetryItem: ITelemetryItem): void;
400
380
  getProcessTelContext(): IProcessTelemetryContext;
401
381
  getNotifyMgr(): INotificationManager;
382
+ /**
383
+ * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
384
+ * The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
385
+ * called.
386
+ * @param {INotificationListener} listener - An INotificationListener object.
387
+ */
388
+ addNotificationListener(listener: INotificationListener): void;
389
+ /**
390
+ * Removes all instances of the listener.
391
+ * @param {INotificationListener} listener - INotificationListener to remove.
392
+ */
393
+ removeNotificationListener(listener: INotificationListener): void;
402
394
  /**
403
395
  * Get the current cookie manager for this instance
404
396
  */
@@ -411,6 +403,21 @@ declare namespace ApplicationInsights {
411
403
  getPerfMgr(): IPerfManager;
412
404
  setPerfMgr(perfMgr: IPerfManager): void;
413
405
  eventCnt(): number;
406
+ /**
407
+ * Periodically check logger.queue for
408
+ */
409
+ pollInternalLogs(eventName?: string): number;
410
+ /**
411
+ * Periodically check logger.queue for
412
+ */
413
+ stopPollingInternalLogs(): void;
414
+ /**
415
+ * Add a telemetry processor to decorate or drop telemetry events.
416
+ * @param telemetryInitializer - The Telemetry Initializer function
417
+ * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
418
+ */
419
+ addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
420
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
414
421
  protected releaseQueue(): void;
415
422
  }
416
423
 
@@ -420,6 +427,13 @@ declare namespace ApplicationInsights {
420
427
  * implementation so that new default implementations can be added without breaking all plugins.
421
428
  */
422
429
  abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
430
+ identifier: string;
431
+ version?: string;
432
+ /**
433
+ * Holds the core instance that was used during initialization
434
+ */
435
+ core: IAppInsightsCore;
436
+ priority: number;
423
437
  /**
424
438
  * Call back for telemetry processing before it it is sent
425
439
  * @param env - This is the current event being reported
@@ -441,13 +455,6 @@ declare namespace ApplicationInsights {
441
455
  * Returns whether the plugin has been initialized
442
456
  */
443
457
  isInitialized: () => boolean;
444
- identifier: string;
445
- version?: string;
446
- /**
447
- * Holds the core instance that was used during initialization
448
- */
449
- core: IAppInsightsCore;
450
- priority: number;
451
458
  /**
452
459
  * Helper to return the current IProcessTelemetryContext, if the passed argument exists this just
453
460
  * returns that value (helps with minification for callers), otherwise it will return the configured
@@ -459,13 +466,14 @@ declare namespace ApplicationInsights {
459
466
  * Internal helper to allow setting of the internal initialized setting for inherited instances and unit testing
460
467
  */
461
468
  protected setInitialized: (isInitialized: boolean) => void;
462
- /**
463
- * Internal helper to initialize the instance
464
- */
465
- private _baseTelInit;
466
469
  constructor();
467
470
  initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
468
471
  abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
472
+ /**
473
+ * Add this hook so that it is automatically removed during unloading
474
+ * @param hooks - The single hook or an array of IInstrumentHook objects
475
+ */
476
+ protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void;
469
477
  }
470
478
 
471
479
  class ConfigurationManager {
@@ -824,6 +832,12 @@ declare namespace ApplicationInsights {
824
832
  */
825
833
  function _formatErrorCode(errorObj: any): any;
826
834
 
835
+ const enum GetExtCfgMergeType {
836
+ None = 0,
837
+ MergeDefaultOnly = 1,
838
+ MergeDefaultFromRootOrDefault = 2
839
+ }
840
+
827
841
  interface IAjaxRecordResponse {
828
842
  statusText: string;
829
843
  headerMap: Object;
@@ -899,12 +913,23 @@ declare namespace ApplicationInsights {
899
913
  * @param {INotificationListener} listener - INotificationListener to remove.
900
914
  */
901
915
  removeNotificationListener?(listener: INotificationListener): void;
916
+ /**
917
+ * Add a telemetry processor to decorate or drop telemetry events.
918
+ * @param telemetryInitializer - The Telemetry Initializer function
919
+ * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
920
+ */
921
+ addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
902
922
  pollInternalLogs?(eventName?: string): number;
903
923
  stopPollingInternalLogs?(): void;
904
924
  /**
905
925
  * Return a new instance of the IProcessTelemetryContext for processing events
906
926
  */
907
927
  getProcessTelContext(): IProcessTelemetryContext;
928
+ /**
929
+ * Find and return the (first) plugin with the specified identifier if present
930
+ * @param pluginIdentifier
931
+ */
932
+ getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
908
933
  }
909
934
 
910
935
  interface IAppInsightsDeprecated {
@@ -1176,10 +1201,13 @@ declare namespace ApplicationInsights {
1176
1201
  teardown(): void;
1177
1202
  /**
1178
1203
  * Flush to send data immediately; channel should default to sending data asynchronously
1179
- * @param async: send data asynchronously when true
1180
- * @param callBack: if specified, notify caller when send is complete
1204
+ * @param async - send data asynchronously when true
1205
+ * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
1206
+ * If the caller doesn't return true the caller should assume that it may never be called.
1207
+ * @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
1208
+ * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
1181
1209
  */
1182
- flush(async: boolean, callBack?: () => void): void;
1210
+ flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
1183
1211
  }
1184
1212
 
1185
1213
  interface IChannelControlsAI extends IChannelControls {
@@ -2407,6 +2435,73 @@ declare namespace ApplicationInsights {
2407
2435
  includeCorrelationHeaders: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
2408
2436
  }
2409
2437
 
2438
+ interface IInstrumentCallDetails {
2439
+ name: string;
2440
+ inst: any;
2441
+ /**
2442
+ * This returns an object that the hook function can use to store hook specific
2443
+ * context, it it not shared with any other hook instances and is unique for the
2444
+ * current call.
2445
+ * A hook implementation can use this to pass / share context between different
2446
+ * hook callbacks eg. request/response requst/hookErrors etc.
2447
+ */
2448
+ ctx: () => any;
2449
+ /**
2450
+ * Allows the hook functions to replace the original arguments
2451
+ * @param idx - The argument index (0 based)
2452
+ * @param value - The new value for the argument
2453
+ */
2454
+ set: (idx: number, value: any) => void;
2455
+ /**
2456
+ * The result of the original method, only populated after the original method has returned
2457
+ */
2458
+ rslt?: any;
2459
+ /**
2460
+ * The error (exception) which occurred while executing the original method
2461
+ */
2462
+ err?: Error;
2463
+ /**
2464
+ * The Event object from (window.event) at the start of the original call
2465
+ */
2466
+ evt?: Event;
2467
+ }
2468
+
2469
+ /**
2470
+ * The holder of the specific instance callback
2471
+ */
2472
+ interface IInstrumentHook {
2473
+ /** Unique Id for this callback on the hooked method */
2474
+ id: number;
2475
+ /** Holds the callbacks */
2476
+ cbks: IInstrumentHooksCallbacks;
2477
+ /** Remove this hook from the function */
2478
+ rm: () => void;
2479
+ }
2480
+
2481
+ /**
2482
+ * The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required.
2483
+ * You must always supply the error callback
2484
+ */
2485
+ interface IInstrumentHooksCallbacks {
2486
+ /**
2487
+ * The hook callback to call before the original function is called
2488
+ */
2489
+ req?: InstrumentorHooksCallback;
2490
+ /**
2491
+ * The hook callback to call after the original function was called
2492
+ */
2493
+ rsp?: InstrumentorHooksCallback;
2494
+ /**
2495
+ * The callback to call if the hook function causes an exception
2496
+ */
2497
+ hkErr?: InstrumentorHooksCallback;
2498
+ /**
2499
+ * The callback to call if the original function causes an exception, even if you
2500
+ * supply a callback the original exception will still be thrown
2501
+ */
2502
+ fnErr?: InstrumentorHooksCallback;
2503
+ }
2504
+
2410
2505
  interface IInternal {
2411
2506
  /**
2412
2507
  * The SDK version used to create this telemetry item.
@@ -2431,6 +2526,10 @@ declare namespace ApplicationInsights {
2431
2526
  sdkSrc: string;
2432
2527
  }
2433
2528
 
2529
+ interface ILoadedPlugin<T extends IPlugin> {
2530
+ plugin: T;
2531
+ }
2532
+
2434
2533
  interface ILocation {
2435
2534
  /**
2436
2535
  * Client IP address for reverse lookup
@@ -2556,6 +2655,12 @@ declare namespace ApplicationInsights {
2556
2655
  perfEvent?(perfEvent: IPerfEvent): void;
2557
2656
  }
2558
2657
 
2658
+ /**
2659
+ * A callback function that will be called for the wrapped instrumentation function
2660
+ * before the original function is executed.
2661
+ */
2662
+ type InstrumentorHooksCallback = (funcArgs: IInstrumentCallDetails, ...orgArgs: any[]) => void;
2663
+
2559
2664
  class _InternalLogMessage {
2560
2665
  static dataType: string;
2561
2666
  message: string;
@@ -2938,7 +3043,7 @@ declare namespace ApplicationInsights {
2938
3043
  /**
2939
3044
  * Gets the named extension config
2940
3045
  */
2941
- getExtCfg: <T>(identifier: string, defaultValue?: T | any) => T;
3046
+ getExtCfg: <T>(identifier: string, defaultValue?: T | any, mergeDefault?: GetExtCfgMergeType) => T;
2942
3047
  /**
2943
3048
  * Gets the named config from either the named identifier extension or core config if neither exist then the
2944
3049
  * default value is returned
@@ -2946,7 +3051,7 @@ declare namespace ApplicationInsights {
2946
3051
  * @param field The config field name
2947
3052
  * @param defaultValue The default value to return if no defined config exists
2948
3053
  */
2949
- getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean) => number | string | boolean;
3054
+ getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
2950
3055
  /**
2951
3056
  * Helper to allow plugins to check and possibly shortcut executing code only
2952
3057
  * required if there is a nextPlugin
@@ -2965,6 +3070,12 @@ declare namespace ApplicationInsights {
2965
3070
  * @param env - This is the current event being reported
2966
3071
  */
2967
3072
  processNext: (env: ITelemetryItem) => void;
3073
+ /**
3074
+ * Synchronously iterate over the context chain running the callback for each plugin, once
3075
+ * every plugin has been executed via the callback, any associated onComplete will be called.
3076
+ * @param callback - The function call for each plugin in the context chain
3077
+ */
3078
+ iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
2968
3079
  /**
2969
3080
  * Create a new context using the core and config from the current instance
2970
3081
  * @param plugins - The execution order to process the plugins, if null or not supplied
@@ -2973,6 +3084,10 @@ declare namespace ApplicationInsights {
2973
3084
  * order then the next plugin will be NOT set.
2974
3085
  */
2975
3086
  createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext;
3087
+ /**
3088
+ * Set the function to call when the current chain has executed all processNext or unloadNext items.
3089
+ */
3090
+ onComplete: (onComplete: () => void) => void;
2976
3091
  }
2977
3092
 
2978
3093
  interface IPropertiesPlugin {
@@ -3275,6 +3390,10 @@ declare namespace ApplicationInsights {
3275
3390
  addTelemetryInitializer(telemetryInitializer: (envelope: IEnvelope) => boolean | void): void;
3276
3391
  }
3277
3392
 
3393
+ interface ITelemetryInitializerHandler {
3394
+ remove(): void;
3395
+ }
3396
+
3278
3397
  /**
3279
3398
  * Telemety item supported in Core
3280
3399
  */
@@ -4449,6 +4568,8 @@ declare namespace ApplicationInsights {
4449
4568
  DistributedTracingModes: typeof DistributedTracingModes;
4450
4569
  };
4451
4570
 
4571
+ type TelemetryInitializerFunction = <T extends ITelemetryItem>(item: T) => boolean | void;
4572
+
4452
4573
  class TelemetryItemCreator {
4453
4574
  /**
4454
4575
  * Create a telemetry item that the 1DS channel understands