API symmetry when passing PerformanceEntryType to/from native module

Summary:
[Changelog][Internal]

`NativePerformanceObserver` TurboModule API would get the type for performance entries as strings in one direction (`start/stopReporting`) and as integers in another direction (inside `RawPerformanceEntry`, for optimization on the native side).

This makes is symmetrical and consistent, all the conversions are now handled on the JS side.

Reviewed By: christophpurrer

Differential Revision: D43236466

fbshipit-source-id: 08e1b62df90e6d26a11577d6b6b1d91a6bce8339
This commit is contained in:
Ruslan Shestopalyuk
2023-02-13 10:44:06 -08:00
committed by Facebook GitHub Bot
parent e168db4c3b
commit aef7194996
4 changed files with 34 additions and 24 deletions
@@ -38,8 +38,8 @@ export type GetPendingEntriesResult = {|
|};
export interface Spec extends TurboModule {
+startReporting: (entryType: string) => void;
+stopReporting: (entryType: string) => void;
+startReporting: (entryType: RawPerformanceEntryType) => void;
+stopReporting: (entryType: RawPerformanceEntryType) => void;
+popPendingEntries: () => GetPendingEntriesResult;
+setOnPerformanceEntryCallback: (callback?: () => void) => void;
}