@microsoft/applicationinsights-core-js 2.7.5-nightly.2204-03 → 2.7.5-nightly.2204-23

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 (160) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +766 -1967
  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 +9840 -16439
  7. package/dist/applicationinsights-core-js.api.md +48 -425
  8. package/dist/applicationinsights-core-js.d.ts +123 -784
  9. package/dist/applicationinsights-core-js.js +766 -1967
  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 +123 -784
  14. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +69 -3
  15. package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
  16. package/dist-esm/JavaScriptSDK/BaseCore.js +99 -496
  17. package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
  18. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +21 -120
  19. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
  20. package/dist-esm/JavaScriptSDK/ChannelController.js +87 -202
  21. package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
  22. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  23. package/dist-esm/JavaScriptSDK/CookieMgr.js +4 -4
  24. package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
  25. package/dist-esm/JavaScriptSDK/CoreUtils.js +148 -7
  26. package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
  27. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  28. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +14 -27
  29. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
  30. package/dist-esm/JavaScriptSDK/EnvUtils.js +12 -13
  31. package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
  32. package/dist-esm/JavaScriptSDK/HelperFuncs.js +86 -89
  33. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  34. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -3
  35. package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
  36. package/dist-esm/JavaScriptSDK/NotificationManager.js +42 -37
  37. package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
  38. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  39. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +119 -430
  40. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
  41. package/dist-esm/JavaScriptSDK/RandomHelper.js +4 -30
  42. package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
  43. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +14 -60
  44. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
  45. package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +76 -0
  46. package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js.map +1 -0
  47. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  48. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +96 -90
  49. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
  50. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +2 -1
  52. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js.map +1 -1
  53. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +2 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js.map +1 -1
  68. package/dist-esm/applicationinsights-core-js.js +7 -12
  69. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  70. package/package.json +3 -3
  71. package/src/JavaScriptSDK/AppInsightsCore.ts +101 -2
  72. package/src/JavaScriptSDK/BaseCore.ts +120 -696
  73. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +31 -205
  74. package/src/JavaScriptSDK/ChannelController.ts +103 -242
  75. package/src/JavaScriptSDK/CookieMgr.ts +5 -7
  76. package/src/JavaScriptSDK/CoreUtils.ts +172 -8
  77. package/src/JavaScriptSDK/DiagnosticLogger.ts +14 -29
  78. package/src/JavaScriptSDK/EnvUtils.ts +12 -13
  79. package/src/JavaScriptSDK/HelperFuncs.ts +97 -123
  80. package/src/JavaScriptSDK/InstrumentHooks.ts +2 -4
  81. package/src/JavaScriptSDK/NotificationManager.ts +37 -34
  82. package/src/JavaScriptSDK/PerfManager.ts +7 -4
  83. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +134 -543
  84. package/src/JavaScriptSDK/RandomHelper.ts +3 -35
  85. package/src/JavaScriptSDK/TelemetryHelpers.ts +21 -83
  86. package/src/JavaScriptSDK/TelemetryPluginChain.ts +120 -0
  87. package/src/JavaScriptSDK.Enums/LoggingEnums.ts +87 -184
  88. package/src/JavaScriptSDK.Enums/SendRequestReason.ts +0 -5
  89. package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +2 -82
  90. package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +5 -16
  91. package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +6 -16
  92. package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +14 -94
  93. package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +10 -28
  94. package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +11 -9
  95. package/types/JavaScriptSDK/AppInsightsCore.d.ts +21 -0
  96. package/types/JavaScriptSDK/BaseCore.d.ts +3 -81
  97. package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +10 -53
  98. package/types/JavaScriptSDK/ChannelController.d.ts +17 -16
  99. package/types/JavaScriptSDK/CoreUtils.d.ts +48 -1
  100. package/types/JavaScriptSDK/DiagnosticLogger.d.ts +0 -10
  101. package/types/JavaScriptSDK/HelperFuncs.d.ts +32 -33
  102. package/types/JavaScriptSDK/PerfManager.d.ts +1 -1
  103. package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +6 -69
  104. package/types/JavaScriptSDK/RandomHelper.d.ts +0 -6
  105. package/types/JavaScriptSDK/TelemetryHelpers.d.ts +3 -23
  106. package/types/JavaScriptSDK/TelemetryPluginChain.d.ts +32 -0
  107. package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +2 -91
  108. package/types/JavaScriptSDK.Enums/SendRequestReason.d.ts +0 -4
  109. package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +1 -72
  110. package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +5 -16
  111. package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +0 -9
  112. package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +11 -82
  113. package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +8 -25
  114. package/types/JavaScriptSDK.Interfaces/ITelemetryPluginChain.d.ts +10 -9
  115. package/types/applicationinsights-core-js.d.ts +9 -18
  116. package/types/tsdoc-metadata.json +1 -1
  117. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +0 -93
  118. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +0 -1
  119. package/dist-esm/JavaScriptSDK/EventHelpers.js +0 -477
  120. package/dist-esm/JavaScriptSDK/EventHelpers.js.map +0 -1
  121. package/dist-esm/JavaScriptSDK/InternalConstants.js +0 -28
  122. package/dist-esm/JavaScriptSDK/InternalConstants.js.map +0 -1
  123. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +0 -81
  124. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +0 -1
  125. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +0 -33
  126. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +0 -1
  127. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +0 -8
  128. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js.map +0 -1
  129. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +0 -8
  130. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js.map +0 -1
  131. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +0 -6
  132. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js.map +0 -1
  133. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +0 -8
  134. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js.map +0 -1
  135. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +0 -8
  136. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js.map +0 -1
  137. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +0 -6
  138. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js.map +0 -1
  139. package/src/JavaScriptSDK/DataCacheHelper.ts +0 -106
  140. package/src/JavaScriptSDK/EventHelpers.ts +0 -550
  141. package/src/JavaScriptSDK/InternalConstants.ts +0 -26
  142. package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +0 -111
  143. package/src/JavaScriptSDK/UnloadHandlerContainer.ts +0 -46
  144. package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +0 -27
  145. package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +0 -27
  146. package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +0 -16
  147. package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +0 -10
  148. package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +0 -34
  149. package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +0 -17
  150. package/types/JavaScriptSDK/DataCacheHelper.d.ts +0 -13
  151. package/types/JavaScriptSDK/EventHelpers.d.ts +0 -154
  152. package/types/JavaScriptSDK/InternalConstants.d.ts +0 -20
  153. package/types/JavaScriptSDK/TelemetryInitializerPlugin.d.ts +0 -16
  154. package/types/JavaScriptSDK/UnloadHandlerContainer.d.ts +0 -11
  155. package/types/JavaScriptSDK.Enums/TelemetryUnloadReason.d.ts +0 -21
  156. package/types/JavaScriptSDK.Enums/TelemetryUpdateReason.d.ts +0 -20
  157. package/types/JavaScriptSDK.Interfaces/ITelemetryInitializers.d.ts +0 -13
  158. package/types/JavaScriptSDK.Interfaces/ITelemetryUnloadState.d.ts +0 -6
  159. package/types/JavaScriptSDK.Interfaces/ITelemetryUpdateState.d.ts +0 -22
  160. package/types/JavaScriptSDK.Interfaces/IUnloadableComponent.d.ts +0 -13
@@ -1,46 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { eLoggingSeverity, _eInternalMessageId } from "../JavaScriptSDK.Enums/LoggingEnums";
5
- import { IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
6
- import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
7
- import { _throwInternal } from "./DiagnosticLogger";
8
- import { dumpObj } from "./EnvUtils";
9
- import { arrForEach } from "./HelperFuncs";
10
-
11
- export type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
12
-
13
- export interface IUnloadHandlerContainer {
14
- add: (handler: UnloadHandler) => void;
15
- run: (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void
16
- }
17
-
18
- export function createUnloadHandlerContainer() {
19
- let handlers: UnloadHandler[] = [];
20
-
21
- function _addHandler(handler: UnloadHandler) {
22
- if (handler) {
23
- handlers.push(handler);
24
- }
25
- }
26
-
27
- function _runHandlers(unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) {
28
- arrForEach(handlers, (handler) => {
29
- try {
30
- handler(unloadCtx, unloadState);
31
- } catch (e) {
32
- _throwInternal(
33
- unloadCtx.diagLog(),
34
- eLoggingSeverity.WARNING,
35
- _eInternalMessageId.PluginException,
36
- "Unexpected error calling unload handler - " + dumpObj(e));
37
- }
38
- });
39
- handlers = [];
40
- }
41
-
42
- return {
43
- add: _addHandler,
44
- run: _runHandlers
45
- }
46
- }
@@ -1,27 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- /**
5
- * The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
6
- */
7
- export const enum TelemetryUnloadReason {
8
- /**
9
- * Teardown has been called without any context.
10
- */
11
- ManualTeardown = 0,
12
-
13
- /**
14
- * Just this plugin is being removed
15
- */
16
- PluginUnload = 1,
17
-
18
- /**
19
- * This instance of the plugin is being removed and replaced
20
- */
21
- PluginReplace = 2,
22
-
23
- /**
24
- * The entire SDK is being unloaded
25
- */
26
- SdkUnload = 50
27
- }
@@ -1,27 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- /**
5
- * The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
6
- */
7
- export const enum TelemetryUpdateReason {
8
- /**
9
- * Unknown.
10
- */
11
- Unknown = 0,
12
-
13
- /**
14
- * The configuration has ben updated or changed
15
- */
16
- //ConfigurationChanged = 0x01,
17
-
18
- /**
19
- * One or more plugins have been added
20
- */
21
- PluginAdded = 0x10,
22
-
23
- /**
24
- * One or more plugins have been removed
25
- */
26
- PluginRemoved = 0x20,
27
- }
@@ -1,16 +0,0 @@
1
- import { ITelemetryItem } from "./ITelemetryItem";
2
-
3
- export declare type TelemetryInitializerFunction = <T extends ITelemetryItem>(item: T) => boolean | void;
4
-
5
- export interface ITelemetryInitializerHandler {
6
- remove(): void;
7
- }
8
-
9
- export interface ITelemetryInitializerContainer {
10
- /**
11
- * Add a telemetry processor to decorate or drop telemetry events.
12
- * @param telemetryInitializer - The Telemetry Initializer function
13
- * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
14
- */
15
- addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
16
- }
@@ -1,10 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { TelemetryUnloadReason } from "../JavaScriptSDK.Enums/TelemetryUnloadReason";
5
-
6
- export interface ITelemetryUnloadState {
7
- reason: TelemetryUnloadReason;
8
- isAsync: boolean;
9
- flushComplete?: boolean;
10
- }
@@ -1,34 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { TelemetryUpdateReason } from "../JavaScriptSDK.Enums/TelemetryUpdateReason";
5
- //import { IConfiguration } from "./IConfiguration";
6
- import { IPlugin } from "./ITelemetryPlugin";
7
-
8
- export interface ITelemetryUpdateState {
9
-
10
- /**
11
- * Identifies the reason for the update notification, this is a bitwise numeric value
12
- */
13
- reason: TelemetryUpdateReason;
14
-
15
- /**
16
- * If this is a configuration update this was the previous configuration that was used
17
- */
18
- //prvCfg?: IConfiguration,
19
-
20
- /**
21
- * If this is a configuration update is the new configuration that is being used
22
- */
23
- //newCfg?: IConfiguration,
24
-
25
- /**
26
- * This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
27
- */
28
- added?: IPlugin[];
29
-
30
- /**
31
- * This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
32
- */
33
- removed?: IPlugin[]
34
- }
@@ -1,17 +0,0 @@
1
- import { IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
2
- import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
3
-
4
- // Copyright (c) Microsoft Corporation. All rights reserved.
5
- // Licensed under the MIT License.
6
-
7
- export interface IUnloadableComponent {
8
- /**
9
- * Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin
10
- * finishes it's removal.
11
- * @param unloadCtx - This is the context that should be used during unloading.
12
- * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
13
- * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
14
- * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
15
- */
16
- _doUnload?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
17
- }
@@ -1,13 +0,0 @@
1
- export interface IDataCache {
2
- id: string;
3
- accept: (target: any) => boolean;
4
- get: <T>(target: any, name: string, defValue?: T, addDefault?: boolean) => T;
5
- kill: (target: any, name: string) => void;
6
- }
7
- export declare function createUniqueNamespace(name: string, includeVersion?: boolean): string;
8
- export declare function createElmNodeData(name?: string): {
9
- id: string;
10
- accept: (target: any) => boolean;
11
- get: <T>(target: any, name: string, defValue?: T, addDefault?: boolean) => T;
12
- kill: (target: any, name: string) => void;
13
- };
@@ -1,154 +0,0 @@
1
- export interface _IRegisteredEvents {
2
- name: string;
3
- handler: any;
4
- }
5
- /**
6
- * Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by
7
- * applications to remove their own events
8
- * @param target - The EventTarget that has registered events
9
- * @param eventName - [Optional] The name of the event to return the registered handlers and full name (with namespaces)
10
- * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,
11
- * if the eventName also includes a namespace the namespace(s) are merged into a single namespace
12
- */
13
- export declare function __getRegisteredEvents(target: any, eventName?: string, evtNamespace?: string | string[]): _IRegisteredEvents[];
14
- export declare function mergeEvtNamespace(theNamespace: string, namespaces?: string | string[] | null): string | string[];
15
- /**
16
- * Binds the specified function to an event, so that the function gets called whenever the event fires on the object
17
- * @param obj Object to add the event too.
18
- * @param eventName String that specifies any of the standard DHTML Events without "on" prefix, if may also include an optional (dot "." prefixed)
19
- * namespaces "click" "click.mynamespace" in addition to specific namespaces.
20
- * @param handlerRef Pointer that specifies the function to call when event fires
21
- * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,
22
- * if the eventName also includes a namespace the namespace(s) are merged into a single namespace
23
- * @param useCapture [Optional] Defaults to false
24
- * @returns True if the function was bound successfully to the event, otherwise false
25
- */
26
- export declare function eventOn<T>(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[] | null, useCapture?: boolean): boolean;
27
- /**
28
- * Removes an event handler for the specified event
29
- * @param Object to remove the event from
30
- * @param eventName {string} - The name of the event, with optional namespaces or just the namespaces,
31
- * such as "click", "click.mynamespace" or ".mynamespace"
32
- * @param handlerRef {any} - The callback function that needs to be removed from the given event, when using a
33
- * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers
34
- * otherwise this will only remove events with this specific handler.
35
- * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace,
36
- * if the eventName also includes a namespace the namespace(s) are merged into a single namespace
37
- * @param useCapture [Optional] Defaults to false
38
- */
39
- export declare function eventOff<T>(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[] | null, useCapture?: boolean): void;
40
- /**
41
- * Binds the specified function to an event, so that the function gets called whenever the event fires on the object
42
- * @param obj Object to add the event too.
43
- * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without "on" prefix and optional (dot "." prefixed) namespaces "click" "click.mynamespace".
44
- * @param handlerRef Pointer that specifies the function to call when event fires
45
- * @param useCapture [Optional] Defaults to false
46
- * @returns True if the function was bound successfully to the event, otherwise false
47
- */
48
- export declare function attachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): boolean;
49
- /**
50
- * Removes an event handler for the specified event
51
- * @param Object to remove the event from
52
- * @param eventNameWithoutOn {string} - The name of the event, with optional namespaces or just the namespaces,
53
- * such as "click", "click.mynamespace" or ".mynamespace"
54
- * @param handlerRef {any} - The callback function that needs to be removed from the given event, when using a
55
- * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers
56
- * otherwise this will only remove events with this specific handler.
57
- * @param useCapture [Optional] Defaults to false
58
- */
59
- export declare function detachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): void;
60
- /**
61
- * Trys to add an event handler for the specified event to the window, body and document
62
- * @param eventName {string} - The name of the event
63
- * @param callback {any} - The callback function that needs to be executed for the given event
64
- * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
65
- * @return {boolean} - true if the handler was successfully added
66
- */
67
- export declare function addEventHandler(eventName: string, callback: any, evtNamespace?: string | string[] | null): boolean;
68
- /**
69
- * Trys to remove event handler(s) for the specified event/namespace to the window, body and document
70
- * @param eventName {string} - The name of the event, with optional namespaces or just the namespaces,
71
- * such as "click", "click.mynamespace" or ".mynamespace"
72
- * @param callback {any} - - The callback function that needs to be removed from the given event, when using a
73
- * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers
74
- * otherwise this will only remove events with this specific handler.
75
- * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
76
- */
77
- export declare function removeEventHandler(eventName: string, callback: any, evtNamespace?: string | string[] | null): void;
78
- /**
79
- * Bind the listener to the array of events
80
- * @param events An string array of event names to bind the listener to
81
- * @param listener The event callback to call when the event is triggered
82
- * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
83
- * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
84
- * @returns true - when at least one of the events was registered otherwise false
85
- */
86
- export declare function addEventListeners(events: string[], listener: any, excludeEvents?: string[], evtNamespace?: string | string[]): boolean;
87
- /**
88
- * Remove the listener from the array of events
89
- * @param events An string array of event names to bind the listener to
90
- * @param listener The event callback to call when the event is triggered
91
- * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
92
- */
93
- export declare function removeEventListeners(events: string[], listener: any, evtNamespace?: string | string[]): void;
94
- /**
95
- * Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring,
96
- * this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden
97
- * it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is
98
- * just navigating to a different Tab and may come back (without unloading the page). As such you may also
99
- * need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.
100
- * @param listener - The event callback to call when a page unload event is triggered
101
- * @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.
102
- * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.
103
- * @returns true - when at least one of the events was registered otherwise false
104
- */
105
- export declare function addPageUnloadEventListener(listener: any, excludeEvents?: string[], evtNamespace?: string | string[]): boolean;
106
- /**
107
- * Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener,
108
- * addEventListeners, addPageUnloadEventListener or addPageHideEventListener.
109
- * @param listener - The specific event callback to to be removed
110
- * @param evtNamespace - [Optional] Namespace(s) uniquely identified and removed based on this namespace.
111
- * @returns true - when at least one of the events was registered otherwise false
112
- */
113
- export declare function removePageUnloadEventListener(listener: any, evtNamespace?: string | string[]): void;
114
- /**
115
- * Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses
116
- * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call
117
- * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
118
- * @param listener - The event callback to call when a page hide event is triggered
119
- * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
120
- * @param evtNamespace - [Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed
121
- * based on this namespace. This call also adds an additional unique "pageshow" namespace to the events
122
- * so that only the matching "removePageHideEventListener" can remove these events.
123
- * Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide
124
- * @returns true - when at least one of the events was registered otherwise false
125
- */
126
- export declare function addPageHideEventListener(listener: any, excludeEvents?: string[] | null, evtNamespace?: string | string[] | null): boolean;
127
- /**
128
- * Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses
129
- * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener
130
- * as the remove ignores the listener argument for the 'visibilitychange' event.
131
- * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
132
- * @param evtNamespace - The unique namespace used when calling addPageShowEventListener
133
- */
134
- export declare function removePageHideEventListener(listener: any, evtNamespace?: string | string[] | null): void;
135
- /**
136
- * Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses
137
- * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call
138
- * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.
139
- * @param listener - The event callback to call when a page is show event is triggered
140
- * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.
141
- * @param evtNamespace - [Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely
142
- * identified and removed based on this namespace. This call also adds an additional unique "pageshow" namespace to the events
143
- * so that only the matching "removePageShowEventListener" can remove these events.
144
- * @returns true - when at least one of the events was registered otherwise false
145
- */
146
- export declare function addPageShowEventListener(listener: any, excludeEvents?: string[] | null, evtNamespace?: string | string[] | null): boolean;
147
- /**
148
- * Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses
149
- * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener
150
- * as the remove ignores the listener argument for the 'visibilitychange' event.
151
- * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')
152
- * @param evtNamespace - The unique namespace used when calling addPageShowEventListener
153
- */
154
- export declare function removePageShowEventListener(listener: any, evtNamespace?: string | string[] | null): void;
@@ -1,20 +0,0 @@
1
- export declare const strEmpty = "";
2
- export declare const strProcessTelemetry = "processTelemetry";
3
- export declare const strPriority = "priority";
4
- export declare const strSetNextPlugin = "setNextPlugin";
5
- export declare const strIsInitialized = "isInitialized";
6
- export declare const strTeardown = "teardown";
7
- export declare const strCore = "core";
8
- export declare const strUpdate = "update";
9
- export declare const strDisabled = "disabled";
10
- export declare const strDoTeardown = "_doTeardown";
11
- export declare const strProcessNext = "processNext";
12
- export declare const strResume = "resume";
13
- export declare const strPause = "pause";
14
- export declare const strNotificationListener = "NotificationListener";
15
- export declare const strAddNotificationListener: string;
16
- export declare const strRemoveNotificationListener: string;
17
- export declare const strEventsSent = "eventsSent";
18
- export declare const strEventsDiscarded = "eventsDiscarded";
19
- export declare const strEventsSendRequest = "eventsSendRequest";
20
- export declare const strPerfEvent = "perfEvent";
@@ -1,16 +0,0 @@
1
- import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
2
- import { ITelemetryInitializerContainer, ITelemetryInitializerHandler, TelemetryInitializerFunction } from "../JavaScriptSDK.Interfaces/ITelemetryInitializers";
3
- import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
4
- import { BaseTelemetryPlugin } from "./BaseTelemetryPlugin";
5
- export declare class TelemetryInitializerPlugin extends BaseTelemetryPlugin implements ITelemetryInitializerContainer {
6
- identifier: string;
7
- priority: number;
8
- constructor();
9
- /**
10
- * Add a telemetry processor to decorate or drop telemetry events.
11
- * @param telemetryInitializer - The Telemetry Initializer function
12
- * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
13
- */
14
- addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
15
- processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
16
- }
@@ -1,11 +0,0 @@
1
- import { IProcessTelemetryUnloadContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
2
- import { ITelemetryUnloadState } from "../JavaScriptSDK.Interfaces/ITelemetryUnloadState";
3
- export declare type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
4
- export interface IUnloadHandlerContainer {
5
- add: (handler: UnloadHandler) => void;
6
- run: (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
7
- }
8
- export declare function createUnloadHandlerContainer(): {
9
- add: (handler: UnloadHandler) => void;
10
- run: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
11
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
3
- */
4
- export declare const enum TelemetryUnloadReason {
5
- /**
6
- * Teardown has been called without any context.
7
- */
8
- ManualTeardown = 0,
9
- /**
10
- * Just this plugin is being removed
11
- */
12
- PluginUnload = 1,
13
- /**
14
- * This instance of the plugin is being removed and replaced
15
- */
16
- PluginReplace = 2,
17
- /**
18
- * The entire SDK is being unloaded
19
- */
20
- SdkUnload = 50
21
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
3
- */
4
- export declare const enum TelemetryUpdateReason {
5
- /**
6
- * Unknown.
7
- */
8
- Unknown = 0,
9
- /**
10
- * The configuration has ben updated or changed
11
- */
12
- /**
13
- * One or more plugins have been added
14
- */
15
- PluginAdded = 16,
16
- /**
17
- * One or more plugins have been removed
18
- */
19
- PluginRemoved = 32
20
- }
@@ -1,13 +0,0 @@
1
- import { ITelemetryItem } from "./ITelemetryItem";
2
- export declare type TelemetryInitializerFunction = <T extends ITelemetryItem>(item: T) => boolean | void;
3
- export interface ITelemetryInitializerHandler {
4
- remove(): void;
5
- }
6
- export interface ITelemetryInitializerContainer {
7
- /**
8
- * Add a telemetry processor to decorate or drop telemetry events.
9
- * @param telemetryInitializer - The Telemetry Initializer function
10
- * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
11
- */
12
- addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
13
- }
@@ -1,6 +0,0 @@
1
- import { TelemetryUnloadReason } from "../JavaScriptSDK.Enums/TelemetryUnloadReason";
2
- export interface ITelemetryUnloadState {
3
- reason: TelemetryUnloadReason;
4
- isAsync: boolean;
5
- flushComplete?: boolean;
6
- }
@@ -1,22 +0,0 @@
1
- import { TelemetryUpdateReason } from "../JavaScriptSDK.Enums/TelemetryUpdateReason";
2
- import { IPlugin } from "./ITelemetryPlugin";
3
- export interface ITelemetryUpdateState {
4
- /**
5
- * Identifies the reason for the update notification, this is a bitwise numeric value
6
- */
7
- reason: TelemetryUpdateReason;
8
- /**
9
- * If this is a configuration update this was the previous configuration that was used
10
- */
11
- /**
12
- * If this is a configuration update is the new configuration that is being used
13
- */
14
- /**
15
- * This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
16
- */
17
- added?: IPlugin[];
18
- /**
19
- * This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
20
- */
21
- removed?: IPlugin[];
22
- }
@@ -1,13 +0,0 @@
1
- import { IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
2
- import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
3
- export interface IUnloadableComponent {
4
- /**
5
- * Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin
6
- * finishes it's removal.
7
- * @param unloadCtx - This is the context that should be used during unloading.
8
- * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
9
- * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
10
- * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
11
- */
12
- _doUnload?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
13
- }