@microsoft/applicationinsights-react-native 4.3.4 → 4.3.5-nightly.2411-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 (34) hide show
  1. package/browser/applicationinsights-react-native.js +3133 -0
  2. package/browser/applicationinsights-react-native.js.map +1 -0
  3. package/browser/applicationinsights-react-native.min.js +6 -0
  4. package/browser/applicationinsights-react-native.min.js.map +1 -0
  5. package/dist/applicationinsights-react-native.api.json +1149 -0
  6. package/dist/applicationinsights-react-native.api.md +68 -0
  7. package/dist/applicationinsights-react-native.d.ts +126 -0
  8. package/dist/applicationinsights-react-native.js +3133 -0
  9. package/dist/applicationinsights-react-native.js.map +1 -0
  10. package/dist/applicationinsights-react-native.min.js +6 -0
  11. package/dist/applicationinsights-react-native.min.js.map +1 -0
  12. package/dist/applicationinsights-react-native.rollup.d.ts +131 -0
  13. package/dist-esm/DeviceInfo/DeviceModule.js +6 -2
  14. package/dist-esm/DeviceInfo/DeviceModule.js.map +1 -1
  15. package/dist-esm/DeviceInfo/ReactNativeDeviceInfo.js +6 -2
  16. package/dist-esm/DeviceInfo/ReactNativeDeviceInfo.js.map +1 -1
  17. package/dist-esm/Interfaces/IDeviceInfoModule.js +6 -2
  18. package/dist-esm/Interfaces/IDeviceInfoModule.js.map +1 -1
  19. package/dist-esm/Interfaces/INativeDevice.js +6 -2
  20. package/dist-esm/Interfaces/INativeDevice.js.map +1 -1
  21. package/dist-esm/Interfaces/IReactNativePluginConfig.js +4 -0
  22. package/dist-esm/Interfaces/IReactNativePluginConfig.js.map +1 -1
  23. package/dist-esm/Interfaces/index.js +6 -2
  24. package/dist-esm/Interfaces/index.js.map +1 -1
  25. package/dist-esm/ReactNativeManualDevicePlugin.js +13 -46
  26. package/dist-esm/ReactNativeManualDevicePlugin.js.map +1 -1
  27. package/dist-esm/ReactNativePlugin.js +7 -3
  28. package/dist-esm/ReactNativePlugin.js.map +1 -1
  29. package/dist-esm/index.js +6 -2
  30. package/dist-esm/index.js.map +1 -1
  31. package/dist-esm/manualIndex.js +6 -2
  32. package/dist-esm/manualIndex.js.map +1 -1
  33. package/package.json +100 -97
  34. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,68 @@
1
+ ## API Report File for "@microsoft/applicationinsights-react-native"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';
8
+ import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
9
+ import { IPlugin } from '@microsoft/applicationinsights-core-js';
10
+ import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
11
+ import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
12
+ import { ITelemetryPlugin } from '@microsoft/applicationinsights-core-js';
13
+
14
+ // @public
15
+ export function getReactNativeDeviceInfo(): IDeviceInfoModule;
16
+
17
+ // @public
18
+ export interface IDeviceInfoModule {
19
+ getDeviceType: () => string;
20
+ getModel: () => string;
21
+ getUniqueId: () => Promise<string> | string;
22
+ }
23
+
24
+ // @public (undocumented)
25
+ export interface INativeDevice {
26
+ deviceClass?: string;
27
+ id?: string;
28
+ model?: string;
29
+ }
30
+
31
+ // @public (undocumented)
32
+ export interface IReactNativePluginConfig {
33
+ disableDeviceCollection?: boolean;
34
+ disableExceptionCollection?: boolean;
35
+ uniqueIdPromiseTimeout?: number;
36
+ }
37
+
38
+ // @public (undocumented)
39
+ export class ReactNativeManualDevicePlugin extends BaseTelemetryPlugin {
40
+ constructor(config?: IReactNativePluginConfig);
41
+ // (undocumented)
42
+ protected getDeviceInfoModule(_deviceInfoModule: any): IDeviceInfoModule;
43
+ // (undocumented)
44
+ identifier: string;
45
+ // (undocumented)
46
+ initialize(config?: IReactNativePluginConfig | object, // need `| object` to coerce to interface
47
+ core?: IAppInsightsCore, extensions?: IPlugin[]): void;
48
+ // (undocumented)
49
+ _nextPlugin?: ITelemetryPlugin;
50
+ // (undocumented)
51
+ priority: number;
52
+ // (undocumented)
53
+ processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
54
+ setDeviceId(newId: string): void;
55
+ setDeviceInfoModule(deviceInfoModule: IDeviceInfoModule): void;
56
+ setDeviceModel(newModel: string): void;
57
+ setDeviceType(newType: string): void;
58
+ }
59
+
60
+ // @public (undocumented)
61
+ export class ReactNativePlugin extends ReactNativeManualDevicePlugin {
62
+ // (undocumented)
63
+ protected getDeviceInfoModule(_deviceInfoModule: any): IDeviceInfoModule;
64
+ }
65
+
66
+ // (No @packageDocumentation comment for this package)
67
+
68
+ ```
@@ -0,0 +1,126 @@
1
+ /*
2
+ * Microsoft Application Insights react native plugin, 4.3.5-nightly.2411-03
3
+ * Copyright (c) Microsoft and contributors. All rights reserved.
4
+ *
5
+ * Microsoft Application Insights Team
6
+ * https://github.com/microsoft/applicationinsights-react-native#readme
7
+ */
8
+
9
+ declare namespace ApplicationInsights {
10
+ import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js';
11
+ import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
12
+ import { IPlugin } from '@microsoft/applicationinsights-core-js';
13
+ import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js';
14
+ import { ITelemetryItem } from '@microsoft/applicationinsights-core-js';
15
+ import { ITelemetryPlugin } from '@microsoft/applicationinsights-core-js';
16
+
17
+ /**
18
+ * Returns the "react-native-device-info" as the Device Info Module
19
+ * @returns
20
+ */
21
+ function getReactNativeDeviceInfo(): IDeviceInfoModule;
22
+
23
+ /**
24
+ * Interface to abstract how the plugin can access the Device Info, this is a stripped
25
+ * down version of the "react-native-device-info" interface and is mostly supplied for
26
+ * testing.
27
+ */
28
+ interface IDeviceInfoModule {
29
+ /**
30
+ * Returns the Device Model
31
+ */
32
+ getModel: () => string;
33
+ /**
34
+ * Returns the device type
35
+ */
36
+ getDeviceType: () => string;
37
+ /**
38
+ * Returns the unique Id for the device, to support both the current version and previous
39
+ * versions react-native-device-info, this may return either a `string` or `Promise<string>`,
40
+ * when a promise is returned the plugin will "wait" for the promise to `resolve` or `reject`
41
+ * before processing any events. This WILL cause telemetry to be BLOCKED until either of these
42
+ * states, so when returning a Promise it MUST `resolve` or `reject` it can't just never resolve.
43
+ * There is a default timeout configured via `uniqueIdPromiseTimeout` to automatically unblock
44
+ * event processing when this issue occurs.
45
+ */
46
+ getUniqueId: () => Promise<string> | string;
47
+ }
48
+
49
+ interface INativeDevice {
50
+ /**
51
+ * Device type, e.g. Handset, Tablet, Tv
52
+ */
53
+ deviceClass?: string;
54
+ /**
55
+ * Unique installation ID
56
+ */
57
+ id?: string;
58
+ /**
59
+ * The device model: iPhone XS Max, Galaxy S10, etc
60
+ */
61
+ model?: string;
62
+ }
63
+
64
+ interface IReactNativePluginConfig {
65
+ /**
66
+ * Disable automatic device collection
67
+ */
68
+ disableDeviceCollection?: boolean;
69
+ /**
70
+ * Disable automatic exception collection
71
+ */
72
+ disableExceptionCollection?: boolean;
73
+ /**
74
+ * Timeout value to unblock the processing of events if the DeviceInfoModule
75
+ * returns a Promise.
76
+ */
77
+ uniqueIdPromiseTimeout?: number;
78
+ }
79
+
80
+ class ReactNativeManualDevicePlugin extends BaseTelemetryPlugin {
81
+ identifier: string;
82
+ priority: number;
83
+ _nextPlugin?: ITelemetryPlugin;
84
+ private _setExceptionHandler;
85
+ private _collectDeviceInfo;
86
+ constructor(config?: IReactNativePluginConfig);
87
+ protected getDeviceInfoModule(_deviceInfoModule: any): IDeviceInfoModule;
88
+ initialize(config?: IReactNativePluginConfig | object, // need `| object` to coerce to interface
89
+ core?: IAppInsightsCore, extensions?: IPlugin[]): void;
90
+ processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
91
+ /**
92
+ * Set the module that will be used during initialization when collecting device is enabled
93
+ * (the default), automatic collection can be disabled via the `disableDeviceCollection`
94
+ * config. If no `deviceInfoModule` is set and collection is enabled, an error will be thrown.
95
+ * @param deviceInfoModule
96
+ */
97
+ setDeviceInfoModule(deviceInfoModule: IDeviceInfoModule): void;
98
+ /**
99
+ * Manually set the deviceId, if set before initialization and automatic device info collection
100
+ * is enabled this value may get overwritten. If you want to keep this value disable auto
101
+ * collection by setting the `disableDeviceCollection` config to true.
102
+ * @param newId - The value to use as the device Id.
103
+ */
104
+ setDeviceId(newId: string): void;
105
+ /**
106
+ * Manually set the device model, if set before initialization and automatic device info
107
+ * collection is enabled this value may get overwritten. If you want to keep this value
108
+ * disable auto collection by setting the `disableDeviceCollection` config to true.
109
+ * @param newModel - The value to use as the device model.
110
+ */
111
+ setDeviceModel(newModel: string): void;
112
+ /**
113
+ * Manually set the device type (class), if set before initialization and automatic device
114
+ * info collection is enabled this value may get overwritten. If you want to keep this value
115
+ * disable auto collection by setting the `disableDeviceCollection` config to true.
116
+ * @param newType - The value to use as the device type
117
+ */
118
+ setDeviceType(newType: string): void;
119
+ }
120
+
121
+ class ReactNativePlugin extends ReactNativeManualDevicePlugin {
122
+ protected getDeviceInfoModule(_deviceInfoModule: any): IDeviceInfoModule;
123
+ }
124
+
125
+
126
+ }