diff --git a/src/libs/Metrics/index.js b/src/libs/Metrics/index.js deleted file mode 100644 index 2c90f1c51b65..000000000000 --- a/src/libs/Metrics/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import CONFIG from '../../CONFIG'; - -// We don't capture performance metrics on web as there are enough tools available -const canCapturePerformanceMetrics = () => false; - -const canCaptureOnyxMetrics = () => Boolean(CONFIG.ONYX_METRICS); - -export {canCapturePerformanceMetrics, canCaptureOnyxMetrics}; diff --git a/src/libs/Metrics/index.native.js b/src/libs/Metrics/index.native.js deleted file mode 100644 index f57526e674ba..000000000000 --- a/src/libs/Metrics/index.native.js +++ /dev/null @@ -1,17 +0,0 @@ -import CONFIG from '../../CONFIG'; - -/** - * Is capturing performance stats enabled. - * - * @returns {Boolean} - */ -const canCapturePerformanceMetrics = () => CONFIG.CAPTURE_METRICS; - -/** - * Is capturing Onyx stats enabled. - * - * @returns {Boolean} - */ -const canCaptureOnyxMetrics = () => CONFIG.ONYX_METRICS; - -export {canCapturePerformanceMetrics, canCaptureOnyxMetrics}; diff --git a/src/libs/Metrics/index.native.ts b/src/libs/Metrics/index.native.ts new file mode 100644 index 000000000000..526e5c57a269 --- /dev/null +++ b/src/libs/Metrics/index.native.ts @@ -0,0 +1,14 @@ +import CONFIG from '../../CONFIG'; +import {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; + +/** + * Is capturing performance stats enabled. + */ +const canCapturePerformanceMetrics: CanCapturePerformanceMetrics = () => CONFIG.CAPTURE_METRICS; + +/** + * Is capturing Onyx stats enabled. + */ +const canCaptureOnyxMetrics: CanCaptureOnyxMetrics = () => CONFIG.ONYX_METRICS; + +export {canCapturePerformanceMetrics, canCaptureOnyxMetrics}; diff --git a/src/libs/Metrics/index.ts b/src/libs/Metrics/index.ts new file mode 100644 index 000000000000..7c33f31cb19e --- /dev/null +++ b/src/libs/Metrics/index.ts @@ -0,0 +1,9 @@ +import CONFIG from '../../CONFIG'; +import {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; + +// We don't capture performance metrics on web as there are enough tools available +const canCapturePerformanceMetrics: CanCapturePerformanceMetrics = () => false; + +const canCaptureOnyxMetrics: CanCaptureOnyxMetrics = () => CONFIG.ONYX_METRICS; + +export {canCapturePerformanceMetrics, canCaptureOnyxMetrics}; diff --git a/src/libs/Metrics/types.ts b/src/libs/Metrics/types.ts new file mode 100644 index 000000000000..61b1400ae9f8 --- /dev/null +++ b/src/libs/Metrics/types.ts @@ -0,0 +1,4 @@ +type CanCapturePerformanceMetrics = () => boolean; +type CanCaptureOnyxMetrics = () => boolean; + +export type {CanCapturePerformanceMetrics, CanCaptureOnyxMetrics};