@react-native-firebase/perf 24.1.1 → 25.0.0

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 +25 -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
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isBoolean","isOneOf","isString","createModuleNamespace","FirebaseModule","getFirebaseRoot","Platform","HttpMetric","ScreenTrace","Trace","version","statics","SDK_VERSION","namespace","nativeModuleName","VALID_HTTP_METHODS","FirebasePerfModule","constructor","app","config","customUrlOrRegion","_isPerformanceCollectionEnabled","native","isPerformanceCollectionEnabled","_instrumentationEnabled","isInstrumentationEnabled","instrumentationEnabled","enabled","Error","OS","dataCollectionEnabled","setPerformanceCollectionEnabled","newTrace","identifier","length","startTrace","traceInstance","start","then","newScreenTrace","startScreenTrace","screenTrace","newHttpMetric","url","httpMethod","join","defaultExport","nativeEvents","hasMultiAppSupport","hasCustomUrlOrRegionSupport","ModuleClass","firebase"],"sourceRoot":"../../lib","sources":["namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,+CAA+C;AAC5F,SACEC,qBAAqB,EACrBC,cAAc,EACdC,eAAe,QAEV,iDAAiD;AACxD,SAASC,QAAQ,QAAQ,cAAc;AAEvC,OAAOC,UAAU,MAAM,iBAAc;AACrC,OAAOC,WAAW,MAAM,kBAAe;AACvC,OAAOC,KAAK,MAAM,YAAS;AAC3B,SAASC,OAAO,QAAQ,cAAW;AAKnC,MAAMC,OAAyC,GAAG;EAChDC,WAAW,EAAEF;AACf,CAAC;AAED,MAAMG,SAAS,GAAG,MAAM;AAExB,MAAMC,gBAAgB,GAAG,gBAAyB;AAElD,MAAMC,kBAAyD,GAAG,CAChE,SAAS,EACT,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,CACR;AAED,MAAMC,kBAAkB,SAASZ,cAAc,CAA0B;EAIvEa,WAAWA,CACTC,GAAwC,EACxCC,MAAoB,EACpBC,iBAAiC,EACjC;IACA,KAAK,CAACF,GAAG,EAAEC,MAAM,EAAEC,iBAAiB,CAAC;IACrC,IAAI,CAACC,+BAA+B,GAAG,IAAI,CAACC,MAAM,CAACC,8BAA8B;IACjF,IAAI,CAACC,uBAAuB,GAAG,IAAI,CAACF,MAAM,CAACG,wBAAwB;EACrE;EAEA,IAAIF,8BAA8BA,CAAA,EAAY;IAC5C,OAAO,IAAI,CAACF,+BAA+B;EAC7C;EAE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hC,WAAW,GAAGF,OAAO;AAUlC,MAAMoC,aAAa,GAAG3C,qBAAqB,CAAC;EAC1CQ,OAAO;EACPD,OAAO;EACPG,SAAS;EACTC,gBAAgB;EAChBiC,YAAY,EAAE,KAAK;EACnBC,kBAAkB,EAAE,KAAK;EACzBC,2BAA2B,EAAE,KAAK;EAClCC,WAAW,EAAElC;AACf,CAAC,CAA6B;AAE9B,eAAe8B,aAAa;;AAE5B;AACA;AACA;AACA,OAAO,MAAMK,QAAQ,GACnB9C,eAAe,CAAC,CAIf","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../lib","sources":["types/internal.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+ /**
20
+ * Firebase Performance Monitoring package for React Native.
21
+ *
22
+ * #### Example 1
23
+ *
24
+ * Access the firebase export from the `perf` package:
25
+ *
26
+ * ```js
27
+ * import { firebase } from '@react-native-firebase/perf';
28
+ *
29
+ * // firebase.perf().X
30
+ * ```
31
+ *
32
+ * #### Example 2
33
+ *
34
+ * Using the default export from the `perf` package:
35
+ *
36
+ * ```js
37
+ * import perf from '@react-native-firebase/perf';
38
+ *
39
+ * // perf().X
40
+ * ```
41
+ *
42
+ * #### Example 3
43
+ *
44
+ * Using the default export from the `app` package:
45
+ *
46
+ * ```js
47
+ * import firebase from '@react-native-firebase/app';
48
+ * import '@react-native-firebase/perf';
49
+ *
50
+ * // firebase.perf().X
51
+ * ```
52
+ *
53
+ * @firebase perf
54
+ */
55
+ /**
56
+ * @deprecated Use the modular type exports from `@react-native-firebase/perf` instead.
57
+ * `FirebasePerformanceTypes` is kept for backwards compatibility with the namespaced API.
58
+ */
59
+ /* eslint-disable @typescript-eslint/no-namespace */
60
+ export let FirebasePerformanceTypes;
61
+ /* eslint-enable @typescript-eslint/no-namespace */
62
+ /**
63
+ * Attach namespace to `firebase.` and `FirebaseApp.`.
64
+ */
65
+ //# sourceMappingURL=namespaced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FirebasePerformanceTypes"],"sourceRoot":"../../../lib","sources":["types/namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,WACiBA,wBAAwB;AAkFzC;AAEA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=perf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../lib","sources":["types/perf.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ // Generated by genversion.
4
+ export const version = '25.0.0';
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["version"],"sourceRoot":"../../lib","sources":["version.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,OAAO,GAAG,QAAQ","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ import MetricWithAttributes from './MetricWithAttributes';
2
+ import type { RNFBPerfNativeModule } from './types/internal';
3
+ import type { HttpMethod } from './types/perf';
4
+ export default class HttpMetric extends MetricWithAttributes {
5
+ private readonly _url;
6
+ private readonly _httpMethod;
7
+ private _httpResponseCode;
8
+ private _requestPayloadSize;
9
+ private _responsePayloadSize;
10
+ private _responseContentType;
11
+ private _started;
12
+ private _stopped;
13
+ constructor(native: RNFBPerfNativeModule, url: string, httpMethod: HttpMethod);
14
+ setHttpResponseCode(code: number | null): void;
15
+ setRequestPayloadSize(bytes: number | null): void;
16
+ setResponsePayloadSize(bytes: number | null): void;
17
+ setResponseContentType(contentType: string | null): void;
18
+ start(): Promise<null>;
19
+ stop(): Promise<null>;
20
+ }
21
+ //# sourceMappingURL=HttpMetric.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpMetric.d.ts","sourceRoot":"","sources":["../../../lib/HttpMetric.ts"],"names":[],"mappings":"AAmBA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAA0B,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,oBAAoB;IAC1D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,OAAO,CAAC,oBAAoB,CAAgB;IAC5C,OAAO,CAAC,oBAAoB,CAAgB;IAC5C,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,QAAQ,CAAU;gBAEd,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;IAe7E,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAU9C,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUjD,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUlD,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAUxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CA+BtB"}
@@ -0,0 +1,11 @@
1
+ import type { RNFBPerfNativeModule } from './types/internal';
2
+ export default class MetricWithAttributes {
3
+ protected readonly native: RNFBPerfNativeModule;
4
+ protected readonly _id: number;
5
+ protected _attributes: Record<string, string>;
6
+ constructor(native: RNFBPerfNativeModule);
7
+ getAttribute(attribute: string): string | null;
8
+ getAttributes(): Record<string, string>;
9
+ putAttribute(attribute: string, value: string): void;
10
+ }
11
+ //# sourceMappingURL=MetricWithAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricWithAttributes.d.ts","sourceRoot":"","sources":["../../../lib/MetricWithAttributes.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAChD,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAElC,MAAM,EAAE,oBAAoB;IAMxC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAO9C,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIvC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAsBrD"}
@@ -0,0 +1,12 @@
1
+ import type { RNFBPerfNativeModule } from './types/internal';
2
+ export default class ScreenTrace {
3
+ readonly native: RNFBPerfNativeModule;
4
+ private readonly _identifier;
5
+ private readonly _id;
6
+ private _started;
7
+ private _stopped;
8
+ constructor(native: RNFBPerfNativeModule, identifier: string);
9
+ start(): Promise<null>;
10
+ stop(): Promise<null>;
11
+ }
12
+ //# sourceMappingURL=ScreenTrace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenTrace.d.ts","sourceRoot":"","sources":["../../../lib/ScreenTrace.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,QAAQ,CAAU;gBAEd,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM;IAQ5D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAQtB"}
@@ -0,0 +1,17 @@
1
+ import MetricWithAttributes from './MetricWithAttributes';
2
+ import type { RNFBPerfNativeModule } from './types/internal';
3
+ export default class Trace extends MetricWithAttributes {
4
+ private readonly _identifier;
5
+ private readonly _metrics;
6
+ private _started;
7
+ private _stopped;
8
+ constructor(native: RNFBPerfNativeModule, identifier: string);
9
+ getMetric(metricName: string): number;
10
+ getMetrics(): Record<string, number>;
11
+ putMetric(metricName: string, value: number): void;
12
+ incrementMetric(metricName: string, num?: number): void;
13
+ removeMetric(metric: string): void;
14
+ start(): Promise<null>;
15
+ stop(): Promise<null>;
16
+ }
17
+ //# sourceMappingURL=Trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trace.d.ts","sourceRoot":"","sources":["../../../lib/Trace.ts"],"names":[],"mappings":"AAmBA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,oBAAoB;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAClD,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,QAAQ,CAAU;gBAEd,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM;IAU5D,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAQrC,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIpC,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAclD,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAgBvD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAatB"}
@@ -0,0 +1,6 @@
1
+ export type * from './types/perf';
2
+ export * from './modular';
3
+ export type { FirebasePerformanceTypes } from './types/namespaced';
4
+ export * from './namespaced';
5
+ export { default } from './namespaced';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":"AAiBA,mBAAmB,cAAc,CAAC;AAElC,cAAc,WAAW,CAAC;AAE1B,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { FirebaseApp } from '@react-native-firebase/app';
2
+ import type { FirebasePerformance, HttpMetric, HttpMethod, PerformanceSettings, PerformanceTrace, ScreenTrace } from './types/perf';
3
+ /**
4
+ * Returns a {@link FirebasePerformance} instance for the given app.
5
+ * @param app - The FirebaseApp to use. Optional; defaults to the default app.
6
+ */
7
+ export declare function getPerformance(app?: FirebaseApp): FirebasePerformance;
8
+ /**
9
+ * Returns a {@link FirebasePerformance} instance for the given app (aligned with the Firebase JS SDK).
10
+ * Can only be called once per app during initialization in typical usage.
11
+ *
12
+ * @param app - The FirebaseApp to use.
13
+ * @param settings - Optional {@link PerformanceSettings}.
14
+ */
15
+ export declare function initializePerformance(app: FirebaseApp, settings?: PerformanceSettings): FirebasePerformance;
16
+ /**
17
+ * Returns a new {@link PerformanceTrace} instance.
18
+ * @param performance - The {@link FirebasePerformance} instance to use.
19
+ * @param name - The name of the trace.
20
+ */
21
+ export declare function trace(performance: FirebasePerformance, name: string): PerformanceTrace;
22
+ /**
23
+ * Creates an {@link HttpMetric} for a URL and HTTP method (React Native).
24
+ * @param performance - The {@link FirebasePerformance} instance to use.
25
+ * @param url - Request URL.
26
+ * @param httpMethod - HTTP method.
27
+ */
28
+ export declare function httpMetric(performance: FirebasePerformance, url: string, httpMethod: HttpMethod): HttpMetric;
29
+ /**
30
+ * Creates a {@link ScreenTrace} with the given screen name.
31
+ * Android only; throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
32
+ * @param performance - The {@link FirebasePerformance} instance to use.
33
+ * @param screenName - Screen name; no leading/trailing whitespace, no leading `_`, max length 100.
34
+ */
35
+ export declare function newScreenTrace(performance: FirebasePerformance, screenName: string): ScreenTrace;
36
+ /**
37
+ * Creates a {@link ScreenTrace} and starts it immediately.
38
+ * Android only; throws if hardware acceleration is disabled or if Android is 9.0 or 9.1.
39
+ * @param performance - The {@link FirebasePerformance} instance to use.
40
+ * @param screenName - Name of the screen.
41
+ */
42
+ export declare function startScreenTrace(performance: FirebasePerformance, screenName: string): Promise<ScreenTrace>;
43
+ //# sourceMappingURL=modular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../../../lib/modular.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACZ,MAAM,cAAc,CAAC;AAQtB;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,mBAAmB,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,WAAW,EAChB,QAAQ,CAAC,EAAE,mBAAmB,GAC7B,mBAAmB,CAWrB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,WAAW,EAAE,mBAAmB,EAChC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,UAAU,GACrB,UAAU,CAEZ;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAEhG;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,mBAAmB,EAChC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAEtB"}
@@ -0,0 +1,11 @@
1
+ import type { ReactNativeFirebase } from '@react-native-firebase/app';
2
+ import type { FirebasePerformanceTypes } from './types/namespaced';
3
+ export declare const SDK_VERSION = "25.0.0";
4
+ export type PerfNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<FirebasePerformanceTypes.Module, FirebasePerformanceTypes.Statics> & {
5
+ firebase: ReactNativeFirebase.Module;
6
+ app(name?: string): ReactNativeFirebase.FirebaseApp;
7
+ };
8
+ declare const defaultExport: PerfNamespace;
9
+ export default defaultExport;
10
+ export declare const firebase: ReactNativeFirebase.FirebaseNamespacedExport<"perf", FirebasePerformanceTypes.Module, FirebasePerformanceTypes.Statics>;
11
+ //# sourceMappingURL=namespaced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../lib/namespaced.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAwInE,eAAO,MAAM,WAAW,WAAU,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG,mBAAmB,CAAC,+BAA+B,CAC7E,wBAAwB,CAAC,MAAM,EAC/B,wBAAwB,CAAC,OAAO,CACjC,GAAG;IACF,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC;IACrC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC,WAAW,CAAC;CACrD,CAAC;AAEF,QAAA,MAAM,aAAa,EASF,aAAa,CAAC;AAE/B,eAAe,aAAa,CAAC;AAK7B,eAAO,MAAM,QAAQ,EACa,mBAAmB,CAAC,wBAAwB,CAC1E,MAAM,EACN,wBAAwB,CAAC,MAAM,EAC/B,wBAAwB,CAAC,OAAO,CACjC,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { FirebasePerformance, HttpMetric, HttpMethod, PerformanceTrace, ScreenTrace } from './perf';
2
+ export type PerfModularDeprecationArg = string;
3
+ /**
4
+ * Namespaced perf instance used by modular entrypoints; methods accept an optional modular deprecation token.
5
+ */
6
+ export interface PerfInternal extends FirebasePerformance {
7
+ /**
8
+ * @deprecated Prefer assigning {@link FirebasePerformance.dataCollectionEnabled}.
9
+ */
10
+ setPerformanceCollectionEnabled(enabled: boolean): Promise<null>;
11
+ newTrace(name: string, deprecationArg?: PerfModularDeprecationArg): PerformanceTrace;
12
+ startTrace(name: string, deprecationArg?: PerfModularDeprecationArg): Promise<PerformanceTrace>;
13
+ newScreenTrace(screenName: string, deprecationArg?: PerfModularDeprecationArg): ScreenTrace;
14
+ startScreenTrace(screenName: string, deprecationArg?: PerfModularDeprecationArg): Promise<ScreenTrace>;
15
+ newHttpMetric(url: string, httpMethod: HttpMethod, deprecationArg?: PerfModularDeprecationArg): HttpMetric;
16
+ }
17
+ export interface RNFBPerfTraceData {
18
+ metrics: Record<string, number>;
19
+ attributes: Record<string, string>;
20
+ }
21
+ export interface RNFBPerfHttpMetricData {
22
+ attributes: Record<string, string>;
23
+ httpResponseCode?: number;
24
+ requestPayloadSize?: number;
25
+ responsePayloadSize?: number;
26
+ responseContentType?: string;
27
+ }
28
+ export interface RNFBPerfNativeModule {
29
+ isPerformanceCollectionEnabled: boolean;
30
+ isInstrumentationEnabled: boolean;
31
+ setPerformanceCollectionEnabled(enabled: boolean): Promise<null>;
32
+ instrumentationEnabled(enabled: boolean): Promise<null>;
33
+ startTrace(id: number, identifier: string): Promise<null>;
34
+ stopTrace(id: number, traceData: RNFBPerfTraceData): Promise<null>;
35
+ startHttpMetric(id: number, url: string, httpMethod: HttpMethod): Promise<null>;
36
+ stopHttpMetric(id: number, metricData: RNFBPerfHttpMetricData): Promise<null>;
37
+ startScreenTrace(id: number, identifier: string): Promise<null>;
38
+ stopScreenTrace(id: number): Promise<null>;
39
+ }
40
+ declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
41
+ interface ReactNativeFirebaseNativeModules {
42
+ RNFBPerfModule: RNFBPerfNativeModule;
43
+ }
44
+ }
45
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../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,MAAM,WAAW,oBAAoB;IACnC,8BAA8B,EAAE,OAAO,CAAC;IACxC,wBAAwB,EAAE,OAAO,CAAC;IAClC,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,OAAO,QAAQ,+DAA+D,CAAC;IAC7E,UAAU,gCAAgC;QACxC,cAAc,EAAE,oBAAoB,CAAC;KACtC;CACF"}
@@ -0,0 +1,128 @@
1
+ import type { ReactNativeFirebase } from '@react-native-firebase/app';
2
+ /**
3
+ * Firebase Performance Monitoring package for React Native.
4
+ *
5
+ * #### Example 1
6
+ *
7
+ * Access the firebase export from the `perf` package:
8
+ *
9
+ * ```js
10
+ * import { firebase } from '@react-native-firebase/perf';
11
+ *
12
+ * // firebase.perf().X
13
+ * ```
14
+ *
15
+ * #### Example 2
16
+ *
17
+ * Using the default export from the `perf` package:
18
+ *
19
+ * ```js
20
+ * import perf from '@react-native-firebase/perf';
21
+ *
22
+ * // perf().X
23
+ * ```
24
+ *
25
+ * #### Example 3
26
+ *
27
+ * Using the default export from the `app` package:
28
+ *
29
+ * ```js
30
+ * import firebase from '@react-native-firebase/app';
31
+ * import '@react-native-firebase/perf';
32
+ *
33
+ * // firebase.perf().X
34
+ * ```
35
+ *
36
+ * @firebase perf
37
+ */
38
+ /**
39
+ * @deprecated Use the modular type exports from `@react-native-firebase/perf` instead.
40
+ * `FirebasePerformanceTypes` is kept for backwards compatibility with the namespaced API.
41
+ */
42
+ export declare namespace FirebasePerformanceTypes {
43
+ type FirebaseModule = ReactNativeFirebase.FirebaseModule;
44
+ /**
45
+ * @deprecated Use the `HttpMethod` type from the modular package exports instead.
46
+ */
47
+ export type HttpMethod = 'GET' | 'HEAD' | 'PUT' | 'POST' | 'PATCH' | 'TRACE' | 'DELETE' | 'CONNECT' | 'OPTIONS';
48
+ /**
49
+ * @deprecated Use the `PerformanceTrace` type from the modular package exports instead.
50
+ */
51
+ export interface Trace {
52
+ getAttribute(attribute: string): string | undefined;
53
+ putAttribute(attribute: string, value: string): void;
54
+ getMetric(metricName: string): number;
55
+ getMetrics(): {
56
+ [key: string]: number;
57
+ };
58
+ putMetric(metricName: string, value: number): void;
59
+ incrementMetric(metricName: string, incrementBy?: number): void;
60
+ removeMetric(metricName: string): void;
61
+ start(): Promise<null>;
62
+ stop(): Promise<null>;
63
+ }
64
+ /**
65
+ * @deprecated Use the `ScreenTrace` type from the modular package exports instead.
66
+ */
67
+ export interface ScreenTrace {
68
+ start(): Promise<null>;
69
+ stop(): Promise<null>;
70
+ }
71
+ /**
72
+ * @deprecated Use the `HttpMetric` type from the modular package exports instead.
73
+ */
74
+ export interface HttpMetric {
75
+ getAttribute(attribute: string): string | undefined;
76
+ getAttributes(): {
77
+ [key: string]: string;
78
+ };
79
+ putAttribute(attribute: string, value: string): void;
80
+ removeAttribute(attribute: string): void;
81
+ setHttpResponseCode(code: number | null): void;
82
+ setRequestPayloadSize(bytes: number | null): void;
83
+ setResponsePayloadSize(bytes: number | null): void;
84
+ setResponseContentType(contentType: string | null): void;
85
+ start(): Promise<null>;
86
+ stop(): Promise<null>;
87
+ }
88
+ /**
89
+ * @deprecated Use static exports from the package root instead.
90
+ */
91
+ export interface Statics {
92
+ SDK_VERSION: string;
93
+ }
94
+ /**
95
+ * @deprecated Use the `FirebasePerformance` type from the modular package exports instead.
96
+ */
97
+ export interface Module extends FirebaseModule {
98
+ app: ReactNativeFirebase.FirebaseApp;
99
+ isPerformanceCollectionEnabled: boolean;
100
+ instrumentationEnabled: boolean;
101
+ dataCollectionEnabled: boolean;
102
+ /**
103
+ * @deprecated prefer setting `dataCollectionEnabled = boolean`.
104
+ */
105
+ setPerformanceCollectionEnabled(enabled: boolean): Promise<null>;
106
+ newTrace(identifier: string): Trace;
107
+ startTrace(identifier: string): Promise<Trace>;
108
+ newScreenTrace(identifier: string): ScreenTrace;
109
+ startScreenTrace(identifier: string): Promise<ScreenTrace>;
110
+ newHttpMetric(url: string, httpMethod: HttpMethod): HttpMetric;
111
+ }
112
+ export {};
113
+ }
114
+ /**
115
+ * Attach namespace to `firebase.` and `FirebaseApp.`.
116
+ */
117
+ declare module '@react-native-firebase/app' {
118
+ namespace ReactNativeFirebase {
119
+ import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
120
+ interface Module {
121
+ perf: FirebaseModuleWithStatics<FirebasePerformanceTypes.Module, FirebasePerformanceTypes.Statics>;
122
+ }
123
+ interface FirebaseApp {
124
+ perf(): FirebasePerformanceTypes.Module;
125
+ }
126
+ }
127
+ }
128
+ //# sourceMappingURL=namespaced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../../lib/types/namespaced.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;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1C,UAAU,mBAAmB,CAAC;QAC5B,OAAO,yBAAyB,GAAG,mBAAmB,CAAC,yBAAyB,CAAC;QACjF,UAAU,MAAM;YACd,IAAI,EAAE,yBAAyB,CAC7B,wBAAwB,CAAC,MAAM,EAC/B,wBAAwB,CAAC,OAAO,CACjC,CAAC;SACH;QACD,UAAU,WAAW;YACnB,IAAI,IAAI,wBAAwB,CAAC,MAAM,CAAC;SACzC;KACF;CACF"}
@@ -0,0 +1,72 @@
1
+ import type { FirebaseApp } from '@react-native-firebase/app';
2
+ /**
3
+ * Configuration options for Performance Monitoring (aligned with {@link https://firebase.google.com/docs/reference/js/performance.performancesettings | PerformanceSettings} in the Firebase JS SDK).
4
+ */
5
+ export interface PerformanceSettings {
6
+ /** Whether to collect custom events. */
7
+ dataCollectionEnabled?: boolean;
8
+ /** Whether to collect out-of-the-box events. */
9
+ instrumentationEnabled?: boolean;
10
+ }
11
+ /**
12
+ * Valid HTTP methods for HTTP metrics.
13
+ */
14
+ export type HttpMethod = 'GET' | 'HEAD' | 'PUT' | 'POST' | 'PATCH' | 'TRACE' | 'DELETE' | 'CONNECT' | 'OPTIONS';
15
+ /**
16
+ * A performance trace (aligned with {@link https://firebase.google.com/docs/reference/js/performance.performancetrace | PerformanceTrace} in the Firebase JS SDK).
17
+ *
18
+ * @remarks React Native uses async `start`/`stop` (native bridge). The web SDK uses synchronous `start`/`stop`. React Native also exposes `getMetrics` and `removeMetric`, which are not on the web `PerformanceTrace` type.
19
+ */
20
+ export interface PerformanceTrace {
21
+ getAttribute(attr: string): string | undefined;
22
+ putAttribute(attr: string, value: string): void;
23
+ getMetric(metricName: string): number;
24
+ getMetrics(): {
25
+ [key: string]: number;
26
+ };
27
+ putMetric(metricName: string, num: number): void;
28
+ incrementMetric(metricName: string, num?: number): void;
29
+ removeMetric(metricName: string): void;
30
+ start(): Promise<null>;
31
+ stop(): Promise<null>;
32
+ }
33
+ /**
34
+ * Screen trace for slow/frozen frames (React Native).
35
+ */
36
+ export interface ScreenTrace {
37
+ start(): Promise<null>;
38
+ stop(): Promise<null>;
39
+ }
40
+ /**
41
+ * Network request metric (React Native; not part of the web Performance modular surface).
42
+ */
43
+ export interface HttpMetric {
44
+ getAttribute(attr: string): string | undefined;
45
+ getAttributes(): {
46
+ [key: string]: string;
47
+ };
48
+ putAttribute(attr: string, value: string): void;
49
+ removeAttribute(attr: string): void;
50
+ setHttpResponseCode(code: number | null): void;
51
+ setRequestPayloadSize(bytes: number | null): void;
52
+ setResponsePayloadSize(bytes: number | null): void;
53
+ setResponseContentType(contentType: string | null): void;
54
+ start(): Promise<null>;
55
+ stop(): Promise<null>;
56
+ }
57
+ /**
58
+ * Firebase Performance Monitoring service (aligned with {@link https://firebase.google.com/docs/reference/js/performance.firebaseperformance | FirebasePerformance} in the Firebase JS SDK).
59
+ *
60
+ * @remarks React Native adds collection/read APIs backed by native (`isPerformanceCollectionEnabled`, custom traces, HTTP metrics, screen traces).
61
+ */
62
+ export interface FirebasePerformance {
63
+ /** The FirebaseApp this Performance instance is associated with. */
64
+ app: FirebaseApp;
65
+ /** Controls logging of automatic traces and HTTP/S network monitoring. */
66
+ instrumentationEnabled: boolean;
67
+ /** Controls logging of custom traces. */
68
+ dataCollectionEnabled: boolean;
69
+ /** Whether performance data collection is enabled for this app instance (native). */
70
+ isPerformanceCollectionEnabled: boolean;
71
+ }
72
+ //# sourceMappingURL=perf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../../lib/types/perf.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gDAAgD;IAChD,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,KAAK,GACL,MAAM,GACN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,CAAC;IAC/C,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAClD,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACnD,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACzD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,GAAG,EAAE,WAAW,CAAC;IACjB,0EAA0E;IAC1E,sBAAsB,EAAE,OAAO,CAAC;IAChC,yCAAyC;IACzC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qFAAqF;IACrF,8BAA8B,EAAE,OAAO,CAAC;CACzC"}
@@ -0,0 +1,2 @@
1
+ export declare const version = "25.0.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../lib/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -16,10 +16,23 @@
16
16
  */
17
17
 
18
18
  import { isNull, isNumber, isString } from '@react-native-firebase/app/dist/module/common';
19
+
19
20
  import MetricWithAttributes from './MetricWithAttributes';
20
21
 
22
+ import type { RNFBPerfHttpMetricData, RNFBPerfNativeModule } from './types/internal';
23
+ import type { HttpMethod } from './types/perf';
24
+
21
25
  export default class HttpMetric extends MetricWithAttributes {
22
- constructor(native, url, httpMethod) {
26
+ private readonly _url: string;
27
+ private readonly _httpMethod: HttpMethod;
28
+ private _httpResponseCode: number | null;
29
+ private _requestPayloadSize: number | null;
30
+ private _responsePayloadSize: number | null;
31
+ private _responseContentType: string | null;
32
+ private _started: boolean;
33
+ private _stopped: boolean;
34
+
35
+ constructor(native: RNFBPerfNativeModule, url: string, httpMethod: HttpMethod) {
23
36
  super(native);
24
37
 
25
38
  this._url = url;
@@ -34,7 +47,7 @@ export default class HttpMetric extends MetricWithAttributes {
34
47
  this._stopped = false;
35
48
  }
36
49
 
37
- setHttpResponseCode(code) {
50
+ setHttpResponseCode(code: number | null): void {
38
51
  if (!isNumber(code) && !isNull(code)) {
39
52
  throw new Error(
40
53
  "firebase.perf.HttpMetric.setHttpResponseCode(*) 'code' must be a number or null.",
@@ -44,7 +57,7 @@ export default class HttpMetric extends MetricWithAttributes {
44
57
  this._httpResponseCode = code;
45
58
  }
46
59
 
47
- setRequestPayloadSize(bytes) {
60
+ setRequestPayloadSize(bytes: number | null): void {
48
61
  if (!isNumber(bytes) && !isNull(bytes)) {
49
62
  throw new Error(
50
63
  "firebase.perf.HttpMetric.setRequestPayloadSize(*) 'bytes' must be a number or null.",
@@ -54,7 +67,7 @@ export default class HttpMetric extends MetricWithAttributes {
54
67
  this._requestPayloadSize = bytes;
55
68
  }
56
69
 
57
- setResponsePayloadSize(bytes) {
70
+ setResponsePayloadSize(bytes: number | null): void {
58
71
  if (!isNumber(bytes) && !isNull(bytes)) {
59
72
  throw new Error(
60
73
  "firebase.perf.HttpMetric.setResponsePayloadSize(*) 'bytes' must be a number or null.",
@@ -64,7 +77,7 @@ export default class HttpMetric extends MetricWithAttributes {
64
77
  this._responsePayloadSize = bytes;
65
78
  }
66
79
 
67
- setResponseContentType(contentType) {
80
+ setResponseContentType(contentType: string | null): void {
68
81
  if (!isString(contentType) && !isNull(contentType)) {
69
82
  throw new Error(
70
83
  "firebase.perf.HttpMetric.setResponseContentType(*) 'contentType' must be a string or null.",
@@ -74,7 +87,7 @@ export default class HttpMetric extends MetricWithAttributes {
74
87
  this._responseContentType = contentType;
75
88
  }
76
89
 
77
- start() {
90
+ start(): Promise<null> {
78
91
  if (this._started) {
79
92
  return Promise.resolve(null);
80
93
  }
@@ -83,13 +96,13 @@ export default class HttpMetric extends MetricWithAttributes {
83
96
  return this.native.startHttpMetric(this._id, this._url, this._httpMethod);
84
97
  }
85
98
 
86
- stop() {
99
+ stop(): Promise<null> {
87
100
  if (this._stopped) {
88
101
  return Promise.resolve(null);
89
102
  }
90
103
  this._stopped = true;
91
104
 
92
- const metricData = {
105
+ const metricData: RNFBPerfHttpMetricData = {
93
106
  attributes: Object.assign({}, this._attributes),
94
107
  };
95
108