@react-native-firebase/perf 24.1.1 → 25.0.1

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 (67) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/module/HttpMetric.js +91 -0
  3. package/dist/module/HttpMetric.js.map +1 -0
  4. package/dist/module/MetricWithAttributes.js +51 -0
  5. package/dist/module/MetricWithAttributes.js.map +1 -0
  6. package/{lib → dist/module}/ScreenTrace.js +3 -6
  7. package/dist/module/ScreenTrace.js.map +1 -0
  8. package/{lib → dist/module}/Trace.js +8 -23
  9. package/dist/module/Trace.js.map +1 -0
  10. package/dist/module/index.js +23 -0
  11. package/dist/module/index.js.map +1 -0
  12. package/dist/module/modular.js +93 -0
  13. package/dist/module/modular.js.map +1 -0
  14. package/{lib/index.js → dist/module/namespaced.js} +28 -72
  15. package/dist/module/namespaced.js.map +1 -0
  16. package/dist/module/package.json +1 -0
  17. package/dist/module/types/internal.js +4 -0
  18. package/dist/module/types/internal.js.map +1 -0
  19. package/dist/module/types/namespaced.js +65 -0
  20. package/dist/module/types/namespaced.js.map +1 -0
  21. package/dist/module/types/perf.js +4 -0
  22. package/dist/module/types/perf.js.map +1 -0
  23. package/dist/module/version.js +5 -0
  24. package/dist/module/version.js.map +1 -0
  25. package/dist/typescript/lib/HttpMetric.d.ts +21 -0
  26. package/dist/typescript/lib/HttpMetric.d.ts.map +1 -0
  27. package/dist/typescript/lib/MetricWithAttributes.d.ts +11 -0
  28. package/dist/typescript/lib/MetricWithAttributes.d.ts.map +1 -0
  29. package/dist/typescript/lib/ScreenTrace.d.ts +12 -0
  30. package/dist/typescript/lib/ScreenTrace.d.ts.map +1 -0
  31. package/dist/typescript/lib/Trace.d.ts +17 -0
  32. package/dist/typescript/lib/Trace.d.ts.map +1 -0
  33. package/dist/typescript/lib/index.d.ts +6 -0
  34. package/dist/typescript/lib/index.d.ts.map +1 -0
  35. package/dist/typescript/lib/modular.d.ts +43 -0
  36. package/dist/typescript/lib/modular.d.ts.map +1 -0
  37. package/dist/typescript/lib/namespaced.d.ts +11 -0
  38. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  39. package/dist/typescript/lib/types/internal.d.ts +45 -0
  40. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  41. package/dist/typescript/lib/types/namespaced.d.ts +128 -0
  42. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  43. package/dist/typescript/lib/types/perf.d.ts +72 -0
  44. package/dist/typescript/lib/types/perf.d.ts.map +1 -0
  45. package/dist/typescript/lib/version.d.ts +2 -0
  46. package/dist/typescript/lib/version.d.ts.map +1 -0
  47. package/dist/typescript/package.json +1 -0
  48. package/lib/{HttpMetric.js → HttpMetric.ts} +21 -8
  49. package/lib/{MetricWithAttributes.js → MetricWithAttributes.ts} +14 -4
  50. package/lib/ScreenTrace.ts +59 -0
  51. package/lib/Trace.ts +112 -0
  52. package/lib/index.ts +25 -0
  53. package/lib/modular.ts +116 -0
  54. package/lib/namespaced.ts +200 -0
  55. package/lib/types/internal.ts +80 -0
  56. package/lib/types/namespaced.ts +162 -0
  57. package/lib/types/perf.ts +99 -0
  58. package/lib/version.ts +2 -0
  59. package/package.json +40 -8
  60. package/plugin/tsconfig.json +2 -1
  61. package/plugin/tsconfig.tsbuildinfo +1 -1
  62. package/tsconfig.json +20 -0
  63. package/typedoc.json +2 -2
  64. package/lib/index.d.ts +0 -583
  65. package/lib/modular/index.d.ts +0 -89
  66. package/lib/modular/index.js +0 -103
  67. package/lib/version.js +0 -2
@@ -1,103 +0,0 @@
1
- /*
2
- * Copyright (c) 2016-present Invertase Limited & Contributors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this library except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- /**
19
- * @typedef {import('@firebase/app').FirebaseApp} FirebaseApp
20
- * @typedef {import('..').FirebasePerformanceTypes.Module} Performance
21
- * @typedef {import('..').FirebasePerformanceTypes.Trace} Trace
22
- * @typedef {import('..').FirebasePerformanceTypes.ScreenTrace} ScreenTrace
23
- * @typedef {import('..').FirebasePerformanceTypes.HttpMetric} HttpMetric
24
- */
25
-
26
- import { getApp } from '@react-native-firebase/app';
27
-
28
- import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
29
-
30
- /**
31
- * Returns a Performance instance for the given app.
32
- * @param app - FirebaseApp. Optional.
33
- * @returns {Performance}
34
- */
35
- export function getPerformance(app) {
36
- if (app) {
37
- return getApp(app.name).perf();
38
- }
39
-
40
- return getApp().perf();
41
- }
42
-
43
- /**
44
- * Returns a Performance instance for the given app.
45
- * @param app - FirebaseApp. Required.
46
- * @param settings - Optional PerformanceSettings. Set "dataCollectionEnabled" which will enable/disable Performance collection.
47
- * @returns {Performance}
48
- */
49
- export async function initializePerformance(app, settings) {
50
- const perf = getApp(app.name).perf();
51
-
52
- if (settings && settings.dataCollectionEnabled !== undefined) {
53
- perf.dataCollectionEnabled = settings.dataCollectionEnabled;
54
- }
55
- if (settings && settings.instrumentationEnabled !== undefined) {
56
- perf.instrumentationEnabled = settings.instrumentationEnabled;
57
- }
58
-
59
- return perf;
60
- }
61
-
62
- /**
63
- * Returns a Trace instance.
64
- * @param perf - Performance instance
65
- * @param identifier - A String to identify the Trace instance
66
- * @returns {Trace}
67
- */
68
- export function trace(perf, identifier) {
69
- return perf.newTrace.call(perf, identifier, MODULAR_DEPRECATION_ARG);
70
- }
71
-
72
- /**
73
- * Returns a HttpMetric instance.
74
- * @param perf - Performance instance
75
- * @param identifier - A String to identify the HttpMetric instance
76
- * @returns {HttpMetric}
77
- */
78
- export function httpMetric(perf, identifier, httpMethod) {
79
- return perf.newHttpMetric.call(perf, identifier, httpMethod, MODULAR_DEPRECATION_ARG);
80
- }
81
-
82
- /**
83
- * Creates a ScreenTrace instance with the given identifier.
84
- * Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
85
- * @platform android Android !== 9.0.0 && Android !== 9.1.0
86
- * @param perf - Performance instance
87
- * @param identifier Name of the trace, no leading or trailing whitespace allowed, no leading underscore '_' character allowed, max length is 100.
88
- * @returns {ScreenTrace}
89
- */
90
- export function newScreenTrace(perf, identifier) {
91
- return perf.newScreenTrace.call(perf, identifier, MODULAR_DEPRECATION_ARG);
92
- }
93
- /**
94
- * Creates a ScreenTrace instance with the given identifier and immediately starts it.
95
- * Throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
96
- * @platform android Android !== 9.0.0 && Android !== 9.1.0
97
- * @param perf - Performance instance
98
- * @param identifier Name of the screen
99
- * @returns {Promise<ScreenTrace>}
100
- */
101
- export function startScreenTrace(perf, identifier) {
102
- return perf.startScreenTrace.call(perf, identifier, MODULAR_DEPRECATION_ARG);
103
- }
package/lib/version.js DELETED
@@ -1,2 +0,0 @@
1
- // Generated by genversion.
2
- module.exports = '24.1.1';