@microsoft/applicationinsights-react-native 2.5.6 → 3.0.1-nightly.2208-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 (44) hide show
  1. package/README.md +49 -2
  2. package/browser/applicationinsights-react-native.js +109 -49
  3. package/browser/applicationinsights-react-native.js.map +1 -1
  4. package/browser/applicationinsights-react-native.min.js +2 -2
  5. package/browser/applicationinsights-react-native.min.js.map +1 -1
  6. package/dist/applicationinsights-react-native.api.json +216 -6
  7. package/dist/applicationinsights-react-native.api.md +12 -5
  8. package/dist/applicationinsights-react-native.d.ts +70 -1
  9. package/dist/applicationinsights-react-native.js +109 -49
  10. package/dist/applicationinsights-react-native.js.map +1 -1
  11. package/dist/applicationinsights-react-native.min.js +2 -2
  12. package/dist/applicationinsights-react-native.min.js.map +1 -1
  13. package/dist/applicationinsights-react-native.rollup.d.ts +70 -1
  14. package/dist-esm/DeviceInfo/DeviceModule.js +38 -0
  15. package/dist-esm/DeviceInfo/DeviceModule.js.map +1 -0
  16. package/dist-esm/DeviceInfo/ReactNativeDeviceInfo.js +15 -0
  17. package/dist-esm/DeviceInfo/ReactNativeDeviceInfo.js.map +1 -0
  18. package/dist-esm/Interfaces/IDeviceInfoModule.js +8 -0
  19. package/dist-esm/Interfaces/IDeviceInfoModule.js.map +1 -0
  20. package/dist-esm/Interfaces/INativeDevice.js +3 -1
  21. package/dist-esm/Interfaces/INativeDevice.js.map +1 -1
  22. package/dist-esm/Interfaces/IReactNativePluginConfig.js +1 -1
  23. package/dist-esm/Interfaces/index.js +3 -1
  24. package/dist-esm/Interfaces/index.js.map +1 -1
  25. package/dist-esm/ReactNativePlugin.js +81 -41
  26. package/dist-esm/ReactNativePlugin.js.map +1 -1
  27. package/dist-esm/index.js +5 -1
  28. package/dist-esm/index.js.map +1 -1
  29. package/package.json +86 -82
  30. package/src/DeviceInfo/DeviceModule.ts +44 -0
  31. package/src/DeviceInfo/ReactNativeDeviceInfo.ts +13 -0
  32. package/src/Interfaces/IDeviceInfoModule.ts +31 -0
  33. package/src/Interfaces/INativeDevice.ts +3 -0
  34. package/src/Interfaces/IReactNativePluginConfig.ts +15 -0
  35. package/src/Interfaces/index.ts +3 -0
  36. package/src/ReactNativePlugin.ts +109 -41
  37. package/src/index.ts +8 -2
  38. package/types/DeviceInfo/DeviceModule.d.ts +10 -0
  39. package/types/DeviceInfo/ReactNativeDeviceInfo.d.ts +6 -0
  40. package/types/Interfaces/IDeviceInfoModule.d.ts +25 -0
  41. package/types/Interfaces/IReactNativePluginConfig.d.ts +11 -0
  42. package/types/ReactNativePlugin.d.ts +27 -11
  43. package/types/index.d.ts +4 -1
  44. package/types/tsdoc-metadata.json +1 -1
@@ -1,16 +1,6 @@
1
- /**
2
- * ReactNativePlugin.ts
3
- * @copyright Microsoft 2019
4
- */
5
1
  import { BaseTelemetryPlugin, IAppInsightsCore, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPlugin } from "@microsoft/applicationinsights-core-js";
6
2
  import { IReactNativePluginConfig } from "./Interfaces";
7
- /**
8
- * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a
9
- * performance optimization to avoid the creation of a new array for large objects
10
- * @param target The target object to find and process the keys
11
- * @param callbackfn The function to call with the details
12
- */
13
- export declare function objForEachKey(target: any, callbackfn: (name: string, value: any) => void): void;
3
+ import { IDeviceInfoModule } from "./Interfaces/IDeviceInfoModule";
14
4
  export declare class ReactNativePlugin extends BaseTelemetryPlugin {
15
5
  identifier: string;
16
6
  priority: number;
@@ -21,7 +11,33 @@ export declare class ReactNativePlugin extends BaseTelemetryPlugin {
21
11
  initialize(config?: IReactNativePluginConfig | object, // need `| object` to coerce to interface
22
12
  core?: IAppInsightsCore, extensions?: IPlugin[]): void;
23
13
  processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
14
+ /**
15
+ * Set the module that will be used during initialization when collecting device is enabled
16
+ * (the default), automatic collection can be disabled via the `disableDeviceCollection`
17
+ * config. The `react-native-device-info` module will be used by default if no
18
+ * `deviceInfoModule` is set and collection is enabled.
19
+ * @param deviceInfoModule
20
+ */
21
+ setDeviceInfoModule(deviceInfoModule: IDeviceInfoModule): void;
22
+ /**
23
+ * Manually set the deviceId, if set before initialization and automatic device info collection
24
+ * is enabled this value may get overwritten. If you want to keep this value disable auto
25
+ * collection by setting the `disableDeviceCollection` config to true.
26
+ * @param newId - The value to use as the device Id.
27
+ */
24
28
  setDeviceId(newId: string): void;
29
+ /**
30
+ * Manually set the device model, if set before initialization and automatic device info
31
+ * collection is enabled this value may get overwritten. If you want to keep this value
32
+ * disable auto collection by setting the `disableDeviceCollection` config to true.
33
+ * @param newModel - The value to use as the device model.
34
+ */
25
35
  setDeviceModel(newModel: string): void;
36
+ /**
37
+ * Manually set the device type (class), if set before initialization and automatic device
38
+ * info collection is enabled this value may get overwritten. If you want to keep this value
39
+ * disable auto collection by setting the `disableDeviceCollection` config to true.
40
+ * @param newType - The value to use as the device type
41
+ */
26
42
  setDeviceType(newType: string): void;
27
43
  }
package/types/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import { ReactNativePlugin } from "./ReactNativePlugin";
2
2
  import { INativeDevice, IReactNativePluginConfig } from "./Interfaces";
3
- export { ReactNativePlugin, INativeDevice, IReactNativePluginConfig };
3
+ import { IDeviceInfoModule } from "./Interfaces/IDeviceInfoModule";
4
+ import { getReactNativeDeviceInfo } from "./DeviceInfo/ReactNativeDeviceInfo";
5
+ export { ReactNativePlugin, INativeDevice, IReactNativePluginConfig, IDeviceInfoModule };
6
+ export { getReactNativeDeviceInfo };
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.28.6"
8
+ "packageVersion": "7.29.2"
9
9
  }
10
10
  ]
11
11
  }