Files
react-native/Libraries/WebPerformance/NativePerformanceObserver.js
T
Ruslan Shestopalyuk 3aea05651d Remove "first-input" event type from Event Timing API logging implementation (#35771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35771

[Changelog][Internal]
Based on the internal discussion, we don't want to report `first-input` event types for RN (just use plain `event` instead), in the way that [Event Timing API standard suggests](https://www.w3.org/TR/event-timing), as this is doesn't have that clear semantics in the context of RN, also to keep it simpler.

Reviewed By: rubennorte

Differential Revision: D42341923

fbshipit-source-id: eff2487dee17ef082604e4c807b4d41485328114
2023-01-04 08:29:15 -08:00

50 lines
1.2 KiB
JavaScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
export const RawPerformanceEntryTypeValues = {
UNDEFINED: 0,
MARK: 1,
MEASURE: 2,
EVENT: 3,
};
export type RawPerformanceEntryType = number;
export type RawPerformanceEntry = {|
name: string,
entryType: RawPerformanceEntryType,
startTime: number,
duration: number,
// For "event" entries only:
processingStart?: number,
processingEnd?: number,
interactionId?: number,
|};
export type GetPendingEntriesResult = {|
entries: $ReadOnlyArray<RawPerformanceEntry>,
droppedEntriesCount: number,
|};
export interface Spec extends TurboModule {
+startReporting: (entryType: string) => void;
+stopReporting: (entryType: string) => void;
+popPendingEntries: () => GetPendingEntriesResult;
+setOnPerformanceEntryCallback: (callback?: () => void) => void;
}
export default (TurboModuleRegistry.get<Spec>(
'NativePerformanceObserverCxx',
): ?Spec);